– are almost the same as when blocks. They also consist of events of the same structure, but they have a few differences:
- they don’t affect scene execution;
- their states are evaluated during creation.
They are used for foreign mechanisms dependent on block states (e.g. exceptions in actions).
- block json representation:
|blockOptions||JsonObject||+||Options of the block|
|blockOptions.method||JsonObject||+||Json representation of the function for triggering|
|blockOptions.method.args||JsonObject||+||Json object with the names of the fields that must be extracted from the list|
|blockOptions.method.name||string||+||Describes the event type. Possible values: see below|
|blockType||string||–||Name of the block type. Should be set as “when”|
|blockMeta||JsonObject||–||Block metadata info|
|blockName||string||–||User name of block|
|actionGroup||string||–||ID of an action group that this “when” block is linked to. Must be unique within the space of “when” blocks. After scene creation the value is replaced with the ID of the “when” block.|
|fields||JsonArray||+||Array of the triggers. There is used the same format as it is in the then block but item address, values etc|
|fields.type||Enum||+||Represents the Item Value Type, or can be set to to represent an expression value.|
|fields.value||Any Json Value||+||Actual value corresponding the field name. In case of an item it is a constant representation of an item value to compare changed item value with. In case of “expression” type, the “value” field should contain a name of an expression (see Scenes expression related commands.|