Homey Community Forum

[Beginner] Smart Porch Light Tutorial

Smart Porch Light

Difficulty : Beginner

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 will be covering :

6 Likes

{when} + {then}


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

  1. [Fibaro Switch] (But you can use any smart light globe or switch.)
  2. [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}

  1. Click the + symbol from the flow screen, You will be shown the {when} section.
  2. Click ⨁ Add Card button and you will be shown the ‘Select an event list’.
  3. Select the ‘Date & time’ card option, this will then automatically show you a list of options.
  4. From the options select the ‘The sun sets’ card, then click the in the top right.
  5. Slide up the {then} area and click on the ⨁ Add Card button.
  6. Select the ‘porch light’ device you would like to turn on
  7. Select ‘turn on’ from the options then click the in the top right.
  8. 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.

2 Likes

{then} again


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

  1. [Fibaro Switch] (But you can use any smart light globe or switch.)
  2. [Date & Time] card, which give us access to time, date, day and even sun actions.
  3. [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.

  1. Slide up the {then} section
  2. Click ⨁ Add Card
  3. Select the ‘LED Ring’ action a list of options will be displayed.
  4. Select the ‘Set Brightness’ option and the values of this option will be displayed.
  5. Move the slider to ‘100%’ then click the in the top right.
  6. And finally click ✓ Save from the bottom left of the screen.

{when} Sunset {then} Turn on light {then} Set RING LED 100%

Outcome

Now at sunset, not only will our porch light turn on, but our Homey LED ring will brighten up.

1 Like

{and}


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

  1. [Fibaro Switch] (But you can use any smart light globe or switch.)
  2. [Date & Time] card, which give us access to time, date, day and even sun actions.
  3. [LED Ring] card, which gives us access to some homey LED ring actions.
  4. [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.

  1. After clicking edit, slide up the {and} section.
  2. Click the ⨁ Add Card and a list of possible conditions will load.
  3. Select the [Presence] condition and the options for that condition will be shown.
  4. Select the option [Nobody is home] then follow the normal process for saving.

{when} Sunset {and} Not Home {then} Turn on light {then} set Ring LED to 100% brightness.

Outcome

That’s it, now the porch light will only come on if no one is home.

2 Likes

{or}


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

  1. Fibaro Switch (But you can use any smart light globe or switch.)
  2. [Date & Time] card, which give us access to time, date, day and even sun actions.
  3. [LED Ring] card, which gives us access to some homey LED ring actions.
  4. [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.

  1. After clicking edit, slide up the {and} section.
  2. Click the ⨁ Add Card and a list of possible conditions will load.
  3. Select the [Date & time] card option, this will then automatically show you a list of options
  4. From the options select the [Today is a …] card.
  5. Click on the day of the week and change it to [weekend], then click the in the top right.
  6. Drag the card down to the {or} area, it will now be separated from the existing card.
  7. 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.
  8. 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.
  9. 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.

1 Like

{else}


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

  1. Fibaro Switch (But you can use any smart light globe or switch.)
  2. [Date & Time] card, which give us access to time, date, day and even sun actions.
  3. [LED Ring] card, which gives us access to some homey LED ring actions.
  4. [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.

  1. 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.
  2. Next we want to add a new [LED Ring] card, set brightness 100% this is done the same as previous steps.
  3. 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.

{when} Sunset {and} Not Home {or} Its Friday {and} in Spring {then} Turn on light {then} Set RING LED 5% {else} Set LED Brightness 100%

Outcome

When we are not home after sunset the HOMEY ring dims to 10% to save power, but if its sunset and we are home, then set the ring LED to 100%.

2 Likes

{then} -> [delay]


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

  1. Fibaro Switch (But you can use any smart light globe or switch.)
  2. [Date & Time] card, which give us access to time, date, day and even sun actions.
  3. [LED Ring] card, which gives us access to some homey LED ring actions.
  4. [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.

  1. We are going add a turn light off card to the {then}
  2. Select [Turn off] from the actions
  3. 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.

5 Likes

Next

  • Random Values
  • Tags & Variables
  • Inverse
  • Transitions
  • Overrides
  • Count Down Timers
  • Calling other flows
7 Likes