# Turn off lights, but delay every time motion is triggered

**URL:** <https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483>\
**Category:** Flows\
**Tags:** flow\
**Created:** [June 16, 2021, 7:00pm UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483 "2021-06-16T19:00:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hogh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hogh/32/22631_2.png) [@Hogh](https://community.homey.app/u/Hogh)\
**Post date:** [June 16, 2021, 7:00pm UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/1 "2021-06-16T19:00:17Z")

</div>

I can’t get my head around this…

I have a fibaro switch for the lights and also a Hue motion sensor.  
I can easily turn on the fibaro/lights when motion is triggered on the motion sensor.  
After 10 minutes I want them to turn off. Easy with a delay in the same flow.

But here comes the tricky part:  
If I’m still in the room I want to reset the 10 minute delay / adding time so it always turns off 10 mins after the last movement registered.  
If I trigger at 12:00 it will turn off at 12:10.  
But if I’m in the room 12:05 it will still turn off at 12:10 and the second delay happening 12:15 is obsolete.  
Result: Lights turns off while I’m in the room and I start jumping around to trigger the sensor…

I’ve tried to a global variable, but it always get overruled by the first run.

Any good ideas? The best would be if you could set a global timer and just add time to it, but I don’t see this option.

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [June 16, 2021, 7:05pm UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/2 "2021-06-16T19:05:55Z")

</div>

Someone made a post exactly about this “problem” years ago, and is still relevant:

> [@\[Simple\] Lights turning on/off based on motion](https://community.homey.app/t/10889):
>
> Simple flow for turning lights on and off based on motion What to use Timer app. In this case i used [the Countdown app](https://apps.athom.com/app/nl.bevlogenheid.countdown) Motion sensor. Used a Neo Coolcam pir v1 in this case. 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…

I guess you have searched the forum before posting this question, so i’m not going to mention it.

---

<div class="post-metadata">

**Author:** ![DidierVU](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/didiervu/32/12458_2.png) [@DidierVU](https://community.homey.app/u/DidierVU)\
**Post date:** [June 17, 2021, 8:13am UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/3 "2021-06-17T08:13:41Z")

</div>

Or just use “Zone activity” without any extra apps?

> **FLOW 1**  
> IF zone is active  
> THEN turn on light

> **FLOW 2**  
> IF zone is inactive for 10 minutes  
> THEN turn off light

---

<div class="post-metadata">

**Author:** ![Hogh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hogh/32/22631_2.png) [@Hogh](https://community.homey.app/u/Hogh)\
**Post date:** [June 17, 2021, 3:08pm UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/4 "2021-06-17T15:08:10Z")

</div>

Brilliant, using the Zone Activity works really nice.  
I wasn’t aware about this nice feature 🙂

Light turns on and if I’m still in the room the turn on period will be extended with no interruption.

I was unsure what the definition is, but it seems only to be related to the motions sensors. Testing by starting the ventilation (Fibaro based) in the same zone does not impact the “activity”.  
I did try to sneak in a hand, hitting the Fibaro light switch without triggering the motion sensor - the lights will stay on as there was no motion (I don’t need that and it will never happen, just testing)  
🙂

---

<div class="post-metadata">

**Author:** ![Sebas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebas/32/33892_2.png) [@Sebas](https://community.homey.app/u/Sebas)\
**Post date:** [June 29, 2021, 9:57am UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/5 "2021-06-29T09:57:21Z")

</div>

Hi there,

I do think i’ve made this feature for my toilet downstairs with using the zones,  
Maybe this will give you additional info

If toilet is occupied THEN turn on light

 ![ToiletLamp_Aan](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/2/225eddc2d3c9fb914023891a31cdd5b6cce52ace.png)

if no movement dim light to 5%

 ![ToiletLamp_Dim](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/9/d9fe79976706fd86d984703e34ab4cd7ae1db401.png)

if zone is then not active for 1minute turn off light

 ![ToiletLamp_OFF](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/e/5ef572365e788ff6e50ad5c3a97ec0faf138a53b.png)

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [June 29, 2021, 6:59pm UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/6 "2021-06-29T18:59:46Z")

</div>

> [@Hogh](#):
>
> I was unsure what the definition is, but it seems only to be related to the motions sensors

Zone activity is triggered by both motion sensors and door sensors.

---

<div class="post-metadata">

**Author:** ![woto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/woto/32/33967_2.png) [@woto](https://community.homey.app/u/woto)\
**Post date:** [November 18, 2022, 8:34am UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/7 "2022-11-18T08:34:05Z")

</div>

Hi

I am having problems setting the motion sensor this way with Zone activity - it’s hit and miss if it works - I am using a Fibaro motion sensor - I have tried different settings with the Fibaro - somtimes the light wont turn on you can see the motion sensor has picked you up and see its activated the motion in the Homey app but the light sometimes doesn’t turn on - this is the same for the light going turning off - these are the flow cards and the settings of the Fibaro - any help would be great thanks

 ![149](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/5/e57dca19822f5d9137f21a2e28368472ade5857b.png)  
 ![148](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/9/d995c64fce69c191e3aa01bcf07d52823cf77054.png)  
 ![147](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/a/6a5b197b57c8bc053559f7d0b62a3de262ac81a8.png)

---

<div class="post-metadata">

**Author:** ![Hogh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hogh/32/22631_2.png) [@Hogh](https://community.homey.app/u/Hogh)\
**Post date:** [November 18, 2022, 8:54am UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/8 "2022-11-18T08:54:38Z")

</div>

Hi There

I’m thinking it could an issue with the Fibaro not always connected to homey.

Since it doesn’t turn off and you don’t have any luminace I would expect the Fibaro to the issue.

With Fibaro there are two ways to connect them, default is secure, but if you add as unsecure it works perfect. At least it did for me – and I had the same experience as you.

When connection unsecure I think you have to add it and a “contact” then it will figure out that it a dimmer switch or what ever and connect it unsecurely.

If you search the forums there is an article about this.

/Lasse

---

<div class="post-metadata">

**Author:** ![woto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/woto/32/33967_2.png) [@woto](https://community.homey.app/u/woto)\
**Post date:** [November 18, 2022, 9:13am UTC](https://community.homey.app/t/turn-off-lights-but-delay-every-time-motion-is-triggered/48483/9 "2022-11-18T09:13:50Z")

</div>

Thank you for the reply

it’s been working fine for months - this has started to happen over the last couple of weeks - will give that a go to add it unsecure once I figure out how to do it - Just purchased the Aquara motion sensor - going to have a go with that over the weekend - I’m interested to see what it’s like
