Create and Clear Alarms
Monitor a temperature sensor and automatically create and clear alarms when readings go outside an acceptable range. This recipe uses importable alarm rule configurations so you can examine the logic and adapt it for your own scenario.
Use case
Section titled “Use case”Assume your refrigeration equipment has a temperature sensor that periodically publishes telemetry to iRis Cloud. The normal operating range is 2 °C – 5 °C. Outside this range, the condition is treated as abnormal:
- Create an alarm when temperature drops below 2 °C or rises above 5 °C.
- Clear the alarm automatically when temperature returns to the normal range.
This pattern applies to cold storage, food logistics, and industrial refrigeration monitoring.
Prerequisites
Section titled “Prerequisites”Review the Alarm rules documentation before proceeding — it covers alarm creation, trigger conditions, and the alarm lifecycle.
You also need a HMI Device to test with. Use an existing HMI Device or create a new one:
- Navigate to Entities ⇾ Devices.
- Click + and select Add new device.
- Set Name to
Thermometer, enter the HMI Device’s Access token, and click Validate. Leave License code empty to use the free trial, or enter a license code and click Validate (see Register a License to a HMI Device). - Click Add.
- Click Thermometer in the list, click the edit (pencil) button, set Device profile to
thermostat, and click Apply changes.
Alarm rules configuration
Section titled “Alarm rules configuration”Two alarm rules cover the two failure conditions:
| Rule | Alarm type | Severity | Create when | Clear when |
|---|---|---|---|---|
| High temperature | High temperature | Critical | temperature > 5 | temperature ≤ 5 |
| Low temperature | Low temperature | Warning | temperature < 2 | temperature ≥ 2 |
Each rule is evaluated on every incoming telemetry message: the value is read, compared against the create and clear conditions, and the alarm is created, updated, or cleared accordingly.
Step 1. Import the High temperature alarm rule
Section titled “Step 1. Import the High temperature alarm rule”- Download the alarm rule configuration file: high_temperature_alarm_rule.json
- Go to Alarms ⇾ Alarm rules.
- Click + and select Import alarm rule.
- Upload the downloaded file.
- Click Import.
- Specify your HMI Device or device profile as the target entity.
- Click Add.
Step 2. Import the Low temperature alarm rule
Section titled “Step 2. Import the Low temperature alarm rule”- Download the alarm rule configuration file: low_temperature_alarm_rule.json
- In Alarms ⇾ Alarm rules, click + and select Import alarm rule.
- Upload the downloaded file.
- Click Import.
- Specify your HMI Device or device profile as the target entity.
- Click Add.
Verify alarm triggering
Section titled “Verify alarm triggering”Publish test telemetry values using Check connectivity or the curl commands below.
Trigger the High temperature alarm — publish a value above 5 °C:
See also
Section titled “See also”- Alarm rules — full configuration reference
- Alarm rule tutorials — step-by-step examples for thresholds, duration, schedules, and more