Rules
Each Rule define the follow-up actions based on current 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.
Conditions define when the action is executed. There can be multiple conditions for one rule. In order to execute the action, all conditions have to be fulfilled (unless specified else by the operator).
The operator has 2 possible values - AND (default) and OR and is used if rule has multiple conditions. If set to AND, all conditions have to be fulfilled to execute the action, if set to OR, at least one of the conditions has to be fulfilled.
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.
In the field actions are specified actions which will be executed when conditions are fulfilled and filter (filters) is active (if set). One rule can have multiple actions.
Rules allow to trigger follow-up actions based on fulfillment of specified conditions (defined by PAB or Watchdog). The actions can change output states (turn OFF, turn ON, toggle, etc.) or trigger an alarm in Cloud. There can be more conditions for one action and based on definition must apply both (AND) or at least one of them (OR). Also, multiple actions can be defined for a set of conditions. Additionally , evaluation of actions can be filtered by conditions set in filters
variable. If the precondition in filter is not met, conditions do not get evaluated.
When all the conditions specified in conditions
are met (and the preconditions in filters
as well), all actions defined in actions
will be executed.
Contents
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)