When blocks

when block currently supports one or several events (conditions) and these blocks are connected by OR logical operators by default.

when block json representation:

Field Type Required Description
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 fields 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"
blockName string - User name of 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
fields[].value Any Json Value + actual value corresponding the field name

isItemState

This events arises when the value of item is equal to the value is set in this when block. Optionally it checks device armed status by logical AND operator with isItemState condition.

parameters:

Field Type Required Description
blockOptions.method.args.item string + Argument declaration of item ID. The value should be in field block with nameitem.
blockOptions.method.args.value string + Argument declaration of item value. The value should be in field block with namevalue.
blockOptions.method.args.armed string - Argument declaration of armed state of device is corresponding to current item. The value should be in field block with namearmed. This adds optional condition checks device armed status and is connected with isItemState condition by logical AND operator.

Example:

"when" : [{
   "blockOptions":{
      "method":{
         "args":{
            "item":"item",
            "value":"value",
            "armed":"armed"
         },
         "name":"isItemState"
      }
   },
   "blockType":"when",
   "fields":[
      {
          "name":"item",
          "type":"item",
          "value" : "35656_5656_56"
      },
      {
          "name":"value",
          "type":"int",
          "value":0
      },
      {
          "name":"armed",
          "type":"bool",
          "value":true
      }
   ]
}]

isButtonState

This events arises when the value.button_state of button_state item is equal to the value is set in this when block. The Button Actions describe the possible values of this item.

parameters:

Field Type Required Description
blockOptions.method.args.item string + Argument declaration of item ID. The value should be in field block with nameitem.
blockOptions.method.args.value string + Argument declaration of item button_state. The value should be in field block with namevalue.

Example:

"when" : [{
   "blockOptions":{
      "method":{
         "args":{
            "item":"item",
            "value":"value"
         },
         "name":"isButtonState"
      }
   },
   "blockType":"when",
   "fields":[
      {
          "name":"item",
          "type":"item",
          "value" : "5e0218ea7f00003636b60dc8"
      },
      {
          "name":"value",
          "type":"token",
          "value":"released"
      }
   ]
}]

isInterval

Triggering periodically by time interval

parameters:

Field Type Required Description
blockOptions.method.args.interval string + The time interval is interval format

Example:

"when" : [{
   "blockOptions":{
      "method":{
         "args":{  
            "interval":"interval"
         },
         "name":"isInterval"
      }
   },
   "blockType":"when",
   "fields":[
      {
         "name":"interval",
         "type":"interval",
         "value":"212s"
      }
   ]
}]

isSunState

Triggering periodically corresponding sunset/sunrise event. It's possible to set the special days of the week or days of the month. The time offset after/before sunset or sunrise could be used. Also the ranges till/from midnight could be used.

parameters:

Field Type Required Description
blockOptions.method.args.sunstate string + The name of argument defines sun state. The possible names of argument: sunset, sunrise. The value of field defines time offset direction. The possible values: intime, before or after. The intimemeans event is triggered in sunset/sunrise time. The before or after means time offset is added before or after sunset/sunrise time. The time offset is defined in time parameter.
blockOptions.method.args.time string - The time offset in hms_interval
blockOptions.method.args.weekdays string - Argument declaration of weekday array. The value should be in field block with nameweekday. The weekday array contains integer numbers. The possible values are 1..7 range. Type int_array. See Item Value Type.
blockOptions.method.args.days string - Argument declaration of day array. The value should be in field block with nameday. The day array contains integer numbers. The possible values are 1..31 range. If day is set to 31 then event works in each month where 31st day is present. Type int_array. See Item Value Type.
blockOptions.method.args.range string - Possible values: after - all time after defined moment till midnight of current day; before - all time after midnight till defined moment; at - just once at defined moment of time (not range). Default value: at. This feature is available since advanced_scenes/1.1 version.

Example:

"when" : [{
   "blockOptions":{
      "method":{
         "args":{  
            "sunstate":"sunrise",
            "time":"time",
            "days":"days",
            "range":"range"
         },
         "name":"isSunState"
      }
   },
   "blockType":"when",
   "fields":[
      {
         "name":"sunrise",
         "type":"string",
         "value":"before"
      },
      {
         "name":"time",
         "type":"hms_interval",
         "value":"10:30"
      },
      { 
          "name": "days",
          "type": "int_array",
          "value": [ 1, 5, 12 ]
      },       
      {
         "name":"range",
         "type":"token",
         "value":"after"
      }
   ]
}]

isDate

Triggering periodically when the particular time, day or month has come. Daily event arises in each time what is within time array. Weekly event arises in each weekday what is set within weekday array in time what is set within time array. Monthly event arises in each day what is set within day array in time what is set within time array. The Gregorian Calendar is used.

parameters:

Field Type Required Description
blockOptions.method.args.type string + Argument declaration of schedule type. The value should be in field block with nametype. The possible values are daily, weekly or monthly. Daily type requires presence of time array only. Weekly type requires presence of both time array and weekday array. Monthly type requires presence of both time array and day array.
blockOptions.method.args.time string + Argument declaration of time array. The value should be in field block with nametime. The time array contains strings. The time format is "hh:mm" in 24-hour clock format. Type 24_hours_time_array. See Item Value Type.
blockOptions.method.args.weekdays string - Argument declaration of weekday array. The value should be in field block with nameweekday. The weekday array contains integer numbers. The possible values are 1..7 range. Type int_array. See Item Value Type.
blockOptions.method.args.days string - Argument declaration of day array. The value should be in field block with nameday. The day array contains integer numbers. The possible values are 1..31 range. If day is set to 31 then event works in each month where 31st day is present. Type int_array. See Item Value Type.

Examples:

"when" : [{ 
    "blockOptions":{ 
        "method":{ 
            "args":{ 
                "type":"type",
                "time":"time"
            },
            "name":"isDate"
        }
    },
    "blockType":"when",
    "fields":[ 
        { 
            "name": "type",
            "type": "string",
            "value": "daily"
        },
        { 
            "name": "time",
            "type": "24_hours_time_array",
            "value": [ "10:20", "12:40", "13:32" ]
        }
    ]
}]
"when" : [{ 
    "blockOptions":{ 
        "method":{ 
            "args":{ 
                "type":"type",
                "time":"time",
                "weekdays":"weekdays"
            },
            "name":"isDate"
        }
    },
    "blockType":"when",
    "fields":[ 
        { 
            "name": "type",
            "type": "string",
            "value": "weekly"
        },
        { 
            "name": "time",
            "type": "24_hours_time_array",
            "value": [ "10:20", "12:40", "13:32" ]
        },
        { 
            "name": "weekdays",
            "type": "int_array",
            "value": [ 1, 2, 7 ]
        }
    ]
}]
"when" : [{ 
    "blockOptions":{ 
        "method":{ 
            "args":{ 
                "type": "type",
                "time":"time",
                "days":"days"
            },
            "name":"isDate"
        }
    },
    "blockType":"when",
    "fields":[ 
        { 
            "name": "type",
            "type": "string",
            "value": "monthly"
        },
        { 
            "name": "time",
            "type": "24_hours_time_array",
            "value": [ "10:20", "12:40", "13:32" ]
        },
        { 
            "name": "days",
            "type": "int_array",
            "value": [ 1, 5, 12 ]
        }
    ]
}]

isOnce

Triggering when the particular date has come. The specific time, day, month and year should be set. The Gregorian Calendar is used.

parameters:

Field Type Required Description
blockOptions.method.args.time string + Argument declaration of time. The value should be in field block with nametime. The time is string. The time format is "hh:mm" in 24-hour clock format. Represents 24 hours time type.
blockOptions.method.args.day string - Argument declaration of day. The value should be in field block with nameday. The day is integer number. The possible values are 1..31 range but should not be more than last day of month. Represents int type.
blockOptions.method.args.month string + Argument declaration of month. The value should be in field block with namemonth. The month is integer number. The possible values are 1..12. Represents int type.
blockOptions.method.args.year string + Argument declaration of year. The value should be in field block with nametime. The year is integer number. Represents int type.

Examples:

"when" : [{ 
    "blockOptions":{ 
        "method":{ 
            "args":{ 
                "time": "time",
                "day": "day",
                "month": "month",
                "year": "year"
            },
            "name":"isOnce"
        }
    },
    "blockType":"when",
    "fields":[ 
        { 
            "name": "time",
            "type": "24_hours_time",
            "value": "10:20"
        },
        { 
            "name": "day",
            "type": "int",
            "value": 5
        },
        { 
            "name": "month",
            "type": "int",
            "value": 12
        },
        { 
            "name": "year",
            "type": "int",
            "value": 2019
        },
    ]
}]

