Step 3. Alarms & Notifications
Alarm in ThingsBoard represents an abnormal condition or critical event related to an entity, such as a device. Alarms are generated automatically when conditions defined in alarm rules are met (for example, when a telemetry value exceeds a threshold).
In this step, you will configure an alarm rule that detects when the temperature exceeds a defined threshold. Then, you will simulate this condition by publishing telemetry data above the threshold to trigger the alarm and generate a notification.
Step 3.1 Configure alarm rule
Section titled “Step 3.1 Configure alarm rule”Create an alarm rule that triggers when the temperature exceeds 25 °C.
Add the alarm rule
Section titled “Add the alarm rule”- Navigate to Alarms ⇾ Alarm rules.
- In the upper-right corner, click + Add alarm rule ⇾ Create new alarm rule.
In the alarm rule configuration dialog, specify the following:
General settings
Section titled “General settings”- Alarm type: High temperature
- Target entity: default
Add a telemetry argument
Section titled “Add a telemetry argument”- Click Add argument.
- Configure the argument:
• Entity type: Current entity
• Argument type: Latest telemetry
• Time series key:temperature
• Argument name:temperature - Click Add.
This creates the temperature variable used in the alarm condition.
Define the trigger condition
Section titled “Define the trigger condition”- Click Add trigger condition.
- Ensure that Severity is set to Critical.
- Add a condition in Script mode:
// Triggers an alarm when temperature is above 25 degreesreturn temperature > 25;
- Click Save.
Save the rule
Section titled “Save the rule”Click Add to save and activate the alarm rule.
The alarm will now be triggered whenever the device temperature exceeds 25 °C.
Step 3.2 Trigger an Alarm
Section titled “Step 3.2 Trigger an Alarm”Publish telemetry with a value greater than 25 °C (for example, 26).
Use the Check connectivity feature as described in Step 1.2 to send the test telemetry data.
Once the threshold is exceeded, the new active alarm can be viewed, acknowledged, or cleared from:
- the Alarms page;
- the dashboard using the Alarms widget;
- the Alarms tab in the device details page.
You can also view the new alarm notification by clicking the bell icon in the top-right corner of the screen or by opening the Notification center.
This demonstrates how ThingsBoard detects and reacts to critical conditions in real time.
Notifications
Section titled “Notifications”ThingsBoard Notification center allows you to send personalized notifications to end users about device activity, alarms, and system events within your IoT ecosystem.
Notifications can be delivered via web, email, SMS, or through third-party integrations.
You can also use the ThingsBoard Mobile Application to receive push notifications about critical events directly on your smartphone—wherever you are.