In this guide you will learn how to create Events with Rules, Resource Collections, and an Actuator.
- Access to a Device Network
Create a Device
See: Create a Device Type
- Create a Device Type named LightSwitch_DT. Add the Smart Object Types Presence (3302) and Light Control (3311).
- 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
- Click Settings -> Resource Collections -> +Create.
- In the Name field, enter LightSwitch_RC.
- In the Smart Objects panel, click the Type (Type ID) dropdown and select Presence (3302) and Light Control (3311).
- 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
- Click Settings -> Event Settings -> +Create. Enter the name LightSwitch_Event and click ✓Save.
Add a Rule
First, you will add a Rule:
- Events tab: click the Event you just created. On the Rules panel, click +Create New.
- Enter the name LightSwitch_Rule. Optionally, fill in the Description and Severity Level fields.
- Click the Resource Collections dropdown and choose the Resource Collection LightSwitch_RC that you created earlier.
- If you want the Rule trigger to be reset manually, enable the Threshold trigger reset switch.
- Configure the actual Rule trigger: a combination of certain resource values.
- Click ✓Save.
Add an Actuator
Now, you will add an Actuator to the Light Relay Resource Collection:
- On the Event Settings screen, go to LightSwitch_Event, Actuators panel, and click +Create New.
- Enter the name LightSwitch_Actuator.
- Choose the Resource Collection LightSwitch_RC.
- Choose the Actuator type Resource Values.
- Choose the action to be taken on the Resources within the collection.
- Click ✓Save.
- Click ✓Save on the Event screen.