Homey Community Forum

Advanced light flows; control the lights in your house!

Hello everybody,

Soo this is going to be a long tutorial… I think every house is different soo you might end up changing stuff, but that’s logical. I hope to give some good ideas here for you to manage all your lights.

What we are going to build
In our home, all the lights are smart. Well, almost everything! The only lights we left default are the lights in the bathroom and the lights in the bedroom of our 4 years old daughter. We’ve got a large bathroom and we do not want the lights to turn off when the motion sensor is not sensing our presence and in the bedroom of our daughter I do not wish to risk lights turning on and off when she’s a sleep. All the other lights are smart!

Different rooms require different protocols for light, in this tut I will try to explain how I have build everything hoping that you find something that suits you.

Requirements: this is what you need!
In order to build what I am explaining you will need a few things:

  1. A homey ofcourse :wink:.
  2. Smart lights, or any kind!
  3. Motion sensors
  4. A smart button
  5. Two logic numeric variables; light intensity general and light intensity staircase

For the lamps I use Ikea lamps… I am very happy with these! As you may (or may not) know, these lamps are pretty much the same as the Philips Hues, but a lot cheaper. They are available nearby (in my case), are stable, work good and fast and aren’t very expensive. I only use the white ones that are dimmable, I found it useless to color the lights in my house… But that’s to your own taste ofcourse!

For the motion detector I use the ’ Xiaomi Mijia Human Body Sensor’. I bought this sensor when I started using Homey in March 2020 and have been using them ever since. I have three, one in every room I needed a sensor in. The only downside of these sensors is that they do not reactive their timers when you keep walking through their sight. This might give a short flash of the lights when the timer is over and you’re still waking there, soo it reactivates. But they’re cheap and have a great battery life and are reliable. There might be better options, but I can assure you that they won’t disappoint you for this price range.

For the virtual button I bought the ‘Xiaomi smart wireless switch’. This switch is cheap and works great! Nothing more to say here…

The numeric variables are used to store the percentage the lights should be in. I am using two variables; a general one and one for our staircase. In our staircase we have a three-lights-spot and we wish that only one spot will be turned on in the evening and night soo we’re not blinded by a large amount of lights when walking there.

The first flow: calculating the percentages
In previous versions of my flows I used a light sensor to calculate if the lights should be brighter or less bright. But I must admit that this annoyed me a lot and it was very hard to calculate the right amount of light because the lights in your home are also tracking the light given bij the lights you just triggered.

This is why I am only using daylight and night time for the light system. Ofcourse you must be home when the lights are triggered, but that all becomes clear later on in the flows.

Soo we are checking if there are any new requirements every 1 minute. In the ‘And …’ part you’ll find a check for ‘After sundown’ or ‘it’s later than 21:00’. Ofcourse for the 21:00 part it’s useless to check every 1 minute, but the first part about sundown makes sure the lights respond almost live based on the time of the year. The ‘after 21:00’ part is for the summertime; we wish that the lights go down after this time of the day even when it’s still light outside.

Once these requirements are met we will set the general lights (that are always on when we’re home) to 50% brightness. If these requirements are not met then it’s during daytime and we wish the whole house is brighten up, soo we set a 100% value here in the ‘Else …’ part of the flow. If you wish to make changes in the percentages, do this here!

Once the calculation is done and the variables are set, start the dimmer that will control all the general lights in your home. More about this flow in the next chapter.

Flow number two: dimming the general lights
Soo in our living room we have our general lights. On a regular basis we are downstairs in the living room soo this is were we programmed the lights to stay on when we’re at home and adjust to the time of the day.

This flow will be triggered ‘When this flow starts’. This way I can call it from, let’s say, the calculation flow that I displayed above but it’s also possible to ‘reset the lights’ when you overruled them for, let’s say, your movie time protocol. We have such a protocol which you can see visiting the link below. Once movie time is finished, I will call the flow above and the lights will reset.

