Homey Community Forum

[Simple] Lights turning on/off based on motion

Simple flow for turning lights on and off based on motion


What to use

  1. Timer app. In this case i used the Countdown app
  2. Motion sensor. Used a Neo Coolcam pir v1 in this case.
  3. A light to switch on and off. Used a Fibaro Dimmer2 in this case to turn a “dumb bulb”.

Start making the timer

We click more/apps/Countdown. Then we click configure app. Here we make the timer.

Choose a name for your timer. In this case i used “Badkamer”

Click “Add timer”

Start making the flows

In this case i used 3 flows. Call the flows whatever you like. I called them "Light with motion 1, …2 and …3.

Flow 1

WHEN part

We take the trigger from the Neo Coolcam sensor and we choose “The motion alarm turned on”

AND part

There is no AND part in this flow.
There is always room for expanding the flows here with “AND light is off” or “AND Sonos is not playing” but this is the simple version remember?

THEN part

In the last part of this flow we gonna hit the light. Pick a card for the bulb (or dimmer/switch) of your choise and choose “Turn on”. Also we need to stop the timer so add another card and choose “countdown”. Find the timer you just created. Pick “Stop countdown timer”.

First flow is done. For the overview of your first Light with motion flow , here is how it should look by now:

Flow 2

WHEN part

We take the trigger from the Neo Coolcam sensor and we choose “The motion alarm turned off”

AND part

There is no AND part in this flow.
There is always room for expanding the flows here with “AND light is on” or “AND Sonos is playing” but this is the simple version remember?

THEN part

In the last part of this flow we gonna hit the countdown timer. We need it to run so add a card, pick “countdown” and “Start countdown timer”. For the timer name pick the one you just made in the first part of this guide. In my case this is “Badkamer”.

2nd flow is done. For the overview of your 2nd Light with motion flow , here is how it should look by now:

Flow 3

WHEN part

This is the part when the timer reaches zero and there is no more movement. We add a card and find the Countdown again. We choose “Timer reaches zero”.

AND part

There is no AND part in this flow.
Been there, done that.

THEN part

In the last part of this flow we gonna turn the lights off. We add a card in the THEN part, pick the bulb (or dimmer/switch) and choose “Turn off”.

Last flow is done. For the overview of your last Light with motion flow , here is how it should look by now:

Disclaimer
These flow examples are just for helping other people to make some simple flows and have fun with Homey. Please don’t react with “i don’t like the countdown app” or something like that. Just trying to help peeps to enjoy their Home automation with Homey.

19 Likes
Need help on flow turning lights on based on lux & motion
Timer Motion
Xiaomi/Aqara ZigBee door sensor open/close timer functionality!
Badezimmer Flow
Flow garage lichten aan en huisdieren
Verlichting 1 minuut aanhouden tijdens beweging
Countdown vs Countdown Timers
Werking timer app
Motion based flow help
Auto lights on and off when in or out of room tips
Motion: lights on for 3 minutes, if there is motion again within 3 minutes: set the timer again for 3 minutes
Goed werkende bewegigssensor voor de Homey?
Else not triggered
Neo coolcam beweging parameter/flow
Bewegingsmelder Ring en lamp voordeur
Hulp met automatiseren mechanische ventilatie
Waar vind ik de zandloper
Einfacher Flow klappt nicht
Overtake light sensor flow with a button push
[App] issue in one of: FLOW EVENT BUS -or- TIMER apps - help figuring this out
Best indoor Motion Sensor?
Problem with Countdown app
Motion sensor and contact sensor to manage light
Zone actief, afschakelen na x tijd
Turn off lights, but delay every time motion is triggered
Turn off lights after any non specific action
Hue app vertraging of countdown timer voor vertraagd uit doen van lampen
Flow: act upon device is on for period of time
Flow voor Neo coolcam beweging sensor / switch
Countdown timer
Bewegingsmelder, Conditional statements
Tradfri gu-10 en philips motions sensor
Any UK Homey Jedi’s willing to initial help a Newbie?:)... please
Motion sensor auto off flow not working
My dimmer 2 is drunk
Using motion sensor as dusk dawn sensor for outside light
Bewegings sensor
Motion sensor with lights, turning off after certain amount of time
Verlichting overloop
Zandloper flow
Some flow questions
How to: Timer on a light turned on by sensor
Light flows only works sometimes
Compactibiliteit homey philips en shelly

Hi,

How can it be done so that the lights turn off after a while if there is no movement, but only after they’ve been turned on at the wall switch first?

e.g. With lights off
20:00: user enters the room. Nothing happens.
20:05: user switches on lights at wall
20:15: movement so = lights stay on
20:20: user switches light off
20:25: lights stay off, irrespective of movement
20:45: user switches lights on again
20:55: no movement = lights auto off

When using a smart switch u can enable/disable the flows. When switch is set to on, enable the motion flows. When switch is set to off, disable the motion flows.

Were do i find the “Add timer”?

Wrong app. Correct app used in this example.

1 Like

Muchos Gracias :smile:

1 Like

This is nice.

But often a more realistic scenario is when someone has a bunch of motion sensors covering one room.

It isnt very intuitive how to group them and I always had trouble though I find with the latest zone activation it is easier and you can avoid adding countdown app if you are happy with 1/5/10 etc min inactivity times.

Theres another way based on tags that used to work for me prior to 2.0 but for some reason never worked after that.

For more advanced usage I always recommend adding a AND light is off if rule is to turn on light and vice versa to avoid unnecessary triggering.

This is not a criticism btw just a suggestion to include that.

Just use variables (logic) to make some conditions, depending on ur function (as u described in this use case). Easy and most efficient.

Fibaro dimmer has in advanced settings a built-in timer. You can set that to X minutes and just use a flow to turn it on. It will reset timer when it turned on again by for example momentary switch or motiondetector or doorcontact.

Hello,

Thanks for you tutorial on times based motion flow.

I’ve made the same flow a you described. When I pass the motion sensor the light turn on that’s great en after 300sec the lights turns off. But when I pass the motion sensor before the timer reaches zero the light turns off. Do you have an idea what could be wrong?

Then most likely u forgot to stop the timer on motion. Can u post some screenies of ur flows?

Here are the screenshots of my flows:

Flow 1:

Flow 2

image

Flow 3

1 Like

I think I just found it. I made a mistake at the WHEN part and changed my flow to this:

1 Like

That will be correct!

You mean instead of the countdown card?

No. Was typing some lines when u posted the correct solution. So the last card u posted is correct!
Zandloper leeg instead of zandloper gestopt.

thanks for your help

Does this also work for modules not connected to a switch but only the Q1/Q2? I guess you have to set the parameters through RAW command right?