isDateRange

The date range condition becomes TRUE when current date is in between start date and end date if start date is greater than end date. If start date is less than end date condition becomes TRUE when current date is less than start date or is greater than and end ( inverted range ). All arguments is optional but at least one of parameter should set.

This feature is available since advanced_scenes/1.1 version.

schedule types:

Schedule type Description
Daily Only the start time or the end date or both are set. If time is not set than default value is used. Example: 10:20 is the start time and the end time is not set then range starts from 10:20 till 23:59 every day. If 17:30 is start and 12:30 is end then it is inverted range starts from 17:30 till next day in 12:30 every day.
Monthly The start day or the end day or both are set. If 31th day is set and month has only 30th day than 30th day is used. The start and the end time could be also set. Example: 5th day and 10:20 time is start and 10th day and 14:30 time is end then range starts from 5th day in 10:20 till 10th day in 14:30 every month. If time is not set then range starts from 5th day in 00:00 till 10th day in 23:59 every month.
Yearly The start month or the end month or both are set. The day and time could be also set. Example: 4th month, 5th day and 10:20 time is start and 9th month, 10th day and 14:30 time is end then range starts from 04-04T10:20 till 09-10T14:30 every year. If day and time is not set then range starts from 04-01T00:00 till 09-30T23:59 every year.
Years The start year or the end year or both are set. The month, day and time could be also set. Example: 2021 year, 4th month, 5th day and 10:20 time is start and 2023 year, 9th month, 10th day and 14:30 time is end then range starts from 2021-04-04T10:20 till 2023-09-10T14:30 every year. If only years are set then another parameter has default values. For example: 2021 year is start and 2023 year is end then range starts from 2021-01-01T00:00 till 2023-12-31T23:59.

parameters:

Field Type Required Description
blockOptions.method.args.startTime 24_hours_time - Time when condition become TRUE. Default value: 00:00.
blockOptions.method.args.startDay int - Day when condition become TRUE. Default value: 1.
blockOptions.method.args.startMonth int - Month when condition become TRUE. Default value: 1.
blockOptions.method.args.startYear int - Year when condition become TRUE. Default value: 1.
blockOptions.method.args.endTime 24_hours_time - Time when condition become FALSE. Default value: 23:59.
blockOptions.method.args.endDay int - Day when condition become FALSE. Default value: last day of endMonth.
blockOptions.method.args.endMonth int - Month when condition become FALSE. Default value: 12.
blockOptions.method.args.endYear int - Year when condition become FALSE. Default value: 9223372036854775807.

Errors:

Internal error code Message Data
SCENE_DATE_RANGE_NOT_DEFINED Start or End of date range should be defined ezlo.scenes.block.when.date.range.not.defined
SCENE_WRONG_DATE Wrong date ezlo.scenes.block.when.date
SCENE_WRONG_TIME Wrong time ezlo.scenes.block.when.time
SCENE_WRONG_TIME_FORMAT Wrong time format ezlo.scenes.block.when.time.format
WRONG_FIELD Wrong field of object rpc.params.wrong_field

Examples:

"when" : [{
   "blockOptions":{
      "method":{
         "name":"isDateRange",
         "args":{
            "startTime":"startTime",
            "startDay":"startDay",
            "startMonth":"startMonth",
            "startYear":"startYear",
            "endTime":"endTime",
            "endDay":"endDay",
            "endMonth":"endMonth",
            "endYear":"endYear",
         }
      }
   },
   "blockType":"when",
   "fields":[
        {
            "name": "startTime",
            "type": "24_hours_time",
            "value": "10:20"
        },
        {
            "name": "startDay",
            "type": "int",
            "value": 5
        },
        {
            "name": "startMonth",
            "type": "int",
            "value": 12
        },
        {
            "name": "startYear",
            "type": "int",
            "value": 2019
        },
        {
            "name": "endTime",
            "type": "24_hours_time",
            "value": "10:20"
        },
        {
            "name": "endDay",
            "type": "int",
            "value": 5
        },
        {
            "name": "endMonth",
            "type": "int",
            "value": 12
        },
        {
            "name": "endYear",
            "type": "int",
            "value": 2021
        },
   ]
}]

isUserLockOperation

Triggering when the particular user locks door lock by entering a pin code.

parameters:

