Difference between revisions of "Rules"

From wiki.netio-products.com
Jump to navigation Jump to search
Line 1: Line 1:
 
Each Rule define the follow-up actions based on current DI / PAB / WatchDog function state. There can be several Rules executed based on one PAB function (switch output if Current > 1000 mA + Send Alert to NETIO Cloud IF Current > 500 mA). One Rule can be executed based on combination of several PAB / Watchdog states.  
 
Each Rule define the follow-up actions based on current DI / PAB / WatchDog function state. There can be several Rules executed based on one PAB function (switch output if Current > 1000 mA + Send Alert to NETIO Cloud IF Current > 500 mA). One Rule can be executed based on combination of several PAB / Watchdog states.  
  
 +
== CONDITION ==
 
Rule conditions define when the action part of each Rule is executed. There can be multiple conditions for one Rule.  
 
Rule conditions define when the action part of each Rule is executed. There can be multiple conditions for one Rule.  
 
In order to execute the action, all conditions have to be valid (AND operator) / at least one of the conditions have to be valid (OR operator).
 
In order to execute the action, all conditions have to be valid (AND operator) / at least one of the conditions have to be valid (OR operator).
  
  
 +
== FILTER (mask)==
 
The filter field specifies when the Rule is active. It acts as a mask If filter in certain time is not true, the action wont be executed even when conditions are fulfilled. Multiple filters can be set for one rule. For the rule to be active all filters must be true.
 
The filter field specifies when the Rule is active. It acts as a mask If filter in certain time is not true, the action wont be executed even when conditions are fulfilled. Multiple filters can be set for one rule. For the rule to be active all filters must be true.
  
 
Above that the FILTER can be applied (scheduler, DI (Digital Input) or DO (Output) state).  
 
Above that the FILTER can be applied (scheduler, DI (Digital Input) or DO (Output) state).  
  
 +
 +
== ACTION ==
 
ACTIONS part in the Rule contains list of several actions when condition(s) + filter(s) are valid.  
 
ACTIONS part in the Rule contains list of several actions when condition(s) + filter(s) are valid.  
  

Revision as of 17:33, 16 November 2021

Each Rule define the follow-up actions based on current DI / PAB / WatchDog function state. There can be several Rules executed based on one PAB function (switch output if Current > 1000 mA + Send Alert to NETIO Cloud IF Current > 500 mA). One Rule can be executed based on combination of several PAB / Watchdog states.

CONDITION

Rule conditions define when the action part of each Rule is executed. There can be multiple conditions for one Rule. In order to execute the action, all conditions have to be valid (AND operator) / at least one of the conditions have to be valid (OR operator).


FILTER (mask)

The filter field specifies when the Rule is active. It acts as a mask If filter in certain time is not true, the action wont be executed even when conditions are fulfilled. Multiple filters can be set for one rule. For the rule to be active all filters must be true.

Above that the FILTER can be applied (scheduler, DI (Digital Input) or DO (Output) state).


ACTION

ACTIONS part in the Rule contains list of several actions when condition(s) + filter(s) are valid.

The actions can change output states (turn OFF, turn ON, toggle, etc.) or trigger an Alarm state in NETIO Cloud.


Structure

Variable Value Description
conditions Eg: `"PAB/PAB1_1/IN": true` Conditions definition. Relationship between conditions is defined by operator (AND/OR)
operator AND/OR Optional. Specifies relationship between conditions. AND = all conditions must apply at the same time. OR = at least one condition must apply. If missing, defaults to OR
filters Eg: "SCHEDULE/MY_SCHEDULE/ACTIVE": true Filter definition. For multiple filter conditions, the relationship between them is always AND
actions Eg: "CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}" Actions definition. All actions defined here will be triggered when conditions (and filters) are met

Condition names are based on user-specified names and their types:

  • For PABs, the name has structure: PAB/pab_name/pab_output_value (TRUE/FALSE or int)
  • For Watchdogs, the name has structure: WDT/watchdog_name/FAIL

Available forms of conditions

  • "PAB/PAB1_1/IN": true = PAB1_1 is in specified interval
  • "PAB/PAB_ZONE_1/ZONE": 1 = PAB_ZONE_1 is in zone 1
  • "WDT/WATCHDOG_1/FAIL": true = WATCHDOG_1 is in ERROR state

Available forms of filters

  • "SCHEDULE/TestSchedule/ACTIVE": true = TestSchedule is active
  • "OUTPUTS/1/STATE":"on" = Output 1 is ON

Available forms of actions

  • "OUTPUTS/1/ACTION": 0 = Turn OFF Output 1
  • "OUTPUTS/6/ACTION": 2 = Short OFF Output 6
  • "CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}" = Set condition output value to the alarm (Turns the alarm ON or OFF based on condition evaluation)

Note: The variable ${COND_RESULT} contains output value of the given condition. It takes values 0 (condition not met) or 1 (condition met). It can be used for dynamic switching the alarm in Cloud ON/OFF depending on current state of the PAB.

ACTIONS - how to control outputs

  • 0 = TURN OFF
  • 1 = TURN ON
  • 2 = SHORT OFF
  • 3 = SHORT ON
  • 4 = TOGGLE - Changes the status from ON to OFF and vice versa
  • 5 = NOTHING (placeholder, DO NOT USE)