Rules introduction
-
Rulesare used to trigger set ofOperationswhen a condition met the specification. MyController supports multiple conditions.Conditions type:
- Compare
- State
- Script
- String
- Threshold
- Threshold range
To add new
Rule, Navigate toResources>>Rules>>Add rule.
Condition -
CompareWe can compare
Sensor variable1withSensor variable2.
Example: Hall-temperature >= 20% outside-temperature
Condition -
StateWith this condition we con monitor state of
Binarytype sensor variables,Node,GatewayandResources group.
Example forSensor variable
Example for
Node
Example for
Gateway
Example for
Resources group
Condition -
ThresholdWith this condition we can monitor
Sensor variablevalues with a static value or with anotherSensor variablevalueExample with static value:

Example with another Sensor variable:

Condition -
Threshold rangeWith this condition we can monitor
Sensor variablevalue Is in range? or Is in outside range?Threshold value low(1) - low value of thresholdThreshold value high(2) - high value of thresholdInclude threshold low- When we check this field included (1) in boundaryInclude threshold high- When we check this field included (2) in boundaryIn range- When you check this box will be act asIn rangecheck, otherwiseOut side rangecheck
Example: X inside [10,56], X outside [45, 200]
Example for
In range:
Example for
Out side range:
-
Hello,
I would like to execute some operation when data from two sensors meet some condition.
For example: if (sensor1 == 0 AND sensor2 == 0) then turn_off_power.Is there a way how to do it?
Thank You,
Marek -
@Marek from UI you cannot compare two sensors. However you can writer simple script for condition. and return
trueorfalse. If you need help to write script let me know I will show some example. -
@jkandasa Thanks for the hint. I'v created following script and it works

var dimCree = mcApi.uidTag().getByUid("dimm_cree_uid");
var dimCob = mcApi.uidTag().getByUid("dimm_cob_uid");
( dimCree.sensorVariable.value == 0 && dimCob.sensorVariable.value == 0 )Thanks for all the effort,
Marek