Getting started with the Amazon IoT Events console - Amazon IoT Events
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Getting started with the Amazon IoT Events console

This section shows you how to create an input and a detector model using the Amazon IoT Events console. You model two states of an engine: a normal state and an over-pressure condition. When the measured pressure in the engine exceeds a certain threshold, the model transitions from the normal state to the over-pressure state. Then it sends an Amazon SNS message to alert a technician about the condition. When the pressure again drops below the threshold for three consecutive pressure readings, the model returns to the normal state and sends another Amazon SNS message as a confirmation.

We check for three consecutive readings below the pressure threshold to eliminate possible stuttering of over-pressure or normal messages, in case of a nonlinear recovery phase or an anomalous pressure reading.

On the console, you can also find several pre-made detector model templates which you can customize. You can also use the console to import detector models that others have written or export your detector models and use them in different Amazon Regions. If you import a detector model, make sure that you create the required inputs or recreate them for the new Region, and update any role ARNs used.

Use the Amazon IoT Events console to learn about the following.

Define inputs

To monitor your devices and processes, they must have a way to get telemetry data into Amazon IoT Events. This is done by sending messages as inputs to Amazon IoT Events. You can do this in several ways:

  • Use the BatchPutMessage operation.

  • In Amazon IoT Core, write an Amazon IoT Events action rule for the Amazon IoT rules engine that forwards your message data into Amazon IoT Events. You must identify the input by name.

  • In Amazon IoT Analytics, use the CreateDataset operation to create a data set with contentDeliveryRules. These rules specify the Amazon IoT Events input where data set contents are sent automatically.

Before your devices can send data in this way, you must define one or more inputs. To do so, give each input a name and specify which fields in the incoming message data the input monitors.

Create a detector model

Define a detector model (a model of your equipment or process) using states. For each state, define conditional (Boolean) logic that evaluates the incoming inputs to detect significant events. When the detector model detects an event, it can change the state or initiate custom-built or predefined actions using other Amazon services. You can define additional events that initiate actions when entering or exiting a state and, optionally, when a condition is met.

In this tutorial, you send an Amazon SNS message as the action when the model enters or exits a certain state.

Monitor a device or process

If you monitor several devices or processes, specify a field in each input that identifies the particular device or process from which the input comes. See the key field in CreateDetectorModel. When the input field identified by the key recognizes a new value, a new device is identified and a detector is created. Each detector is an instance of the detector model. The new detector continues responding to inputs coming from that device until its detector model is updated or deleted.

If you monitor a single process (even if several devices or subprocesses are sending inputs), you don't specify a unique identifying key field. In this case, the model creates a single detector (instance) when the first input arrives.

Send messages as inputs to your detector model

There are several ways to send a message from a device or process as an input into an Amazon IoT Events detector that don't require you to perform additional formatting on the message. In this tutorial, you use the Amazon IoT console to write an Amazon IoT Events action rule for the Amazon IoT rules engine that forwards your message data into Amazon IoT Events.

To do this, identify the input by name and continue to use the Amazon IoT console to generate messages that are forwarded as inputs to Amazon IoT Events.

Note

This tutorial uses the console to create the same input and detector model shown in the example at Tutorials for Amazon IoT Events uses cases. You can use the this JSON example to help you follow the tutorial.