Thing Definition Automations

Prev Next

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:

  1. Enter the Automations page.

  2. Select the Thing Definitions tab.

  3. Select the Thing Definition to edit.

  4. Press the Add Automation button.

  5. Provide the required information.

  6. 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.

According to the event type, different event conditions can be then specified.

Measure Update triggered Automation

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

Event triggered Automation

This event is triggered every time a specific Event is activated or cleared.

The condition requires selecting an Event of the thing definition.

Optionally, you can specify a minimum time, beyond which, if the event is still active the automation is triggered

Automation 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.

Automation 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.

Automation Execution policy

The automation is periodically evaluated, for more details refer to the Periodic Evaluations article.