# Motion sensor with lights, turning off after certain amount of time

**URL:** <https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679>\
**Category:** Questions & Help\
**Created:** [October 23, 2019, 7:26pm UTC](https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679 "2019-10-23T19:26:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rubert](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rubert/32/16844_2.png) [@Rubert](https://community.homey.app/u/Rubert)\
**Post date:** [October 23, 2019, 7:26pm UTC](https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679/1 "2019-10-23T19:26:18Z")

</div>

Hi all,

I’ve got my flow working with the help of this forum. Nevertheless… I don’t really understand what I’m doing. I’ve made a flow myself, which should work in my opinion but it doesn’t. The lights go on and off in a random manner, so it seems. Below I post a screenshot of the non-working flow. Can anybody tell me what I’m doing wrong? I’m trying to understand the basic “flows philosophy” to make more flows than just this one.

 ![44](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/6/1663797afd2ae59d66f49384929c6a083a6ff174.jpeg)

---

<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:** [October 23, 2019, 7:31pm UTC](https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679/2 "2019-10-23T19:31:06Z")

</div>

In the THEN part u put the lights on to 70% and also off with the next card. But why [re-invent the wheel](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889)?

---

<div class="post-metadata">

**Author:** ![Rubert](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rubert/32/16844_2.png) [@Rubert](https://community.homey.app/u/Rubert)\
**Post date:** [October 23, 2019, 7:36pm UTC](https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679/3 "2019-10-23T19:36:58Z")

</div>

The link you send is exactly what I’ve done. It’s working. Nonetheless, I don’t understand why my previous flow isn’t working. You’re saying that I put the lights off in the “then” line, but the previous card says; dim the switch to 70 % with a duration of 5 seconds. (I’ve put in 5 seconds to test, but what it should be is somewhat like 600 seconds). What I expect is to set the lights to 70 % brightness for 5 seconds (or whatever time period) and then go out. I don’t want to reinvent the wheel, and don’t want to bother everybody on the forum every time I want to make a flow…🙂

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [October 23, 2019, 7:59pm UTC](https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679/4 "2019-10-23T19:59:47Z")

</div>

What you flow says at the then part is three starting 3 things at the same time, go lamp go on for 5 seconds at 70% dim, but at the exact same time , go off and at the exact same time start a flow. So you have to put some delations for the other then cards, card two in this case a delay off 5 seconds and the third card also a delay. Delays are countable. So second card delay 5 seconds and third card a delay off 10 seconds means that the third card starts 5 seconds after the second 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:** [October 24, 2019, 4:16am UTC](https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679/5 "2019-10-24T04:16:24Z")

</div>

Btw, ur first card sets the dim level over time starting from present dim level.  
So if lights are on at 50%, the card goes from 50% to 70% over 5 seconds. Like it takes 5 seconds to go from 50 to 70%.  
This is not a card to put the lights on for 5 seconds!

---

<div class="post-metadata">

**Author:** ![Rubert](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rubert/32/16844_2.png) [@Rubert](https://community.homey.app/u/Rubert)\
**Post date:** [October 24, 2019, 7:04am UTC](https://community.homey.app/t/motion-sensor-with-lights-turning-off-after-certain-amount-of-time/19679/6 "2019-10-24T07:04:05Z")

</div>

Thanks for the reply. I thought the “then” part was displayed in a chronological order, but apparently not. Thanks for the input.

Follow-up question: Is there a way to program the dimmer in a manner that it will overrule the sensor for a certain amount of time. To be clear; I’ve got an ecodimmer (zigbee/z-wave) controlling the lights that are also controlled by the new flow. I still would like to keep a certain amount of manual control capability. If I would like the lights of by pressing the dimmer, or maybe less or more brightness, the flow will overrule and put the lights back according to the flow.

Tnx!
