Threshold Triggers
Overview
Treshold triggers allows to set a numeric threshold to test two conditions:
- 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.
- 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:
- Set the threshold to 90.
- Create an action that executes when the data value is >= to 90.
- Publish 100 on the channel. The trigger action is executed, since it is the first time data is published.
- Publish 80 on the channel. The trigger action is not executed.
- Publish 91 on the channel. The trigger action is executed.
- Publish 99 on the channel. The trigger action is not executed.
- Publish 78 on the channel. The trigger action is not executed.
- Publish 95 on the channel. The trigger action is executed.
Supported actions are:
- Near real time e-mail notifications.
- Near real time SMS notifications.
- HTTP requests.
- Publish data.
- Create a JIRA trouble ticket.
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
- Open the Trigger () panel from a Production Template or device’s General () tab.
- Click on the New trigger () button.
- Give the Trigger a Name, set Event to Data published.
- Set Rule Type to Thresholds.
- Click on the New Treshold () button.
- Enter the threshold value (numeric, positive or negative).
- 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. | |
3. Add and save an email notification action called Email alert below when the data value is below the threshold. | |
4. Save the Rule. | |
5. Save the Trigger. | |
6. Save the device. | |
7. Publish the JSON {“temperature”:30,“pressure”:80} in the Data field temperature of channel Boiler1. | |
8. Verify that the email message Boiler temp ok at 30 ºC has been received. | |
9. Publish the JSON {“temperature”:50,“pressure”:98} in the Data field temperature of channel Boiler1. | |
10. Verify that the email message Alarm! Boiler temperature exceeded 40 has been received. | |
11. Publish the JSON {“temperature”:39,“pressure”:90} in the Data field temperature of channel Boiler1. | |
12. Verify that the email message Boiler temp ok at 39 ºC has been received. | |
13. The data published in channel Boiler1 is displayed as follows:. |