You can define automations, which are triggered on products specific events, to execute actions, like sending an email or calling a third-party API.
Creating an Automation
To add a new Automation to a Thing Definition, you should:
- Enter the Automations page.
- Select the Thing Definitions tab.
- Select the Thing Definition to edit.
- Press the Add Automation button.
- Provide the required information.
- Press the Save button and edit the additional information, if needed.
Editing an Automation
By selecting an Automation, you can edit its properties, including event and the related actions to be executed.
Events
According to the event type, different conditions can be then specified.
On Measure Update
This event is triggered every time the value of the selected metric changes.
The condition requires selecting a Metric of the thing definition, and specify a predicate and value.
Note that, this automation is evaluated periodically and is triggered only when the metric condition changes from false to true and remains true for at least one evaluation interval. This means that metric values with a duration of less the evaluation interval (e.g. 30 seconds) may not be detected in order to correctly trigger the event.
Moreover, the automation is stateful, this means that it is triggered only when the condition status changes from false to true. Suppose to have a condition that checks the temperature:
temperature > 50
Actions are triggered only when the value overtakes the threshold, for instance:
T1 |
40 °C |
DO NOTHING |
T2 |
50 °C |
DO NOTHING |
T3 |
55 °C |
DO ACTIONS |
T4 |
65 °C |
DO NOTHING |
T5 |
40 °C |
DO NOTHING |
T6 |
55 °C |
DO ACTIONS |
T7 |
57 °C |
DO NOTHING |
On Event Activated / Cleared
This event is triggered every time a specific Event is activated or cleared.
The condition requires selecting an Event of the thing definition.
Actions
The automation allows configuring the actions to be triggered when the condition is verified.
You can define multiple actions of these following types:
- Callback: make a POST to an endpoint URL.
This action has been deprecated and replaced by the new REST API action. - Execute Command: execute a command to the remote thing.
- Notification: send an email.
- REST API: performs an HTTPS request on an external REST API.
This action supports authentication, header configuration and payload configuration in case of POST/PUT methods.
Execution policy
The automation is periodically evaluated, for more details refer to the Periodic Evaluations article.
Options
This section allows defining options to be used within the event definition and whose value can be redefined by the end-user within the page by suing the thing-options widget.
For more details, see the Options article.
Comments
0 comments
Please sign in to leave a comment.