Threshold Triggers

Overview

Treshold triggers allows to set a numeric threshold to test two conditions:

  1. When the new published data value becomes greater or equal (>=) to the threshold value. This implies that the previous data value was lower than the treshold value.
  2. When the new published data value becomes lower (<) than the threshold. This implies that the previous data value was higher than the treshold.

Thresholds can be Positive and negative numeric values.  Periods (.) are supported but not commas (,).

Threshold trigger actions are only executed when the threshold is crossed. If the new data published has a value that remains beyond the threshold. The trigger will not be executed again.

Example:

  1. Set the threshold to 90.
  2. Create an action that executes when the data value is >= to 90.
  3. Publish 100 on the channel. The trigger action is executed, since it is the first time data is published.
  4. Publish 80 on the channel. The trigger action is not executed.
  5. Publish 91 on the channel. The trigger action is executed.
  6. Publish 99 on the channel. The trigger action is not executed.
  7. Publish 78 on the channel. The trigger action is not executed.
  8. Publish 95 on the channel. The trigger action is executed.

Supported actions are:

This guide describes how to create a Threshold trigger and provides a full example on how to create and test the trigger on a device.

Create Threshold trigger

  1. Open the Trigger (Triggers) panel from a Production Template or device’s General (General) tab.
  2. Click on the New trigger (New Trigger) button.
  3. Give the Trigger a Name, set Event to Data published.
  4. Set Rule Type to Thresholds.
  5. Click on the New Treshold (New Trigger) button.
  6. Enter the threshold value (numeric, positive or negative).
  7. Select the action type required and fill out the Action screen. You can set multiple actions for the same trigger and use the Special Symbols available to program the actions.

Full Example

Here is a full example on how to create and test a Treshold Trigger on the Data Field “temperature”" of a channel called Boiler1.

Follow the steps above to create a Threshold trigger called Temp alert on channel Boiler1. We will publish data objects as JSON.

1. Set the channel to Boiler1 and the Data field to temperature.
2. Add a Threshold rule. Set the Threshold value to 40, and add an save an email notification action called Email alert above when the data value is equal to or exceeds the Threshold, as shown here. Email Action1
3. Add and save an email notification action called Email alert below when the data value is below the threshold. Email Action2
4. Save the Rule. Save rule
5. Save the Trigger. Save trigger
6. Save the device. Save Thing
7. Publish the JSON {“temperature”:30,“pressure”:80} in the Data field temperature of channel Boiler1. Data1
8. Verify that the email message Boiler temp ok at 30 ºC has been received. Email1
9. Publish the JSON {“temperature”:50,“pressure”:98} in the Data field temperature of channel Boiler1. Data2
10. Verify that the email message Alarm! Boiler temperature exceeded 40 has been received. Email2
11. Publish the JSON {“temperature”:39,“pressure”:90} in the Data field temperature of channel Boiler1. Data3
12. Verify that the email message Boiler temp ok at 39 ºC has been received. Email3
13. The data published in channel Boiler1 is displayed as follows:. Channel data
Still need help? Get in touch!
Last updated on 6th May 2021