Creating rules from the IoT tool

You can use the logical interface editor to create and configure notification rules. Use these rules to send event-driven notifications and to trigger actions.

By using the notification rules feature, you can add notifications that are triggered by rule conditions that you specify by using the Mapping expression language. The embedded rules can also be used to trigger built-in IoT tool actions to create actions that are executed based on rules output. For more information, see Using actions.

Before you begin

Create logical interfaces. Each logical interface comes with a preconfigured state update notification, which is by default set to not send notifications. You can reconfigure to send notifications when a device message indicates that a state has changed, or on all events.

Creating a rule using the Web console

  1. In the IoT tool, select Devices.
  2. Select Device types.
  3. Locate and expand the device type for which you created a logical interface.
  4. In the expanded device type information page, select the Interface tab.
  5. Edit the interfaces.
  6. Edit the logical interface for which you want to edit rules.
  7. In the logical interface editor, click Next until you reach the Notifications section.
  8. Click Add notification.
  9. Provide a notification name and, optionally, a description.
  10. Provide a condition for the notification.
    Conditions are Mapping expression language expressions that can take state and instance data as input and generate a boolean true or false output. For example, a condition might be $state.temperature > 100.
  11. Set the notification criteria.
    The notifications are sent based on the conditions and filtered by the notification criteria.
    • Every time
    • Frequency
    • Becomes true
    • Persists
  12. Click Apply to populate the ID field.
  13. Click Done to save the new notification rule condition.
    The interfaces are updated and Draft status icon indicates the draft status. You can now activate the interface to include the updated notification rule.
  14. Consuming rule notifications.
    You can now set up actions or configure your external applications to consume the output of your rule. For information, see Consuming rule notifications.