With Homey you can easily automate you’re home lights, you can see an example of this here. In the following examples we are going to take a light and step by step update our flow to turn it into an automated light. While these examples are simple, the same concepts are used for almost any flow you will create in the future.
We are going to start this flow using the simplest flow, {when} and action happens {then} do another action. In this example when its night time then turn porch light on.
Ingredients
[Fibaro Switch] (But you can use any smart light globe or switch.)
[Date & Time] card, which give us access to time, date, day and even sun actions.
Actions
{when}
{then}
Method
It is very easy to set a porch light and it can done in just by using the {when} and {then}
Click the + symbol from the flow screen, You will be shown the {when} section.
Click ⨁ Add Card button and you will be shown the ‘Select an event list’.
Select the ‘Date & time’ card option, this will then automatically show you a list of options.
From the options select the ‘The sun sets’ card, then click the ✓ in the top right.
Slide up the {then} area and click on the ⨁ Add Card button.
Select the ‘porch light’ device you would like to turn on
Select ‘turn on’ from the options then click the ✓ in the top right.
And finally click ✓ Save from the bottom left of the screen.
{when} it is sunset {then} turn on ‘the porch light’
The outcome
This flow does exactly what it looks like, when the sun sets the flow will be triggered then it will turn on the porch light. It is just the start of our automated flow.
Previously we created a flow, which would turn on the porch light at sunset, but we can do as many actions as we like. In this example we will be adding a second {then} which will also brighten the Homey LED when the sun sets.
Ingredients
[Fibaro Switch] (But you can use any smart light globe or switch.)
[Date & Time] card, which give us access to time, date, day and even sun actions.
[LED Ring] card, which gives us access to some homey LED ring actions.
Actions
{when}
{then}
Method
Using the flow we started in the previous post, adding another {then} action is as simple as going to {then} section and adding another action.
Slide up the {then} section
Click ⨁ Add Card
Select the ‘LED Ring’ action a list of options will be displayed.
Select the ‘Set Brightness’ option and the values of this option will be displayed.
Move the slider to ‘100%’ then click the ✓ in the top right.
And finally click ✓ Save from the bottom left of the screen.
Just as we can add additional {then} actions to a flow we can also easily add additional conditions which must be met before the actions will trigger. These are called {and} because {when} a trigger happens {and} another criteria is met {then} the action happens.
It might be worth noting that if the {and} criteria is not met then the action will not happen.
Or in our case, {when} the sun sets {and} we are not home{then} turn on the porch light, {then} set the homey to 100% brightness.
Ingredients
[Fibaro Switch] (But you can use any smart light globe or switch.)
[Date & Time] card, which give us access to time, date, day and even sun actions.
[LED Ring] card, which gives us access to some homey LED ring actions.
[Presence] card, which give us access to actions about peoples presence in the house.
Actions
{when}
{and}
{then} x 2
Method
Just like the previous examples, we will be just adding a new card, this time though we will be adding it to the {and} section.
After clicking edit, slide up the {and} section.
Click the ⨁ Add Card and a list of possible conditions will load.
Select the [Presence] condition and the options for that condition will be shown.
Select the option [Nobody is home] then follow the normal process for saving.
WIth Homey, we actually have access to another second conditional in addition to {and}, which is {or}. Just like the {and} the {or} does exactly what it does in the English language. If a condition is met OR another condition is met.
Because we quite often have guests on weekend nights in Spring, we also want the porch light to be on every Friday in Spring, even if we are home.
So in our case, {when} the sun sets {and} we are not home {or} its the weekend {and} its spring{then} turn on the porch light {then} set the homey to 100% brightness.
Ingredients
Fibaro Switch (But you can use any smart light globe or switch.)
[Date & Time] card, which give us access to time, date, day and even sun actions.
[LED Ring] card, which gives us access to some homey LED ring actions.
[Presence] card, which give us access to actions about peoples presence in the house.
Actions
{when}
{and}
{or} + {and}
{then} x 2
Method
This time we will be just adding two new cards, both of them into the {or} area.
After clicking edit, slide up the {and} section.
Click the ⨁ Add Card and a list of possible conditions will load.
Select the [Date & time] card option, this will then automatically show you a list of options
From the options select the [Today is a …] card.
Click on the day of the week and change it to [weekend], then click the ✓ in the top right.
Drag the card down to the {or} area, it will now be separated from the existing card.
Do the process again, this time Click the ⨁ Add Card, select the [Date & time] card then choose the [The Season is…] and choose “Spring” from the options.
Once again you may need to drag this new card to the same or area as the [Day is a …] card. Make sure that you do not pull it to far so that it creates a third {or} area.
As alway click ✓ Save from the bottom left of the screen.
{when} Sunset {and} Not Home {or} Its Friday {and} in Spring {then} Turn on light {then} Set RING LED 100%
Outcome
This one was a little big trickier as we not only introduced the {or} conditional, but also required that two conditions be met. Friday AND Spring. But our light now turns on regardless of whether or not we are home, every Friday in Spring.
Our flow is starting to become more useful, but what if we are already at home and its not Friday in Spring? This is where the {else} comes in handy for triggering a new action.
The {else} will run, whenever all the {and} condition and all of the {or} conditions are not met, or are not true. We are going to update an existing action as well as add a new one with in{else}.
Ingredients
Fibaro Switch (But you can use any smart light globe or switch.)
[Date & Time] card, which give us access to time, date, day and even sun actions.
[LED Ring] card, which gives us access to some homey LED ring actions.
[Presence] card, which give us access to actions about peoples presence in the house.
Actions
{when}
{and}
{or} + {and}
{then} x 2
{else}
Method
We would like to update our flow so that if we are not home, our Homey LED Ring should only be set to 5% brightness in order to save power, but when we are home we want it to be at full brightness.
First we want to edit the current Homey Brightness card to be 10%. To edit a card, just touch the card the edit window will open and this looks/acts the same way as when originally adding the card.
Next we want to add a new [LED Ring] card, set brightness 100% this is done the same as previous steps.
With the new [LED Ring] Card we need move this to the else area. This is done the same as moving a card to the or area but {else} will not be displayed until after we start dragging the card down.
Now that our lights are turning on when we want and out LED ring is behaving correctly, we want to make sure the porch light doesn’t accidentally stay on all night. Which is much easier then it sounds.
Delays allow action to be triggered at the when the flow runs, but for it to not occur until a later time specified by us.
We want it so that if the light is turned on when the sun sets, to then turn off the light after 3 hours.
Ingredients
Fibaro Switch (But you can use any smart light globe or switch.)
[Date & Time] card, which give us access to time, date, day and even sun actions.
[LED Ring] card, which gives us access to some homey LED ring actions.
[Presence] card, which give us access to actions about peoples presence in the house.
Actions
{when}
{and}
{or} + {and}
{then}x 2
{then} -> [delay]
{else}
Method
We can automatically turn off the porch lights with in the same flow by using a delay. In this case we are going to keep it really simple and just turn off the porch light 3 hours after it is triggered.
We are going add a turn light off card to the {then}
Select [Turn off] from the actions
With the in card change the delay to 10800 seconds.
When out light is turned on, it will not turn itself off after 10800 seconds, which is 3 hours.
{when} Sunset {and} Not Home {or} Its Friday {and} in Spring {then} Turn on light {then}[delay] 180 Minutes - Turn off light {then} Set RING LED 5% {else} Set LED Brightness 100%
Outcome
Lights will not turn off i 180 minutes hours after they were automatically turned on.
This is a very powerful tool, but beware you will have issues if you use it in places where it gets triggered multiple times such as a motion detector.
Hi,
Many thanks for this step by step, very usefull in my case
I am wondering if turning off, like for example its midnight, or when the luminosity goes higher, is possible in the same flow, or if turning OFF always requires a new flow ? Even for simple flows?