|  Developer
Updated on December 2, 2022

isItemStateChanged

  • These events arise when the of the item has changed from one corresponding to the value to one corresponding to the value.
    When the expected transition of the item value happens, the event switches its state to and then instantly switches back to .
  • The event supports expressions. Expressions may be used for start and/or finish values.
    Change of the value of an expression doesn’t make the event re-check if the item’s value satisfies event’s parameters, ergo change in expression cannot cause triggering the event.
  • The event may be used to check if any of those transitions happened:
  • — event is triggered for any change of the item value.
  • — event is triggered when the item value becomes equal to the specified value regardless of its previous value.
  • — event is triggered when the item value was equal to the specified value before the change.
  • — event is triggered when the item value transits from one specified value to another. A reaction is started when the item value becomes equal to the value and finishes when it becomes equal to the value, no matter how long and how many steps it takes.

This feature is available since advanced_scenes/1.30.

Edit
FieldTypeRequiredDescription
blockOptions.method.args.item
blockOptions.method.args.expression
item expression+Id of an item or expression whose value to check.
blockOptions.method.args.start[any]The value from which item should transit to another value to trigger the event conditions check. May be a certain value or . Optional, default is .
blockOptions.method.args.finish[any]The value, transition to which will trigger the event conditions check. May be a certain value or . Optional, default is .
Edit
Internal error code Message Data
SCENE_WRONG_WHEN_BLOCK isItemStateChanged: empty id of an item ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK isItemStateChanged: cannot create valid ‘start’ value: [REASON] ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK isItemStateChanged: cannot create valid ‘finish’ value: [REASON] ezlo.scenes.block.when.wrong
SCENE_WRONG_WHEN_BLOCK isItemStateChanged: ‘start’ is incomparable with old value of the item ([START VALUE TYPE] – [ITEM VALUE TYPE]) scenes.when.type.mismatch
SCENE_WRONG_WHEN_BLOCK isItemStateChanged: ‘start’ is incomparable with new value of the item ([START VALUE TYPE] – [ITEM VALUE TYPE]) scenes.when.type.mismatch
SCENE_WRONG_WHEN_BLOCK isItemStateChanged: ‘finish’ is incomparable with new value of the item ([FINISH VALUE TYPE] – [ITEM VALUE TYPE]) scenes.when.type.mismatch
Edit
				
					{
    "blockType":"when",
    "blockOptions":{
        "method":{
            "name":"isItemStateChanged",
            "args":{
                "item":"item",
                "start": "start",
                "finish": "finish"
            }
        }
    },
    "fields":[
        {
            "name":"item",
            "type":"item",
            "value":"897607_32771_1"
        },
        {
            "name":"start",
            "type":"int",
            "value":10
        },
        {
            "name":"finish",
            "type":"expression",
            "value":"my_best_expression"
        }
    ]
}