Rules Engine

Last modified: May 23, 2019 @ 11:48

Overview

In this guide you will learn how to create Events with Rules, Resource Collections, and an Actuator.

Prerequisites:
  • Access to a Device Network

Create a Device

See: Create a Device Type

  1. Create a Device Type named LightSwitch_DT. Add the Smart Object Types Presence (3302) and Light Control (3311).
  2. Register a Device named LightSwitch using your newly created Device Type.

Create/Edit Resource Collections

Resource Collections are used to refer to Resources when creating Events, Rules, and Actuators.

More information: Resource Collection

Create a Resource Collection

  1. Click Settings -> Resource Collections -> +Create.
  2. In the Name field, enter LightSwitch_RC.
  3. In the Smart Objects panel, click the Type (Type ID) dropdown and select Presence (3302) and Light Control (3311).
  4. In the Resources panel, click the Type (Type ID) dropdown and select Digital Input State (5500) and On/Off (5850). Click Save.

Event, Rule, and Actuator

Create an Event

  1. Click Settings -> Event Settings -> +Create. Enter the name LightSwitch_Event and click Save.

Add a Rule

First, you will add a Rule:

  1. Events tab: click the Event you just created. On the Rules panel, click +Create New.
  2. Enter the name LightSwitch_Rule. Optionally, fill in the Description and Severity Level fields.
  3. Click the Resource Collections dropdown and choose the Resource Collection LightSwitch_RC that you created earlier.
  4. If you want the Rule trigger to be reset manually, enable the Threshold trigger reset switch.
  5. Configure the actual Rule trigger: a combination of certain resource values.
  6. Click Save.

Add an Actuator

Now, you will add an Actuator to the Light Relay Resource Collection:

  1. On the Event Settings screen, go to LightSwitch_Event, Actuators panel, and click +Create New.
  2. Enter the name LightSwitch_Actuator.
  3. Choose the Resource Collection LightSwitch_RC.
  4. Choose the Actuator type Resource Values.
  5. Choose the action to be taken on the Resources within the collection.
  6. Click Save.
  7. Click Save on the Event screen.