Field Type Required Description
blockOptions.method.args.item string + Argument declaration of Item ID of user_lock_operation item. The name is item. The type is item.
blockOptions.method.args.state string + Argument declaration of State. The name is state. The type is token. The value is always set to lock.
blockOptions.method.args.user string + Argument declaration of User ID. This User ID is one of keys are contained in itemId item. The type is dictionaryId. The corresponding field contains optionItemValue what contains itemId item Id.

Example:

{
    "blockType":"when",
    "blockOptions":{
        "method":{
            "name":"isUserLockOperation",
            "args":{
                "item":"item",
                "state":"state",
                "user":"user"
            }
        }
    },
    "fields":[
        {
            "name":"item",
            "type":"item",
            "value":"5e4a5fef7f0000707ff6e9b2"
        },
        {
            "name":"state",
            "type":"token",
            "value":"lock"
        },
        {
            "name":"user",
            "type":"dictionaryId",
            "optionItemValue": {
                "itemId": "5e4a5fef7f0000707ff6e9bd"
            },
            "value":"3"
        }
    ]
}

isHouseModeChangedTo

Triggering when any of house modes from list is set.

This feature is available since advanced_scenes/1.1 version.

parameters:

Field Type Required Description
blockOptions.method.args.houseMode houseModeId_array + Target house mode id

Example:

"when" : [{
   "blockOptions":{
      "method":{
         "name":"isHouseModeChangedTo",
         "args":{
            "houseMode":"houseMode"
         }
      }
   },
   "blockType":"when",
   "fields":[
      {
         "name":"houseMode",
         "type":"houseModeId_array",
         "value": [ "1", "2"]
      }
   ]
}]

isHouseModeChangedFrom

Triggering when any of house modes from list was set previously.

This feature is available since advanced_scenes/1.1 version.

parameters:

Field Type Required Description
blockOptions.method.args.houseMode houseModeId_array + Target house mode id

Example:

"when" : [{
   "blockOptions":{
      "method":{
         "name":"isHouseModeChangedFrom",
         "args":{
            "houseMode":"houseMode"
         }
      }
   },
   "blockType":"when",
   "fields":[
      {
         "name":"houseMode",
         "type":"houseModeId_array",
         "value": [ "1", "2"]
      }
   ]
}]

isNetworkState

Reacting on different network state changes.

This feature is available since advanced_scenes/1.1 version.

parameters:

Field Type Required Description
blockOptions.method.args.interface networkId - Id of network interface from hub.network.get request.
blockOptions.method.args.state token + Type of trigger. Possible values: main - when the defined interface become using as main interface. If the interface is not defined than it should be always true and triggered when any interface were changed. failed - this block is true when defined interface cannot establish Internet connection or has any problems with configuration. If interface is not defined then main interface should be used for making checking.

Example:

"when" : [{
   "blockType":"when",
   "blockOptions":{
      "method":{
         "name":"isNetworkState",
         "args":{
              "interface":"id",
              "state":"state"
         }
      }
   },
   "fields":[
        {
           "name":"id",
           "type":"networkId",
           "value":"mobile0"
        },
        {
           "name":"state",
           "type":"token",
           "value":"main"
        },
   ]
}]

isSceneState

Execute scene if another scene is finished with corresponding status or if another scene is enabled or disabled.

This feature is available since advanced_scenes/1.2 version.

parameters:

Field Type Required Description
blockOptions.method.args.scene sceneId + The id of target scene
blockOptions.method.args.state token + The state of target scene. Possible values: failed, finished, partially_finished, any_result, scene_enabled, scene_disabled. The tokens failed, finished, partially_finished mean corresponding result of target scene. The tokenany_result means any result of target scene. The tokens scene_enabled, scene_disabled mean target scene is enabled or disabled.

Errors:

Internal error code Message Data
SCENE_WHEN_RECURSIVE_EXECUTE Scene contain conditions with current scene id scenes.when.recursive_execute
SCENE_DOES_NOT_EXIST The scene with this id does not exist ezlo.scenes.not.exist

Example:

