|  Developer
Updated on June 23, 2022

compareNumberRange

  • Compare number values.
  • This feature is available since version. Item or expression values are compared according to a conditional comparator that can take two values: or . The default is . The value of the comparator is assumed to be the condition: In the case of not_between: .

When the condition is met, the scene should be triggered.

Edit
Field Type Required Description
blockOptions.method.args.item
blockOptions.method.args.expression
item
expression
+ Id of item or expression which value need to use for checking.
blockOptions.method.args.startValue int/float + First value of the range.
blockOptions.method.args.endValue int/float + Last value of the range.
blockOptions.method.args.comparator string Type of comparator. Possible values: , . Default value: .
blockOptions.method.args.startValue.scale string Scale value for startValue.
blockOptions.method.args.endValue.scale string Scale value for endValue.
Edit
Internal error code Message Data
BAD_PARAMS Wrong params, rpc.params.invalid.
Edit
				
					{
   "blockType":"when",
      "blockOptions":{
         "method":{
            "name":"compareNumberRange",
            "args":{
               "item":"item",
               "comparator":"comparator",
               "startValue":"startValue",
               "endValue":"endValue"
            }
         }
      },
      "fields":[
         {
            "name":"item",
            "type":"item",
            "value":"5de64f6a70c7be0541cc0853"
         },
         {
            "name":"comparator",
            "type":"string",
            "value":"between"
         },
         {
            "name":"startValue",
            "type":"int",
            "value":51,
            "scale":"degrees"
         },
         {
            "name":"endValue",
            "type":"int",
            "value":100,
            "scale":"degrees"
         }
      ]
}