Difference between revisions of "Rules"

From wiki.netio-products.com
Jump to navigation Jump to search
(Structure)
(A representative deployment:)
 
(64 intermediate revisions by 5 users not shown)
Line 1: Line 1:
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 <code>filters</code> variable. If the precondition in filter is not met, conditions do not get evaluated.
+
Each Rule define the follow-up actions based on current DI / [https://wiki.netio-products.com/index.php?title=PAB '''PAB''']/ [https://wiki.netio-products.com/index.php?title=Watchdog '''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.
When all the conditions specified in <code>conditions</code> are met (and the preconditions in <code>filters</code> as well), all actions defined in <code>actions</code> will be executed.
 
  
== Structure ==
+
'''Rules examples are available on page:''' https://wiki.netio-products.com/index.php?title=Rules_Complete_Examples
  
{| class="wikitable"
+
== CONDITION ==
|-
+
Rule conditions define when the action part of each Rule is executed. There can be multiple conditions for one Rule.
! Variable
+
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).
! Value
+
<code>bootDelay</code> parameter <sup><code>FW 4.0.0+</code></sup> can be used to delay rule evaluation after power up (or internal periodic restart). This is useful for example for delay condition and alerts evaluation after PAB blocks are stabilized. (e.g. hysteresis or some delays).  <code>bootDelay</code> parameter <sup><code>FW 4.0.0+</code></sup> is specified in seconds [s]
! Description
 
|-
 
| conditions
 
| Eg: `"PAB/PAB1_1/IN": true`
 
| Conditions definition. Relationship between conditions is defined by <code>operator</code> (AND/OR)
 
|-
 
| operator
 
| AND/OR
 
| Optional. Specifies relationship between conditions. <code>AND</code> = all conditions must apply at the same time. <code>OR</code> = at least one condition must apply. If missing, defaults to <code>OR</code>
 
|-
 
| filters
 
| Eg: <code>"SCHEDULE/MY_SCHEDULE/ACTIVE": true<code/>
 
| Filter definition. For multiple filter conditions, the relationship betweeeen them is always <code>AND</code>
 
|-
 
| actions
 
| Eg: <code>"CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}"</code>
 
| 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:
+
<b>Example:</b>
* 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'''
+
  "conditions": {
 +
    "bootDelay": 20,
 +
    "operator": "OR",
 +
    "WDT/test2/FAIL": true,
 +
    "INPUTS/1/STATE": "off"
 +
  },
 +
  "actions": {
 +
    "OUTPUTS/1/ACTION": 4
 +
  }
 +
}
  
 
=== Available forms of conditions ===
 
=== Available forms of conditions ===
 
* <code>"PAB/PAB1_1/IN": true</code> = <code>PAB1_1</code> is in specified interval
 
* <code>"PAB/PAB1_1/IN": true</code> = <code>PAB1_1</code> is in specified interval
 
* <code>"PAB/PAB_ZONE_1/ZONE": 1</code> = <code>PAB_ZONE_1</code> is in zone 1
 
* <code>"PAB/PAB_ZONE_1/ZONE": 1</code> = <code>PAB_ZONE_1</code> is in zone 1
 +
* <code>"PAB/CR13_PAB/DAY": true</code> = daylight for current time on defined location (for use with DAYLIGHT-type PAB)
 
* <code>"WDT/WATCHDOG_1/FAIL": true</code> = <code>WATCHDOG_1</code> is in ERROR state
 
* <code>"WDT/WATCHDOG_1/FAIL": true</code> = <code>WATCHDOG_1</code> is in ERROR state
 +
* <code>"OUTPUTS/1/STATE": "on"</code> = Output 1 is currently ON (1)
 +
* <code>"INPUTS/1/STATE": "off"</code> = DI1 is currently OFF (0)
 +
* <code>"SYSTEM/DEVICE_POWER_UP": true</code> = device boot after power-cut (external power outage, lower-level system (MCU) firmware update)<sup><code>FW 4.0.0+</code></sup>
 +
* <code>"SYSTEM/DEVICE_BOOT": true</code> = device boot after soft restart (internal watchdog or periodic restart) - no Power Outage, state of outputs not changed<sup><code>FW 4.0.0+</code></sup>
 +
* <code>"NETWORK/STATE": "down"</code> = indicates network connection status, states: "up" - device is connected, "down" - device is not connected<sup><code>FW 4.0.0+</code></sup>
 +
* <code>"NETWORK/ETHERNET/STATE": "down"</code> = indicates network connection status, states: "up" - device is connected, "down" - device is not connected<sup><code>FW 4.0.0+</code></sup>
 +
* <code>"NETWORK/WIFI/STATE": "down"</code> = indicates network connection status, states: "up" - device is connected, "down" - device is not connected<sup><code>FW 4.0.0+</code></sup>
 +
 +
== 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 ===
 
=== Available forms of filters ===
Line 40: Line 43:
 
* <code>"OUTPUTS/1/STATE":"on"</code> = Output 1 is ON
 
* <code>"OUTPUTS/1/STATE":"on"</code> = Output 1 is ON
  
=== Available forms of actions ===
 
* <code>"OUTPUTS/1/ACTION": 0</code> = Turn OFF Output 1
 
* <code>"OUTPUTS/6/ACTION": 2</code> = Short OFF Output 6
 
* <code>"CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}"</code> = Set condition output value to the alarm (Turns the alarm ON or OFF based on condition evaluation)
 
 
''Note: The variable <code>${COND_RESULT}</code> 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)
 
 
== Examples ==
 
=== Watchdog monitoring ===
 
Monitor the address defined in WATCHDOG_1. If the Watchdog fails, restart device at output 1 (action 2 = SHORT OFF)
 
<nowiki>
 
{
 
  "conditions": {
 
    "WDT/WATCHDOG_1/FAIL": true
 
  },
 
  "actions": {
 
    "OUTPUTS/1/ACTION": 2
 
  }
 
}</nowiki>
 
  
----
+
== COOLDOWN functionality ==
 +
The "cooldown" family of conditions serve as a way to prevent unwanted repeat triggering of rules which have their conditions met and often changing. This is achieved by pausing rule execution for a specified time after the condition state changes based on the specific cooldown condition used. Only one cooldown condition can be present in a `conditions` block at any time. The cooldown period doesn't activate while the rule is already in a cooldown period, there needs to be a new cooldown triggering event happening after the cooldown period is over.
  
=== Watchdog monitoring with filter ===
+
=== A representative deployment: ===  
Monitor the address defined in WATCHDOG_1. If output 4 is ON (condition in filters) and the Watchdog reports a failure, restart device on output 4.
+
Controlled device (e.g. an AV matrix switcher) drives a GPIO output that is wired through a relay into a NETIO PDU digital input (DI). Immediately after the device reboots, the GPIO can briefly assert a spurious/undefined signal before settling — this transient is picked up by the relay and closes the contact on the NETIO DI, satisfying the Rule condition.
<nowiki>
 
{
 
  "conditions": {
 
    "WDT/WATCHDOG_1/FAIL": true
 
  },
 
  "filters": {
 
    "OUTPUTS/4/STATE": "on"
 
  },
 
  "actions": {
 
    "OUTPUTS/4/ACTION": 2
 
  }
 
}</nowiki>
 
  
----
 
  
=== PAB - zones ===
+
[[File:NETIO Cooldown Diagram 50pct.png |NETIO Cooldown Diagram ]]
If PAB_ZONE_1 is in zone 1 and the TestSchedule is active at the same time, turn ON output 4 (action 1 = ON)
 
<nowiki>
 
{
 
  "conditions": {
 
    "PAB/PAB_ZONE_1/ZONE": 1
 
  },
 
  "filters": {
 
    "SCHEDULE/TestSchedule/ACTIVE": true
 
  },
 
  "actions": {
 
    "OUTPUTS/4/ACTION": 1
 
  }
 
}</nowiki>
 
  
---- 
 
  
=== PAB - range ===
 
If PAB1_1 or PAB1_2 are <code>true</code>, trigger an alarm in Cloud at output 1
 
<nowiki>
 
{
 
  "conditions": {
 
    "operator": "OR",
 
    "PAB/PAB1_1/IN": true,
 
    "PAB/PAB1_2/IN": true
 
  },
 
  "actions": {
 
    "CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}"
 
  }
 
}</nowiki>
 
  
== Complete examples of conditions and rules settings ==
+
Without a cooldown condition, the Rule fires on every such transition:
=== Example for RANGE-type PAB ===
 
Níže popsané nastavení má za úkol kontrolovat zařízení připojené na prvním výstupu. U zařízení se očekává, že má v pracovních hodinách určitý odběr (load) v rozsahu 100 až 500W. Pokud bude odběr příliš nízký nebo vysoký (tzn. mimo zadaný interval) po dobu delší než 10s, je pravděpodobné, že se zařízení nachází v nežádaném stavu a je potřeba restart, který stav napraví.
 
  
The setting described below is intended to monitor a device connected to first output. The device is expected to have a certain load between 100W and 500W during working hours. If the consumption is too low or too high (i.e. outside the specified interval) for more than 10s, it is likely that the device works incorrectly and restart is needed to correct its state.
+
* <code> Device reboots → GPIO glitch → relay closes → DI triggers the Rule.</code>
 +
* <code> Rule action cuts power to the device for a fixed interval (e.g. 30 s) to force a clean restart.</code>
 +
* <code> The power cut itself causes the device to reboot, which reproduces the GPIO glitch on the next boot.</code>
 +
* <code> Steps 1–3 repeat indefinitely (observed cycle period ≈ 60–61 s), and the device never completes an uninterrupted boot sequence.</code>
  
'''PAB definition'''
+
Adding a cooldown condition (e.g. 90 s) to the Rule blocks re-evaluation for the specified window immediately after the Rule fires. Since 90 s exceeds the device's full reboot + stabilization time, the boot-time GPIO transient occurring after the forced power cut falls inside the cooldown window and is ignored. The device is therefore allowed to complete a full, uninterrupted boot cycle before the Rule can trigger again
  
PAB name: '''Watch_out1_load'''
+
=== CoolDown family ===
<nowiki>
 
{
 
  "type": "RANGE",
 
  "source": "OUTPUTS/1/LOAD",
 
  "lowerBound": 100,
 
  "upperBound": 500,
 
  "timeHysteresis": 10
 
}</nowiki>
 
  
'''Rules definition'''
+
*<code>"cooldown"</code> This is the basic cooldown condition which comes into effect whenever the rule activates (the conditions turn from `false` to `true`) and the actions block gets evaluated. This then pauses the evaluation of the rule for the specified time.
  
''Note: We use the Schedules functionality in the filter to define working hours of the week. The device monitoring will only work at time set in the Schedule.
+
   "conditions":{
 
+
     "OUTPUTS/1/STATE":"on",
Schedule name: '''Working_hours'''
+
    "cooldown":30
 
 
<nowiki>
 
{
 
   "conditions": {
 
     "PAB/Watch_out1_load/IN": 0
 
 
   },
 
   },
   "filters": {
+
   "actions":{
     "SCHEDULE/Working_hours/ACTIVE": true
+
     "OUTPUTS/2/ACTION":4,
  },
+
     "OUTPUTS/3/ACTION":4
  "actions": {
 
     "OUTPUTS/1/ACTION": 2
 
 
   }
 
   }
}</nowiki>
 
  
----
+
In this example rule whenever the output 1 turns on both outputs 2 and 3 get their state toggled. Then for 30 seconds no amount of changes in the states of output 1 the states of outputs 2 and 3 remains unchanged. After the 30 seconds elapse the rule still needs the triggering condition to happen again, therefore there needs to be an event where output 1 goes from being turned off to being in the "on" state.
  
=== Example for RANGE-type PAB (multiple action for one condition) ===
 
Defined condition checks a device connected to output 4. The device is expected to have a maximum load of 600W. If the load is too high, we want to immediately turn off the device and send an alarm to Cloud.
 
  
'''PAB definition'''
+
*<code>"falseCooldown"</code> - This cooldown condition works in the same way as the base `cooldown` condition, but the cooldown period triggers when the rule state goes from "true" to "false".
  
PAB name: '''Watch_out4_load'''
+
* <code>"allCooldown"</code> - This combines the functionality of the other cooldown conditions. It also pauses the evaluation of the rule, but triggers whenever the rule state changes from either `true` to `false` or the other way around from "false" to "true"
 
 
<nowiki>
 
{
 
  "type": "RANGE",
 
  "source": "OUTPUTS/4/LOAD",
 
  "lowerBound": 0,
 
  "upperBound": 600
 
}</nowiki>
 
  
 +
== ACTION ==
 +
ACTIONS part in the Rule contains list of several actions when condition(s) + filter(s) are valid.
  
'''Action definition'''
+
The actions can change output states (turn OFF, turn ON, toggle, etc.) or trigger an Alarm state in NETIO Cloud.
<nowiki>
+
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.
  "conditions": {
 
    "PAB/Watch_out4_load/IN": 0
 
  }
 
  "actions": {
 
    "OUTPUTS/4/ACTION": 0,
 
    "CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}"
 
  }
 
}</nowiki>
 
  
----
+
=== Available forms of actions ===
 +
* <code>"OUTPUTS/1/ACTION": 0</code> = Turn OFF Output 1
 +
* <code>"OUTPUTS/6/ACTION": 2</code> = Short OFF Output 6
 +
* <code>"CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}"</code> = Set condition output value to the alarm (Turns the alarm ON or OFF based on condition evaluation)
  
=== Example for ZONE-type PAB ===
+
''Note: The variable <code>${COND_RESULT}</code> 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.''
In this condition, the value of current at the output 2 is monitored. It is then classified to respective zone according to measured value. Depending on the zone in which is classified, different actions can be triggered:
 
* If the value of current is in zone 0, restart device on output 1
 
* If the value of current is in zone 2, turn ON alarm in Cloud
 
  
'''PAB definition'''
 
  
PAB name: '''Watch_out2_current'''
+
=== 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)
  
<nowiki>
+
== Structure ==
{
 
  "type": "ZONES",
 
  "source": "OUTPUTS/2/CURRENT",
 
  "thresholds": [
 
    50,
 
    150,
 
  ],
 
  "timeHysteresis": 10
 
}</nowiki>
 
  
'''Rules definition'''
+
{| class="wikitable"
 +
|-
 +
! Variable
 +
! Value
 +
! Description
 +
|-
 +
| conditions
 +
| Eg: `"PAB/PAB1_1/IN": true`
 +
| Conditions definition. Relationship between conditions is defined by <code>operator</code> (AND/OR)
 +
|-
 +
| operator
 +
| AND/OR
 +
| Optional. Specifies relationship between conditions. <code>AND</code> = all conditions must apply at the same time. <code>OR</code> = at least one condition must apply. If missing, defaults to <code>OR</code>
 +
|-
 +
| filters
 +
| Eg: <code>"SCHEDULE/MY_SCHEDULE/ACTIVE": true<code/>
 +
| Filter definition. For multiple filter conditions, the relationship between them is always <code>AND</code>
 +
|-
 +
| actions
 +
| Eg: <code>"CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}"</code>
 +
| Actions definition. All actions defined here will be triggered when conditions (and filters) are met
 +
|}
  
Must be defined in two separate Rules because they contain different conditions:
+
Condition names are based on user-specified names and their types:
* If the PAB is in zone 0 (0-49mA), restart the device at output 1
+
* For PABs, the name has structure: <code>PAB/pab_name/pab_output_value</code> (TRUE/FALSE or int)
* Rule name: '''Zone_restart'''
+
* For WatchDogs, the name has structure: <code>WDT/watchdog_name/FAIL</code>
  
<nowiki>
+
== Sequence <sup><code>FW 4.0.0+</code></sup> ==
{
 
  "conditions": {
 
    "PAB/Watch_out2_current/ZONE": 0
 
  },
 
  "actions": {
 
    "OUTPUTS/1/ACTION": 2
 
  }
 
}</nowiki>
 
  
 +
Sequences bring extended usability to ACTIONS. In addition to basic actions that are triggered right after certain condition (conditions) are met, sequence can be defined to enable repetitive actions.
  
* If the PAB is in zone 2 (150+ mA), send alarm to Cloud
+
=== Configuration variables ===
* Rule name: '''Zone_alarm'''
 
 
 
<nowiki>
 
{
 
  "conditions": {
 
    "PAB/Watch_out2_current/ZONE": 2
 
  },
 
  "actions": {
 
    "CLOUD/OUTPUT/1/ALARM": "${COND_RESULT}"
 
  }
 
} </nowiki>
 
 
 
----
 
 
 
=== Watchdog example ===
 
 
 
The Watchdog monitors specified IP address. The ping is sent every 60s and waits 5s for the device to respond. If the ping fails twice in a row, Watchdog returns <code>false</code> and restarts the device. After restart, it waits 120 seconds and starts monitoring again. This cycle repeats a total of 3 times, and if the device does not respond even once, the Watchdog remains in ERROR state.
 
 
 
'''Watchdog definition'''
 
 
 
Watchdog name: '''Watch_101_180'''
 
 
 
<nowiki>
 
{
 
  "target": "192.168.101.180",
 
  "pingInterval": 60,
 
  "timeout": 5,
 
  "maxTimeouts": 2,
 
  "timeToReboot": 120,
 
  "maxRestarts": 3
 
}</nowiki>
 
  
 +
{| class="wikitable"
 +
|-
 +
! Variable
 +
! Value
 +
! Description
 +
|-
 +
| repeat
 +
| int (0 to 1-MAX_INT) / true
 +
| How many times should the sequence repeat. Set <code>0</code> or <code>true</code> for indefinitely (can only be turned off by disabling the rule).
 +
|-
 +
| actions
 +
|
 +
| Standard actions as defined in section [[#ACTION| ACTION]]
 +
|-
 +
| delay
 +
| int [ms] in multiples of 100ms
 +
| '''May''' be set along with actions to be executed. Defines time the sequence waits '''after''' performing the action. The value is rounded up to hundreds of miliseconds (e.g. 85ms -> 100ms, 235ms -> 300ms).
 +
|}
  
'''Rule definition'''
+
=== Example ===
+
This example triggers one-time action along with sequence of other actions and repeats 10-times after meeting certain condition.
Rule name: '''Watch_101_180_restart'''
+
:'''Condition''': WatchDog '''CR01_WDT''' fails (receives timeout from defined address)
 +
:'''One-time action''': Restart output No. 2 (action 2 = short off/restart)
 +
:''' Sequence ''': Following steps repeat 10-times
 +
:# Turn output No. 1 ON 
 +
:# Wait 10s 
 +
:# Turn output No. 1 OFF
 +
:# Wait 2s
 +
:# Repeat
  
 
  <nowiki>
 
  <nowiki>
 
{
 
{
 
   "conditions": {
 
   "conditions": {
     "WDT/Watch_101_180/FAIL": true
+
     "WDT/CR01_WDT/FAIL": true
 
   },
 
   },
 
   "actions": {
 
   "actions": {
     "OUTPUTS/1/ACTION": 2
+
     "OUTPUTS/1/ACTION": 2,
 +
    "sequence":{
 +
      "repeat": 10,
 +
      "actions":[
 +
        {"OUTPUTS/1/ACTION": 1, "delay":10000},
 +
        {"OUTPUTS/1/ACTION": 0, "delay":2000}
 +
      ]
 +
    }
 
   }
 
   }
 
}</nowiki>
 
}</nowiki>

Latest revision as of 09:37, 11 August 2026

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.

Rules examples are available on page: https://wiki.netio-products.com/index.php?title=Rules_Complete_Examples

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). bootDelay parameter FW 4.0.0+ can be used to delay rule evaluation after power up (or internal periodic restart). This is useful for example for delay condition and alerts evaluation after PAB blocks are stabilized. (e.g. hysteresis or some delays). bootDelay parameter FW 4.0.0+ is specified in seconds [s]

Example:

{
 "conditions": {
   "bootDelay": 20,
   "operator": "OR",
   "WDT/test2/FAIL": true,
   "INPUTS/1/STATE": "off"
 },
 "actions": {
   "OUTPUTS/1/ACTION": 4
 }
}

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
  • "PAB/CR13_PAB/DAY": true = daylight for current time on defined location (for use with DAYLIGHT-type PAB)
  • "WDT/WATCHDOG_1/FAIL": true = WATCHDOG_1 is in ERROR state
  • "OUTPUTS/1/STATE": "on" = Output 1 is currently ON (1)
  • "INPUTS/1/STATE": "off" = DI1 is currently OFF (0)
  • "SYSTEM/DEVICE_POWER_UP": true = device boot after power-cut (external power outage, lower-level system (MCU) firmware update)FW 4.0.0+
  • "SYSTEM/DEVICE_BOOT": true = device boot after soft restart (internal watchdog or periodic restart) - no Power Outage, state of outputs not changedFW 4.0.0+
  • "NETWORK/STATE": "down" = indicates network connection status, states: "up" - device is connected, "down" - device is not connectedFW 4.0.0+
  • "NETWORK/ETHERNET/STATE": "down" = indicates network connection status, states: "up" - device is connected, "down" - device is not connectedFW 4.0.0+
  • "NETWORK/WIFI/STATE": "down" = indicates network connection status, states: "up" - device is connected, "down" - device is not connectedFW 4.0.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


COOLDOWN functionality

The "cooldown" family of conditions serve as a way to prevent unwanted repeat triggering of rules which have their conditions met and often changing. This is achieved by pausing rule execution for a specified time after the condition state changes based on the specific cooldown condition used. Only one cooldown condition can be present in a `conditions` block at any time. The cooldown period doesn't activate while the rule is already in a cooldown period, there needs to be a new cooldown triggering event happening after the cooldown period is over.

A representative deployment:

Controlled device (e.g. an AV matrix switcher) drives a GPIO output that is wired through a relay into a NETIO PDU digital input (DI). Immediately after the device reboots, the GPIO can briefly assert a spurious/undefined signal before settling — this transient is picked up by the relay and closes the contact on the NETIO DI, satisfying the Rule condition.


NETIO Cooldown Diagram


Without a cooldown condition, the Rule fires on every such transition:

  • Device reboots → GPIO glitch → relay closes → DI triggers the Rule.
  • Rule action cuts power to the device for a fixed interval (e.g. 30 s) to force a clean restart.
  • The power cut itself causes the device to reboot, which reproduces the GPIO glitch on the next boot.
  • Steps 1–3 repeat indefinitely (observed cycle period ≈ 60–61 s), and the device never completes an uninterrupted boot sequence.

Adding a cooldown condition (e.g. 90 s) to the Rule blocks re-evaluation for the specified window immediately after the Rule fires. Since 90 s exceeds the device's full reboot + stabilization time, the boot-time GPIO transient occurring after the forced power cut falls inside the cooldown window and is ignored. The device is therefore allowed to complete a full, uninterrupted boot cycle before the Rule can trigger again

CoolDown family

  • "cooldown" This is the basic cooldown condition which comes into effect whenever the rule activates (the conditions turn from `false` to `true`) and the actions block gets evaluated. This then pauses the evaluation of the rule for the specified time.
 "conditions":{
   "OUTPUTS/1/STATE":"on",
   "cooldown":30
 },
 "actions":{
   "OUTPUTS/2/ACTION":4,
   "OUTPUTS/3/ACTION":4
 }

In this example rule whenever the output 1 turns on both outputs 2 and 3 get their state toggled. Then for 30 seconds no amount of changes in the states of output 1 the states of outputs 2 and 3 remains unchanged. After the 30 seconds elapse the rule still needs the triggering condition to happen again, therefore there needs to be an event where output 1 goes from being turned off to being in the "on" state.


  • "falseCooldown" - This cooldown condition works in the same way as the base `cooldown` condition, but the cooldown period triggers when the rule state goes from "true" to "false".
  • "allCooldown" - This combines the functionality of the other cooldown conditions. It also pauses the evaluation of the rule, but triggers whenever the rule state changes from either `true` to `false` or the other way around from "false" to "true"

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

Sequence FW 4.0.0+

Sequences bring extended usability to ACTIONS. In addition to basic actions that are triggered right after certain condition (conditions) are met, sequence can be defined to enable repetitive actions.

Configuration variables

Variable Value Description
repeat int (0 to 1-MAX_INT) / true How many times should the sequence repeat. Set 0 or true for indefinitely (can only be turned off by disabling the rule).
actions Standard actions as defined in section ACTION
delay int [ms] in multiples of 100ms May be set along with actions to be executed. Defines time the sequence waits after performing the action. The value is rounded up to hundreds of miliseconds (e.g. 85ms -> 100ms, 235ms -> 300ms).

Example

This example triggers one-time action along with sequence of other actions and repeats 10-times after meeting certain condition.

Condition: WatchDog CR01_WDT fails (receives timeout from defined address)
One-time action: Restart output No. 2 (action 2 = short off/restart)
Sequence : Following steps repeat 10-times
  1. Turn output No. 1 ON
  2. Wait 10s
  3. Turn output No. 1 OFF
  4. Wait 2s
  5. Repeat
{
  "conditions": {
    "WDT/CR01_WDT/FAIL": true
  },
  "actions": {
    "OUTPUTS/1/ACTION": 2,
    "sequence":{
      "repeat": 10,
      "actions":[
        {"OUTPUTS/1/ACTION": 1, "delay":10000},
        {"OUTPUTS/1/ACTION": 0, "delay":2000}
      ]
    }
  }
}