"when" : [{
   "blockType":"when",
   "blockOptions":{
      "method":{
         "name":"isSceneState",
         "args":{
            "scene":"scene",
            "state":"state"
         }
      }
   },
   "fields":[
      {
         "name":"scene",
         "type":"sceneId",
         "value": "5c7ff48b7f00002a07a408e3"
      },
      {
         "name":"state",
         "type":"token",
         "options":[
             {
                 "value":"failed",
                 "label":{
                     "lang_tag":"scene_state_failed",
                     "text":"Scene failed"
                 }
             },
             {
                 "value":"successful",
                 "label":{
                     "lang_tag":"scene_state_successful",
                     "text":"Scene finished successfully"
                 }
             },
             {
                 "value":"changed",
                 "label":{
                     "lang_tag":"scene_state_any",
                     "text":"Scenes was triggered to any state"
                 }
             },
             {
                 "value":"off",
                 "label":{
                     "lang_tag":"scene_state_any",
                     "text":"Any state"
                 }
             },
             {
                 "value":"on",
                 "label":{
                     "lang_tag":"scene_state_any",
                     "text":"Any state"
                 }
             }
         ],
         "value": "finished"
      }
   ]
}]

isCloudState

Execute scene if cloud connection is lost or established.

This feature is available since advanced_scenes/1.3 version.

parameters:

Field Type Required Description
blockOptions.method.args.state token + The cloud connection state. Possible values: connected - the controller is connected to NMA server; disconnected - the controller lost connection with NMA server.

Example:

"when" : [{
   "blockType":"when",
   "blockOptions":{
      "method":{
         "name":"isCloudState",
         "args":{
             "state":"state"
         }
      }
   },
   "fields":[
        {
           "name":"state",
           "type":"token",
           "value":"connected"
        }
   ]
}]

compareNumbers

This event arises when the value of item is corresponded to condition is set in this block. For example, if the comparator is ==, value is equal to 50 and item value is 50 then event arises. If condition is >50 then event arises only once when threshold was exceeded. For example, if item value is 49 and after that item value becomes 51 then event arises. When item value becomes 52 the event doesn't arise. The event will arise again when threshold was exceeded again. Similar situation is for other comparators ( >=, <, <= ).

parameters:

Field Type Required Description
blockOptions.method.args.item string + Argument declaration of item ID. The value should be in field block with nameitem.
blockOptions.method.args.value string + Argument declaration of item value. The value should be in field block with namevalue.
blockOptions.method.args.comparator string + Argument declaration of comparator state. The value should be in field block with namecomparator. Possible comparators are ==, !=, >, >=, <, <=.

Example:

"when" : [
    {
        "blockType":"when",
        "blockOptions":{
            "method":{
                "name":"compareNumbers",
                "args":{
                    "item":"item",
                    "comparator":"comparator",
                    "value":"value"
                }
            }
        },
        "fields":[
            {
                "name":"item",
                "type":"item",
                "value":"5de64f6a70c7be0541cc0853"
            },
            {
                "name":"comparator",
                "type":"string",
                "value": ">"
            },
            {
                "name":"value",
                "type":"int",
                "value": 51
            }
        ]
    },
    {
        "blockType":"when",
        "blockOptions":{
            "method":{
                "name":"compareNumbers",
                "args":{
                    "item":"item",
                    "comparator":"comparator",
                    "value":"value"
                }
            }
        },
        "fields":[
            {
                "name":"item",
                "type":"item",
                "value":"5de64f6a70c7be0541cc0854"
            },
            {
                "name":"comparator",
                "type":"string",
                "value": "<="
            },
            {
                "name":"value",
                "type":"float",
                "value": 51.55
            }
        ]
    }
]

hasAtLeastOneDictionaryValue

This event arises every time when element is added or is updated in dictionary and value of this element is equal to value is set in this block. Dictionary could have several elements with same value.

parameters:

Field Type Required Description
blockOptions.method.args.item string + Argument declaration of item ID. The value should be in field block with nameitem.
blockOptions.method.args.value string + Argument declaration of dictionary value. The value should be in field block with namevalue.

Example:

{
    "blockId": "<ID>",
    "blockType": "when",
    "blockOptions": {
        "method": {
            "name": "hasAtLeastOneDictionaryValue",
            "args": {
                "item": "item",
                "value": "value"
            }
        }
    },
    "fields": [
        {
            "name": "item",
            "type": "item",
            "value": "5e4a5fef7f0000707ff6e9bd"
        },
        {
            "name": "value",
            "type": "token",
            "options": [
                {
                    "value": "low_battery",
                    "label": {
                        "lang_tag": "ui7_low_battery",
                        "text": "has low battery"
                    }
                },
                {
                    "value": "not_detected",
                    "label": {
                        "lang_tag": "ui7_sensor_not_detected",
                        "text": "is not detected"
                    }
                }
            ],
            "value": "low_battery"
        }
    ]
}

