# Flow: act upon device is on for period of time

**URL:** <https://community.homey.app/t/flow-act-upon-device-is-on-for-period-of-time/49768>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [July 25, 2021, 12:05pm UTC](https://community.homey.app/t/flow-act-upon-device-is-on-for-period-of-time/49768 "2021-07-25T12:05:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thobu](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thobu/32/18357_2.png) [@thobu](https://community.homey.app/u/thobu)\
**Post date:** [July 25, 2021, 12:05pm UTC](https://community.homey.app/t/flow-act-upon-device-is-on-for-period-of-time/49768/1 "2021-07-25T12:05:59Z")

</div>

hi, I can’t get my head around creating a flow that checks

1. if a device (light) has been continuously on for 90 minutes
2. switches of this device only if 1 has been met

I think I need a timer that is triggered once the light is switched on but then I stumble how to track that the light was on for 90 minutes.

Any ideas how to get there?  
Thanks

---

<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:** [July 25, 2021, 12:40pm UTC](https://community.homey.app/t/flow-act-upon-device-is-on-for-period-of-time/49768/2 "2021-07-25T12:40:46Z")

</div>

Flow 1:  
IF light turned on  
THEN start timer (countdown) of 5400 seconds

Flow 2:  
IF light turned off  
THEN stop timer

Flow 3:  
IF timer gets empty  
THEN turn light off

Pretty much the same way as any other light trigger that is given in [this thread](https://community.homey.app/t/simple-lights-turning-on-off-based-on-motion/10889) where the default zone activity can’t be used.

---

<div class="post-metadata">

**Author:** ![thobu](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thobu/32/18357_2.png) [@thobu](https://community.homey.app/u/thobu)\
**Post date:** [July 25, 2021, 12:59pm UTC](https://community.homey.app/t/flow-act-upon-device-is-on-for-period-of-time/49768/3 "2021-07-25T12:59:19Z")

</div>

Ok, I’m starting to see the lights, you say I have to have all these 3 flows enabled? I think my problem was I wanted to have it in less than 3 flows?

---

<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:** [July 25, 2021, 1:30pm UTC](https://community.homey.app/t/flow-act-upon-device-is-on-for-period-of-time/49768/4 "2021-07-25T13:30:58Z")

</div>

That’s what most users are dealing with at the start, they want everything in as less flows as possible, which just doesn’t work.

Just make sure to put everything nicely layed out into folders so it stays findable, the amount of flows won’t bottle neck your Homey in any way. (Can speak with experience, as I’m running over 700 flows myself)