Noticing the above, you might also notice a lot of protocols in the ‘And …’ part of this flow. Once one of my protocols is activated I do not wish the automatic light protocol to change my percentages every one minute. In my case, it will check for: The house must be on else leave the lights as they are, bedtime protocol must be switched off and the same goes for my fire alarm, privacy modus and theater modus. If you do not have any protocols that are using your same lights as you are programming here, you can leave this as it is.

Interesting post about switching your whole house on or off here:

Once all my requirements are met, I will dimm all the general lights to the calculate percentage from the first flow. In my case there are 7 lamps that I will trigger. Soo, in easy language, 7 lamps will turn to 100% during daytime and turn to 50% once the sun is down or it’s later than 21:00.

Last but not least I have a special flow that overrules the extractor hood lamp in the kitchen. More about that in the chapter below.

Flow number three: overrule the extractor hood
Soo we have one large area for kitchen and living room, this is on the same floor without doors (as in most houses, I guess?). Above the dining room we have a large set of designer lamps that are triggered with a smart plug and a button.

As you can see the button first switches on the entire house when this is turned off. If it is not turned off, it will switch the dining room table on or off and call for the next flow, the same flow displayed in the general light settings. More about switching your home in another post, scroll up for info.

Soo the idea here is that the extractor hood will be dimmed to 100% once the lights above the kitchen are switched on. This combines the light sources soo the extractor hood will be dimmed togheter with the rest of the general lights but in case of requesting extra lights with the lamps above the dining room, brighten up the extractor hood as well.

The next flows; rooms with sensors to detect movement
The next light protocol will be sensor based. We have three of those rooms; the front hallway, back hallway and the staircase/first floor passage.

Once the area becomes active, the lights will turn on. Sounds pretty easy, right? I’ve choosen to display the sensor placed in the staircase because this also calculates the difference in night and day, leaving 2 of the 3 lights off when it’s dark outside.

Soo as you can see, there are two flows for these lights; one once the area is activated and one for deactivation. I will explain why and how it works.

I use a movement sensor for the whole room. This way I can choose to add more than one movement sensor in the future inside this room that triggers the same flows, without needing to build more flows are adjusting these existing ones.

In the ‘And …’ part I need some magic. We only want the lights to turn on when somebody is home. I do not use my ‘House is on’ trigger here because the house will be turned on when there is movement detected and soo there is also a chance that the house is turned off but I want the lights to be turned on. Also during night time, when the house is off, I need lights for guidance towards the bathroom.

Other stuff I use are my bedtime and fire alarm protocols. I need these to be checked here because my lights are ‘taken over’ by these protocols and I want to set the sensors aside. If the bedtime or fire alarm protocol is activated, do not turn the lights on or off based on movement!

And than theres the actual dimmer… As you can see, I use two different variables here; intensity general and intensity staircase. These variables are set in the first flow calculating the intensity. At night time, I only want one of the three to be activated soo we’re not blinded in the middle of the night or my daughter is going to wake up because of all the lights starting up.

The second flow is about deactivating. Once the zone is inactive, AND we are at home, AND other protocols are not activated (see text above) THEN turn off all the lights again…

As mentioned in the required part, these sensors are cheap and do not ‘reactivate’ once theres still movement in this zone. This is a pitty, but since we do not walk there on a regular basic I take this for granted. The lights will switch off and switch back one.

That’s all folks!
I think this is all there is to tell about our lights at home. There are ten flows in total, but mostly they are copies of the movement sensor flows.

Hopefully these flows are of any use. Good luck!

I recently learned that using the 1 minute interval flow is not a smart way to build this. This flow trigger wil use a lot of load.

I suggest to change this and there are two ways to do soo:

  1. Change it to a sun up or down trigger, that way you get the same result but a flow trigger only twice a day.

  2. I added the lights to my roller blind light sensor. This way it will react to the amount of light outside. This light sensor is placed in my window.

Good luck!

2 Likes