# \[Simple\] Lights turning on/off based on motion

**URL:** <https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889>\
**Category:** Flows\
**Tags:** flow\
**Created:** [March 21, 2019, 5:36pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889 "2019-03-21T17:36:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [March 21, 2019, 5:36pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/1 "2019-03-21T17:36:00Z")

</div>

**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](https://apps.athom.com/app/nl.bevlogenheid.countdown)
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:

 ![chrome_2019-03-21_18-30-55](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/aad4106d23d369af7732c83ad3e3cd49b31a34ac.png)

**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:

 ![chrome_2019-03-21_18-31-08](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/5/5acc713c0cf92db62d75dc7ce597dd1234f3302e.png)

**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:

 ![chrome_2019-03-21_18-31-22](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/f/f2a0b06e743ec752d0d5cf712a0e0ea3367a508f.png)

**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.

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [March 21, 2019, 5:36pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/2 "2019-03-21T17:36:05Z")

</div>

Closed on March 21, 2019, 5:36pm UTC



---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [March 21, 2019, 6:01pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/3 "2019-03-21T18:01:01Z")

</div>

Opened on March 21, 2019, 6:01pm UTC



---

<div class="post-metadata">

**Author:** ![K\_S](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/k_s/32/11635_2.png) [@K\_S](https://community.homey.app/u/K_S)\
**Post date:** [May 19, 2019, 4:15pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/4 "2019-05-19T16:15:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [May 19, 2019, 4:29pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/5 "2019-05-19T16:29:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hempie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hempie/32/7905_2.png) [@Hempie](https://community.homey.app/u/Hempie)\
**Post date:** [May 21, 2019, 6:45pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/6 "2019-05-21T18:45:14Z")

</div>

Were do i find the “Add timer”?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/3/3249187992fad6b364890c1ff1c3c09ec9db5585.png)

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [May 21, 2019, 6:46pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/7 "2019-05-21T18:46:36Z")

</div>

Wrong app. [Correct app used in this example.](https://apps.athom.com/app/nl.bevlogenheid.countdown)

---

<div class="post-metadata">

**Author:** ![Hempie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hempie/32/7905_2.png) [@Hempie](https://community.homey.app/u/Hempie)\
**Post date:** [May 21, 2019, 6:49pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/8 "2019-05-21T18:49:19Z")

</div>

Muchos Gracias 😄

---

<div class="post-metadata">

**Author:** ![Groundhog](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Groundhog](https://community.homey.app/u/Groundhog)\
**Post date:** [July 27, 2019, 3:49pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/18 "2019-07-27T15:49:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Westerlind.r](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/westerlind.r/32/8793_2.png) [@Westerlind.r](https://community.homey.app/u/Westerlind.r)\
**Post date:** [July 31, 2019, 10:20pm UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/19 "2019-07-31T22:20:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Da\_JoJo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/da_jojo/32/8210_2.png) [@Da\_JoJo](https://community.homey.app/u/Da_JoJo)\
**Post date:** [August 1, 2019, 6:40am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/20 "2019-08-01T06:40:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jeroen\_Kokhuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_kokhuis/32/12592_2.png) [@Jeroen\_Kokhuis](https://community.homey.app/u/Jeroen_Kokhuis)\
**Post date:** [August 25, 2019, 7:49am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/21 "2019-08-25T07:49:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [August 25, 2019, 7:54am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/22 "2019-08-25T07:54:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jeroen\_Kokhuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_kokhuis/32/12592_2.png) [@Jeroen\_Kokhuis](https://community.homey.app/u/Jeroen_Kokhuis)\
**Post date:** [August 25, 2019, 8:42am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/23 "2019-08-25T08:42:17Z")

</div>

Here are the screenshots of my flows:

**Flow 1:**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/3/39565abc41660fe366b70c0df656ddcd6a54553a.png)

**Flow 2**

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/b/b7eae85e003e7e93b19e2c66d66245d8b47a8eac.png)

**Flow 3**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/e/ebc994f9e4c7f2eabad06fe5f51fedca4a27b3ed.png)

---

<div class="post-metadata">

**Author:** ![Jeroen\_Kokhuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_kokhuis/32/12592_2.png) [@Jeroen\_Kokhuis](https://community.homey.app/u/Jeroen_Kokhuis)\
**Post date:** [August 25, 2019, 8:44am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/24 "2019-08-25T08:44:59Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/2/21f734f4bb4264cd66c4bc1a4a16e22ab5d05957.png)

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [August 25, 2019, 8:45am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/25 "2019-08-25T08:45:29Z")

</div>

That will be correct!

---

<div class="post-metadata">

**Author:** ![Jeroen\_Kokhuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_kokhuis/32/12592_2.png) [@Jeroen\_Kokhuis](https://community.homey.app/u/Jeroen_Kokhuis)\
**Post date:** [August 25, 2019, 8:57am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/26 "2019-08-25T08:57:25Z")

</div>

You mean instead of the countdown card?

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [August 25, 2019, 9:00am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/27 "2019-08-25T09:00:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jeroen\_Kokhuis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_kokhuis/32/12592_2.png) [@Jeroen\_Kokhuis](https://community.homey.app/u/Jeroen_Kokhuis)\
**Post date:** [August 25, 2019, 9:27am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/28 "2019-08-25T09:27:20Z")

</div>

thanks for your help

---

<div class="post-metadata">

**Author:** ![PascalB](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PascalB](https://community.homey.app/u/PascalB)\
**Post date:** [August 25, 2019, 10:11am UTC](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889/29 "2019-08-25T10:11:15Z")

</div>

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?

[Next page](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889.md?page=2)