Logic operators


and

The AND logic operator is when block. This condition is true in case when all conditions in blocks array are true also. The AND operation could contain a different when blocks except some restrictions are described below. The AND operator could contain a nested logic operators.

parameters:

Field Type Required Description
blockOptions.method.args.blocks string + The argument declaration of blocks field. The name is "blocks". The type is "blocks". The blocks field could contain several when blocks. If all contained blocks are true then this block is also true otherwise it is false.

restrictions:

hub.scenes.edit and hub.scenes.create commands should check conflicts in conditions and send error in answer if conflict was detected:

Type of conflict Error message Error data
Have more then one isItemState block for same item Scene contain conditions for same functionality inside of AND condition scenes.when.same_item_in_and
Have more then one isButtonState block for same item Scene contain conditions for same functionality inside of AND condition scenes.when.same_button_in_and
Have more then one compareNumbers block for same item and all of that have not intersect ranges Scene contain conditions for not intersect numbers values inside of AND condition scenes.when.not_intersect_numbers
Have more then one Time condition block in AND block Scene cannot contain more than one "time" condition in the same AND operator scenes.when.more_than_one_time

Examples:

{
   "blockType":"when",
   "blockOptions":{
      "method":{
         "name":"and",
         "args":{
            "blocks":"blocks"
         }
      }
   },
   "fields":[
      {
         "name":"blocks",
         "type":"blocks",
         "value": [
           {
               __WHEN_BLOCK__
           },
           {
               __WHEN_BLOCK__
           },
           {
               "blockType":"when",
               "blockOptions":{
                  "method":{
                     "name":"and",
                     "args":{
                        "blocks":"blocks"
                     }
                  }
               },
               "fields":[
                  {
                     "name":"blocks",
                     "type":"blocks",
                     "value": [
                       {
                           __WHEN_BLOCK__
                       },
                       {
                           __WHEN_BLOCK__
                       }
                     ]
                  }
               ]
            }
         ]
      }
   ]
}

not

The NOT logic operator is when block. This condition is true if contained condition is false otherwise if contained condition is true then it is false. The NOT operation could contain any when block. The NOT operator could contain a nested logic operator.

parameters:

Field Type Required Description
blockOptions.method.args.block string + The argument declaration of block field. The name is "block". The type is "block". The block field could contain when only one block. This condition is true if contained condition is false otherwise if contained condition is true then it is false.

Examples:

{
   "blockType":"when",
   "blockOptions":{
      "method":{
         "name":"not",
         "args":{
            "block":"block"
         }
      }
   },
   "fields":[
      {
         "name":"block",
         "type":"block",
         "value": {
             "blockType":"when",
             "blockOptions":{
                 "method":{
                     "name":"not",
                     "args":{
                         "block":"block"
                     }
                 }
             },
             "fields":[
                 {
                     "name":"block",
                     "type":"block",
                     "value": {
                         __WHEN_BLOCK__
                     }
                 }
             ]
         }
      }
   ]
}

or

The OR logic operator is when block. This condition is true if any contained condition is true otherwise if all contained condition is false then it is also false. The OR operation could contain several when blocks. The OR operator could contain a nested logic operators.

parameters:

Field Type Required Description
blockOptions.method.args.blocks string + The argument declaration of blocks field. The name is "blocks". The type is "blocks". The blocks field could contain several when blocks. If any contained block is true then this block is also true otherwise it is false.

Examples:

{
   "blockType":"when",
   "blockOptions":{
      "method":{
         "name":"or",
         "args":{
            "blocks":"blocks"
         }
      }
   },
   "fields":[
      {
         "name":"blocks",
         "type":"blocks",
         "value": [
           {
               __WHEN_BLOCK__
           },
           {
               __WHEN_BLOCK__
           },
           {
               "blockType":"when",
               "blockOptions":{
                  "method":{
                     "name":"or",
                     "args":{
                        "blocks":"blocks"
                     }
                  }
               },
               "fields":[
                  {
                     "name":"blocks",
                     "type":"blocks",
                     "value": [
                       {
                           __WHEN_BLOCK__
                       },
                       {
                           __WHEN_BLOCK__
                       }
                     ]
                  }
               ]
            }
         ]
      }
   ]
}