Adjust dim-level depending on time, without switching on the lights

I’m completely new to Homey, flows and domotica and just beginning with my first “real world” flow, so bear with me :slight_smile:

In the hallway, i used the normal sensor/lights flow which is explained here in dept. If the PIR sensor detects movement, turn on the lights. With the CountDown app it will switch off if there is no movement for 2 minutes.
After this, i also added an extra AND… to check if it’s after sundown.
Works perfect so far, but my girlfriend is complainting that the 4 Trädfri LED GU10’s are producing a lot of light if it is in the middle of the night.
Always dimming them doesn’t work, because the rest of the evening we want it to be bright if we are walking there.

I already tried a flow to dim the lights after 23:30 but then the lights go ON, even though there is no movement. It breaks the other flows then.
So i’m looking for a way to continue on my simple sensor/lights flow, but with a smart addition to dim from 100% @ sundown to 1% @ 23:30 until sun up.

Can this be done in one flow, or do i have to split up things?

I’m not sure it can be done within one flow. But with 2 flows it can for sure.

But if you want to make i really fancy I would also suggest to switch it on only when it’s dark, depending on your sensor you can use the lux value for this:


1 Like

I would make a flow that during sun up and sundown it sets a variable that during a set period goes up or down in % every X amount of minutes and when the movement is detected it turns on the light that is in the var. At that moment you do need to make a few flows for this. If you want i can make you some example flows later today

That is a solution alright. Although i would prefer to make the dimming part more graduale if possible.
The lux sensor i didn’t try yet… planned that for later, as it feels strange to check for brightness when making it brighter with lamps :slight_smile:

Sounds great! If it is not too much trouble, please show me your example :+1:

I’m thinking out loud, maybe i can also turn 2 lamps completely off in the night and dim the 2 others… Can that also be part of this?

So u want the lights to go on because it’s time to do so?
Or want them to go on when there is a need for it because it’s getting too dark otherwise?

Yes offcourse I’ll make a example tonight

1 Like

No, it is better to make it dependend on light intensity, but… if you turn on the lights, will the sensor not be fooled into thinking it’s light again??

When there is motion detected you measure the amount of light and after that the lights go on.

And we kill the lights when we go to sleep or going away. So good option!

oke so here we go

since you said you’re a beginner i’ll try to give some extra information so maybe it’s to much information then just take the flows and go :stuck_out_tongue_winking_eye:

if after this you have any questions you can ask!

for now i got 5 flows to show notice that the dim up timed and dim down timed are darker grey this means the flows have been disabled

before we start with the flow you have to create a Variable in the homey app More>Logic>+ sign in upper right corner

type a name i used Test.DimsettingGroup1 but you can pick any name you like if you want multiple groups (for different dimvalues) make a second one with another name
in type select Number
fill in a value of 0 as start value

the first flow i made is a flow that triggers every 5 minutes in this flow we look for the current value of the dimsetting and check what value it is if it is not greater then 0.89 we calculate the same value and do it + 0.1 if it is greater then 0.89 it sets the var to 1 and the flow turns itself off

with these setting every 5 minutes the setting will get 10% brighter (smartlight dimvalues are between 0 and 1 so or example 0.44 is 44%

if you want to max out the light at 80% for example set the value under else to 0.8
and the compare under “and” to 0.69

for making the dimsetting go down we do almost the same except now we check it is not than 0.11 if is not we subtract 0.1

below 0.11 we set the value to 0.01 / 1% and turn the flow off

keep in mind thought that the 1% may cause some problems because not al lights accept 1% and go back to a minimum of 10%

to activate the flows we simply create a extra flow select the moment we want it to start in this flow i used sun sets in 15 minutes and then we turn on the flow dim up timed

from this point every 5minutes the dimsetting goes up by 0.1 until it reaches 1 and then turns off again

logically we do the same when the sun rises

now we go to the flow that activates your lights and instead of giving it a lamp on we give it a dim to and as a value we select the Var. of your dimsetting in this examples i used 4 lights to and gave them 2 different group setting you can do this by just making this whole story twice with 2 different variables

hope this long story helps and that i understood correctly what you want :smiley:
if you have any questions feel free to ask!:question::question::question:


You are correct. That is something most ppl overlook at first.

You have to make sure that the lights you turn on don’t influence the lux sensor and if they do, embed that into the flow somehow if necessary.

I check on lux value to switch lights on or off with sunset and sunrise. But experience learned that i have to check if the main lights are on or off because they influence the lux value too much. And i also had to set a time window for rise and down and a variable (is the state sundown or sunrise) that prevents the flow to trigger every time the lights go on at dusk (and immediately it looks like sunrise) or off (at sunrise, but then immediately it looks like sunrise).

Then that shouldn’t interfere indeed.:+1:

Wow, that is a great and clear example Jos, thank you very much!
Ik hope to update my flows with this info this weekend. If i run into questions, i will ask, but i think it’s pretty clear :wink:

Today i received my new fibaro double switch with pulse-pusher, so maybe i can also temporary update these vars on 2 clicks or so… i’m getting new ideas and inspiration already… thank you

Exactly… but i like the solution of Roy, telling to have an extra lux sensor pointed outside.
But it doesn’t have to be today :wink:

Which motion lux sensor do you use for this?
Neo Coolcam? Or are there other solutions?

I personally use the Fibaro Motion sensor V2.
Currently only two. One in my hallway, one in the kitchen, next to a window (different problems over there).

They are both on the same side of the house. But one next to daylight, the other 2 meter away from the front door (with windows). The hallway gives me 104 lux, and the kitchen 2100 lux. That is a big difference for two sensors looking at the same spot.
Sure i know the hallway is darker… but not THAT much, i reckon :rofl:

Can’t figure how to activate last part as I don’t have the possibility to set the variable in my lamps? What am I missing here?

If you are using the app you can press the small label in the dim to card

Then select the icon

And then select your made variable

1 Like