Add Action Properties

To add a block, or to add members to an existing block, publish an add action to the device’s do topic.  (For examples on the add action, see Dynamic Interfaces.)

The Add action supports the following arguments, submitted with the args parameter (described in the Properties table for Device Do Action):

Argument

Type                   

Description

name

string

(Required) If you are adding a block, the name becomes the BLOCKTYPE value in the block’s topic.  If you are adding a member, the name defines the block to which you are adding.

The if topic reports the device’s interface in blocks of functionality (see Interface Topics in Interface Blocks). Interface block objects are published in the feedback channel and can be written to in the request channel.

type

string

(Required) The type reference of the resource that is to be added.  Required except for the addition of a block that does not implement a profile.

Examples:

"SFPTclosedLoopSensor"

or

"9000010203040401-4/UNVT_example"

wildcard

string

(Required, if the operation involves wildcard types.) The IAP type reference for the datapoint type to use with profile wildcards.

When a dynamic block is based on a profile that defines datapoint or property members with a wildcard type such as SNVT_xxx, the actual datapoint type must be specified for use with the wildcard members. All wildcard members within the block share the same data type.

Example: "SNVT_switch"

arraySpec

Object

(Optional) arraySpec is a property to control the implementation of members that are defined in the profile with a degree of freedom regarding their dimension.

arraySpec can be null or missing. This leads to the default implementation of member arrays, using the smallest possible implementation as permitted by the profile. arraySpec can be an object with member name/array size pairs to communicate specific array sizes for specific members. An asterisk can be used to define the size for all members not explicitly listed in that object.

The size specified is zero for no array or a positive number N for an array with N elements. Errors arise of the requested implementation is not allowed under the rules detailed in the profile.

Examples:

This arraySpec example requests cpScenes of 32 elements, all other array members of size 4:

{
     cpScenes: 32,
     "*": 4
 }


This
arraySpec example requests that all members be implemented as single items, not as arrays:

{
     "*": 0
}


implementationObject

Required when adding datapoints or properties.

Examples:                                                                                                            

{
member: “cpSetpoint”
}

or

{
type: “SNVT_switch”,
cat: “in”
}