Homey Community Forum

[Simple] Lights turning on/off based on motion

This will be the 2nd flow then:

Thanks, however I have already “no one is sleeping” as an “And” card as I don’t want the lights to go on when you go to the bathroom during the night.

So if I add this “And” and after that the “Else” it will mean that the lights will go on during the night. How can I avoid this or am I mistaken?

So during the night u have to sit in the dark?

Make an extra flow to disable this flow.
Or find the flow where u set peeps to sleep and disable the bathroom flow. Enable the flow when first person is awake or at a set time like 6am.
All is possible!

Ps. Plz don’t confuse “enable a flow” with “starting a flow”!

Hi, how do you mean, “Just use variables (logic)”?

Hello Rocodamelsheki,

Thank you for this tutorial!

I tried to apply your tutorial to my specific situation, but it won’t work.

At sunset, on the ground floor of my hous, a number of lights automatically turn on. Sometimes I also switch on a few extra lamps manually. All the lights on the ground floor automatically turns off at 00.15 hour.

Now I have purchased a motion sensor (Fibaro Motion Sensor Z-wave Plus) and mounted it in the living room. I would like to integrate this sensor in the flow in which the lights go out at 00.15 hour. With this I want to achieve that all the lights turn off at 00.15 hour, when there is no movement in the living room, but stay switched on, when there is motion detected in the living room.

Below the flow that I use now, without motion sensor.

Can you give me a hint how to get it operational?

With kind regards,


I’d say it is better to achieve this with a timer of somekind. Chrono app is very good for this. So create a flow which sets a timer based on movement. And add the timer in the ‘and’ colum of this flow. So if the timer is not running then turn off lights.

Please take into account that if there is movement and the timer is running it won’t turn off the light at all. The trigger is on 00.15 and won’t trigger again. You should then create another flow which turns off the lights when the timer has finished.

Another thing you could do is to turn off the trigger on 00.15 and just let the movement timer handle turning on and off the lights. This would mean that by day time the lights will be turned off too, saves energy :wink:


Thanks for your reply.
I am not very experienced and I do not know how to make timer based on movement. Do you have an example flow of this?

Whats wrong with the search function on the forum?? Is it not working or… :joy: :joy:

edit. Just tested the search function… and believe me or not it worked. i found this for example

Is this how it should work?

@Rocodamelsheki - I want to understand this rigth:
Will there have to be 3 flows in order to just have a lightbulb turning off 10 minuttes after being turned on because of activating af sensor? That seems very complex? (compared to other system - like Hue etc…?

It all depends on what u wanna do with it. This is a simple version to help peeps understand the working of it. When u want the lights to go off after 10 minutes, no matter what, u can also do:
WHEN motion detected THEN turn lights on AND turn lights off (with a delay of 10 minutes).
I even have a lot more flows for bathroom lights. Like turning on the Sonos speakers and play 538 (het foute uur) UNLESS there is an mp3 playing in the attic. Then they have to join the attic speakers ofc. When walking into the bedroom AND Sonos is playing in the bathroom THEN join them, ELSE play 538.
And walking into the bathroom while it’s still before 6am THEN the lights have to be low and Sonos needs to be off.
But that’s not what this topic is about actually. It is more to help peeps a bit in the right direction to understand flows.

Hi again - okay, thank you very much for fast answer👍 I will explore the different solutions. Keep safe and sound👍

Like os på Facebook og LinkedIn – vi spotter trends, deler viden og inspirerende artikler.

De bedste hilsner

[mod break, removed all personal data]

Maybe better to remove the phonenumber

Ahh - I guess you mean I did not need to provide the phone number :wink: I am sorry - that was my autosignature from my phone :joy:

lol yup :joy: :joy: :joy: :joy:

Having more flows is not bad.
In my opinion, its even better. Want to know why? … read my post about how to structure your flows.


For now i have made a flow that if i open the door the light turns on, countdown stops, and if i close the door, the countdown runs and the light turns of. If i open the door before the light turns of the countdown starts over. So this works fine.
But how can i add something that the light stays on by closing the door if i had turn the light on before opening and closing the door? By the Homey app or toggle switch. Wallswitch is a Fibaro 223. Double switch 2x1500…

I have a similar needs as you and with almost the same hardware. But my flow setup uses tags and segregation of flows but I hope this can give you the idea on how to do what you want -

Easy enough so far, when the garage is active turn everything on and start a timer for 10 minutes.

When the timer runs out - turn very thing off.

When I press the garage button - reset the timer which turns everything off to start counting down from 1 hour.

I also have a flow for when the switch is pressed twice - completely disable the timer. So the garage light doesn’t automatically turn off. This is similar to what you want to do.

But just in case I forget to turn it off - at 2am turn it off for me.

Rather then disable the timer I have been meaning to instead disable the flow if I double tap, and then reenable each night at 2am when it does the sanity check.

Thank you, I will give it a try with my setup.