01 Aug Stringify Flow Basics
Stringify Flows, or automations, are what allows you to Connect Every Thing! In this blog we’ll walk you through the basics of creating a flow. We’ll start with a simple flow where you’ll learn to add things to create a flow, and then we’ll enhance it by adding a few more things.
We’ll assume that you have already added several of the things you already own to Stringify. (If you haven’t, take a look at this getting started video before you continue, then come back here).
You’ve already added several of the Things you own such as LIFX, so now we’re going to create your first Flow!
In our first example, we’ll create a simple flow that turns on your porch light at sunset. This flow has only a single trigger (the event that starts a flow) and a single action (the task a flow does).
- Launch the Stringify app, click on Flows, then click on the Create button in the upper right.
- Select things out of your library. Do this by pressing the plus button (+) at the bottom of the screen. Now, select Date & Time and your Front Porch LIFX bulb.
- Triggers must be placed to the left of actions, so drag Date & Time to any circle – then drag LIFX onto the circle to the right of it.
- Place your finger on the Date & Time thing and drag a line from Date & Time to LIFX – you are essentially using your finger to draw a line between the two things. This creates a connection between them.
- Choose a Date & Time trigger by tapping on the Date & Time thing (un-configured triggers or actions are visually indicated by a gear icon). The triggers are separated into two groups – WHEN triggers and ONLY IF triggers. For now, we will focus on the WHEN triggers. Select ‘Sunset’ and then choose options such as: when you would like this to repeat (every day), stop repeating (never), time zone, etc.
- Next, configure the LIFX action. Click on Front Porch then choose ‘Turn on.’
- That’s it – you’ve created a flow! The last step is to enable the flow by clicking on the ‘Enable’ button so the flow will run at sunset.
Here is the whole process in action:
Want to turn on more than one light? No problem! There is another way to add Things to a flow – rather than selecting Things then dragging them into the flow, you can drag your finger from a Thing or quick link to an open circle and you’ll be presented with the Select Things screen.
To add more lights, drag your finger from the yellow quick link to another open circle and you can choose additional things. Let’s choose two more lights and use the same “Turn on” action.
Time to step it up a notch – let’s add an only if condition. An only if condition (similar to the AND condition) lets you specify additional restrictions on when this flow is run. Your light is turning on at sunset, but now you only want it to turn on only if you are not home.
Stringify flows must contain a single WHEN trigger but you can include an unlimited number of ONLY IF triggers. In order to create this condition, drag the Location thing onto the flow just below Date & Time, then use your finger to drag a line between Location and the yellow link in between Date & Time and Front Porch.
Finally, click on Location to configure it. You must choose one of the ONLY IF triggers – in this case, “I am away from an area.” Enable your flow and voilà!
Combining multiple flows into one
If you want to send yourself a notification if your door opens or motion is detected when you are away. Breaking this down logically, there are two flows:
Send me a notification WHEN motion is detected ONLY IF I am away
Send me a notification WHEN the door opens ONLY IF I am away
However, with the power of Stringify, this can be done in a single flow. Stringify also allows for multiple WHEN triggers to share the same ONLY IF condition.
This is how we do it:
- Start off with a flow very similar to what we created above – dragging a motion WHEN trigger to notifications and drag the Location ONLY IF trigger to the quick link.
- Drag your contact sensor WHEN trigger to notifications, then drag Location (already configured as an ONLY IF trigger) to the second quick link.
- Finally, tap on notifications and add parameters to your notification. Parameters are bits of information that are passed along through a flow. In this case, available parameters include the name of the sensor (so you know if it was the motion or the contact sensor) as well as what time the event occurred. Add parameters by clicking on the Parameters button under the notifications text box. We have to include the names and times from both triggers so that that whichever runs the flow the action gets inserted into your notification.
Connect actions… to more actions!
Stringify allows you to create cascading flows. A cascading flow is a flow with multiple actions which run one after the other. You create a cascading flow by connecting additional actions to one another. In this example, after the porch light turns on, wait 1 minute (Timer thing action) then turn it off (the same LIFX Thing).
One thing to remember when creating a cascading flow: Stringify will only continue the flow if the previous action was successful. In other words, if LIFX reported an error when trying to turn your light on (if it was not connected, for instance), the timer will never start and we won’t try to turn the light off.
Have a favorite flow? Share it (using the share feature) with your friends or with others on the Stringify Forum!