Rules

From wiki.netio-products.com
Revision as of 13:25, 18 November 2021 by Djestrab (talk | contribs) (Available forms of conditions)
Jump to navigation Jump to search

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).

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
  • "INPUTS/1/STATE": "on" = DI1 is currently ON (1)
  • "INPUTS/1/STATE": "off" = DI1 is currently OFF (0)

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).

Available forms of filters

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


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. There is one Alarm state reserved per each one output in the NETIO Cloud premium (only). You can verify your configuration and check sending of the Output Alarm in the Device Log.

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.


Standard output actions per each output

  • 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)


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