Setting up your first Trigger

Using the Triggers & Alerts feature, you can easily create triggered actions on and between your Pis, sensors and actuators based upon the state your devices. Turn on the lights when someone comes home, or open the blinds when the sun comes up. Cayenne makes creating such events easy by guiding you through this process.

Let’s create our first trigger. We’ll create a trigger to turn on our light when the temperature reaches a certain value.

1. To begin creating a Trigger, open the up the feature by selecting Alerts & Triggers in the navigation menu.

2. Click the New Trigger button to start creating a new trigger.

3. The Create Trigger screen appears.

From here, you can fill in all the details required for creation of your trigger. When creating a new trigger, the empty screen serves as an overview of the creation process. To make this process easy, you will be guided through trigger creation that is easy to follow and select the devices and actions that you want.

Example: IF my device senses something, THEN do something in response.

1. Let’s begin by giving our trigger a name. Enter “Temp High, Turn on Light” into the Trigger Name field.

2. We’re going to trigger when our temperature sensor does something. The Temperature sensor is located on our RaspberryPi device, so drag & drop the RaspberryPi device into the IF statement.

3. After selecting the Temperature sensor, we can choose whether we want to trigger an action if temperature is above or below a certain value. We want to react to the temperature being high, so we select the Temperature from the list and select Temperature Above in the options presented.

4. We want to take action once the temperature is high by turning on our light. Out Light is also located on the RaspberryPi device, so drag & drop that device into the THEN statement area.

5. We can now choose an action to take on RaspberryPi. Since we want to turn on the light, select LightSwitch from the actions list and then choose On from the list of options available.

6. We’re done! Click Save Trigger to complete our trigger and return to the Triggers list where our new trigger is shown.

7. Cayenne will automatically synchronize the trigger with the Pi and will now start monitoring the temperature sensor and when it reaches the correct temperature your trigger will automatically run.