|  Developer
Updated on December 5, 2022

isItemState

  • These events arise when the of item is equal to the of an item, or the value of an expression set in this when block. Optionally it checks device armed status by logical AND operator with isItemState condition. An expression can be used instead of the constant item value. These events also arise when the data source is a device/item group, the event is stateless. It arises every time the condition is true, no matter which value of an event was previously. See Stateless comparison.
Edit
Field Type Required Description
blockOptions.method.args.item string + Argument declaration of item ID. The value should be in block with name .
blockOptions.method.args.value string + Argument declaration of item value. The value should be in block with name .
blockOptions.method.args.deviceGroup string Value source for the left part of the comparison operator. References a device group by its ID. The parameter is required.
blockOptions.method.args.itemGroup string Value source for the left part of the comparison operator. References an item group by its ID. The parameter is required.
blockOptions.method.args.armed string Argument declaration of armed state of device is corresponding to current item. The value should be in block with name . This adds optional condition checks device armed status and is connected with isItemState condition by logical AND operator.
Edit
Edit
				
					"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
      }
   ]
}]				
			
Edit

Example: using an expression type

In case of type, an event will raise when the expression value will become equal to the referenced item value.

				
					"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":"expression",
          "value":"expressionName"
      }
   ]
}]				
			
Edit

Example: compare value of any item that matches the device/item group: Define a device group, define an item group, make a condition block to make a comparison of an hub.item.updated broadcast with the condition value.

The comparison is stateles s. It doesn’t have information about previous value of any item in the group.

Comparison type: stateless.

				
					"when" :{
    "blockOptions": {
        "method": {
            "args": {
                "deviceGroup": "deviceGroup",
                "itemGroup":"itemGroup",
                "value": "value"
            },
            "name": "isItemState"
        }
    },
    "blockType": "when",
    "fields": [
        {
            "name": "deviceGroup",
            "type": "device_group",
            "value": "6388c2020000005778a83997"
        },
        {
            "name":"itemGroup",
            "type":"item_group",
            "value":"5de64f6a70c7be0541cc0854"
        },
        {
            "name": "value",
            "type": "bool",
            "value": true
        }
    ]
}