on
2022-07-29
1:28 AM
- edited on
2025-08-01
1:11 AM
by
Laurids_PETERSE
Tutorial: Create a rule and set up notifications in your Azure IoT Central application for the STM32U5 board.
Introduction:
In this article, we use Azure IoT Central to monitor the telemetry sent by a device and create a rule that automatically invokes an action, such as sending an email. Devices use telemetry to send numerical data from the device. A rule triggers when the selected telemetry crosses a specified threshold.
The board we use is a B-U585I-IOT20A board. It provides functionalities such as a temperature and humidity sensor (highlighted in red) as well as a low power microcontroller and other sensors such as a magnetometer, accelerometer, gyroscope, pressure, Time-of-Flight, and gesture-detection. It also provides a Wi-Fi module, which allows us to connect it to Azure IoT Central.
The board can be purchased here .
In this tutorial, you create a rule to send an email when the temperature read by the temperature sensor exceeds 20°C.
In this tutorial, you learn how to:
Requirements:
After going through the article, you should have:
To create a telemetry rule, the device template must include at least one telemetry value. This tutorial uses the B-U585I-IOT20A board that sends temperature telemetry. The rule monitors the temperature reported by the device and sends an email when it goes above 20-degree Celsius.
Note: There is a limit of 50 rules per application.
Conditions define the criteria that the rule monitors. In this tutorial, you configure the rule to fire when the temperature exceeds 20° C.
Choose an aggregation type, such as average or sum, from the aggregation drop-down menu when you choose a time aggregation.
You can add multiple conditions to a rule by selecting + Condition. When multiple conditions are added, you can specify if all the conditions must be met or any of the conditions must be met for the rule to trigger. If you are using time aggregation with multiple conditions, all the telemetry values must be aggregated.
After you define the condition, you set up the actions to take when the rule fires. Actions are invoked when all the conditions specified in the rule are evaluated to be true.
Note: Emails are only sent to the users that have been added to the application and have logged in at least once.
If you no longer need a rule, delete it by opening the rule and choosing Delete.