# Lights turning on/off based on motion with BUTTON

**URL:** <https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552>\
**Category:** Flows\
**Created:** [October 21, 2019, 6:13am UTC](https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552 "2019-10-21T06:13:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MateoPL](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mateopl/32/12631_2.png) [@MateoPL](https://community.homey.app/u/MateoPL)\
**Post date:** [October 21, 2019, 6:14am UTC](https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552/1 "2019-10-21T06:14:00Z")

</div>

Hello  
I have a little problem with my lights based on motion.  
My problem:

When the motion sensor is on and the time is between 19:00 and 7:00 then lights on  
when the motion sensor is off then wait 60sec and turn off lights

But when i turn on the phisical button where the light is included, then the lights is on until i turn them of myself.

 ![34](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/f/3fc110b35146bd20bc802c03ad2fb19945896070.png)

sorry for my bad english ;/  
Please help.

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [October 21, 2019, 7:20am UTC](https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552/2 "2019-10-21T07:20:38Z")

</div>

If you can switch the light with the physical button without trigger a motion, then it is very simple.

When light is switched on  
And no motion  
Then disable flow “Switch off after 60sec”

---

<div class="post-metadata">

**Author:** ![MateoPL](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mateopl/32/12631_2.png) [@MateoPL](https://community.homey.app/u/MateoPL)\
**Post date:** [October 21, 2019, 9:03am UTC](https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552/3 "2019-10-21T09:03:58Z")

</div>

And will happen when i turn on light when the motion is on?  
that’s not work.

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [October 21, 2019, 9:15am UTC](https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552/4 "2019-10-21T09:15:10Z")

</div>

The light was switched on because a motion is detected. And from time to time you want avoid that the light will be switch off automatically after 60 sek., right?

---

<div class="post-metadata">

**Author:** ![MateoPL](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mateopl/32/12631_2.png) [@MateoPL](https://community.homey.app/u/MateoPL)\
**Post date:** [October 21, 2019, 9:33am UTC](https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552/5 "2019-10-21T09:33:50Z")

</div>

I want that the light work with the sensor every day from 19 to 7, but sometimes I want to turn on the light with the button and the light is on until I turn off the button.

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [October 21, 2019, 9:57am UTC](https://community.homey.app/t/lights-turning-on-off-based-on-motion-with-button/19552/6 "2019-10-21T09:57:20Z")

</div>

Before 19:00 and after 07:00 it already works, because your flow (automatically switch off) only works between 19:00 an 07:00, right?

In the time between 19:00 and 07:00, after the light is switch on by the motion and you want to avid to be automatically switched off.  
In this case I only See one Option.

When the light is switch off  
And the Countdown Timer is running  
Then switch light on  
And stop Countdown Timer.

So you have Switch off the light, to Stopp the Countdown Timer.

This assumes that you turn off the light via a countdown timer.
