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 Triggers in the nav bar.
2. Tap the + icon 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.
4. Let’s begin by giving our trigger a name. Enter “Temp High, Turn on Light” into the Trigger Name
5. We’re going to trigger when our temperature sensor does something, so tap the IF tile to start selecting our device.From the list of devices that appear, select our Temperature sensor since that’s what we want to monitor.
6. 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 Temperature Above from the list.
7. We want to take action once the temperature is high by turning on our light. Tap the THEN tile and select our Light Switch from the list of devices that appears.
8. After selecting our light switch, we’re shown a list of actions we can take on the light. We want to turn on the light, so select On from the list.
9. We’re done! Tap Save to complete our trigger and return to the Triggers list where our new trigger is shown.
10. 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.