title | description | author | ms.author | ms.date | ms.topic | ms.service | services | ms.custom | manager |
---|---|---|---|---|---|---|---|---|---|
Configure rules and actions in Azure IoT Central | Microsoft Docs |
This tutorial shows you, as a builder, how to configure telemetry-based rules and actions in your Azure IoT Central application. |
ankitgupta |
ankitgup |
10/12/2018 |
tutorial |
iot-central |
iot-central |
mvc |
peterpr |
This article applies to operators, builders, and administrators.
In this tutorial, you create a rule that sends an email when the temperature in a connected air conditioner device exceeds 90° F.
In this tutorial, you learn how to:
[!div class="checklist"]
- Create a telemetry-based rule
- Add an action
Before you begin, you should complete the Define a new device type in your application tutorial to create the Connected Air Conditioner device template to work with.
-
To add a new telemetry-based rule to your application, in the left navigation menu, choose Device Explorer:
You see the Connected Air Conditioner (1.0.0) device template and the Connected Air Conditioner-1 device you created in the previous tutorial.
-
To start customizing your connected air conditioner device, choose the device you created in the previous tutorial:
-
To start adding a rule in the Rules view, choose Rules and then click Edit Template:
-
To create a threshold-based telemetry rule, click New Rule, and then Telemetry.
-
To define your rule, use the information in the following table:
Setting Value Name Air conditioner temperature alert Enable rule for all devices of this template On Enable rule on this device On Condition Temperature is greater than 90 Aggregation None
When you define a rule, you also define an action to run when the rule conditions are met. In this tutorial, you add an action to send an email as a notification that the rule triggered.
-
To add an Action, first Save the rule and then scroll down on the Configure Telemetry Rule panel and choose the + next to Actions, then choose Email:
-
To define your action, use the information in the following table:
Setting Value To Your email address Notes Air conditioner temperature exceeded the threshold. [!NOTE] To receive an email notification, the email address must be a user ID in the application, and that user must have signed in to the application at least once.
-
Choose Save. Your rule is listed on the Rules page:
-
Choose Done to exit the Edit Template mode.
Shortly after you save the rule, it becomes live. When the conditions defined in the rule are met, your application sends a message to the email address you specified in the action.
Note
After your testing is complete, turn off the rule to stop receiving alerts in your Inbox.
In this tutorial, you learned how to:
[!div class="nextstepaction"]
- Create a telemetry-based rule
- Add an action
Now that you have defined a threshold-based rule the suggested next step is to Customize the operator's views.
To learn more about different types of rules in Azure IoT Central and how to parameterize the rule definition, see: