# How to make a motion triggered flow only run a task once an hour?

**URL:** <https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799>\
**Category:** Flows\
**Created:** [June 6, 2023, 6:17pm UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799 "2023-06-06T18:17:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Icepick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/icepick/32/56463_2.png) [@Icepick](https://community.homey.app/u/Icepick)\
**Post date:** [June 6, 2023, 6:17pm UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799/1 "2023-06-06T18:17:25Z")

</div>

Probably a simple flow question… but i can’t figure it out.

I want my nanoleaf lights to play an effect every time the motion sensor is triggered… but… I only want the effect on the light to run once an hour. So if the motionsensor is triggered a little timer will start to run. All motion triggers within that hour won’t do anything until the hour is up… and then it will run the light effect again… and then the timer will start again…  
Any ideas?

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [June 6, 2023, 6:49pm UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799/2 "2023-06-06T18:49:42Z")

</div>

Use eg. [Countdown app](https://homey.app/en-us/app/nl.bevlogenheid.countdown/CountDown/) - when the motion will trigger AND countdown is not running, do the action and start the Countdown for 1 hour.

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [June 6, 2023, 8:18pm UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799/3 "2023-06-06T20:18:34Z")

</div>

Create a Boolean variable “EffectPlayed” default value false.  
Create a flow triggered by motion AND “EffectPlayed” = false THEN play effect and set “EffectPlayed” to true.  
Create another flow that resets “EffectPlayed” to false at every hour.

---

<div class="post-metadata">

**Author:** ![Icepick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/icepick/32/56463_2.png) [@Icepick](https://community.homey.app/u/Icepick)\
**Post date:** [June 7, 2023, 3:35am UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799/4 "2023-06-07T03:35:42Z")

</div>

Nice idea… however I noticed I run into a problem with the countdown app. In the second step (the countdown is not running) it always returns a false even on the first run. This will make the rest of the flow not run. Any ideas?

 ![Screenshot 2023-06-07 at 05.33.30](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/0/30c5b656dec4b05a152179ee4e7be6e02ec140ac.jpeg)

---

<div class="post-metadata">

**Author:** ![Icepick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/icepick/32/56463_2.png) [@Icepick](https://community.homey.app/u/Icepick)\
**Post date:** [June 7, 2023, 3:37am UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799/5 "2023-06-07T03:37:29Z")

</div>

The only problem with this is that the last flow (set the effectplayed to false) might run a minute after my last movement. I only want the lighteffect to run an hour after the last time it ran.

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [June 7, 2023, 8:17am UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799/7 "2023-06-07T08:17:14Z")

</div>

Strange, have you setup the Countdown timer and THEN used it ?

![obrazek](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/4/b4545594a2d298be44a64f000459f92834bdab69.png)

---

<div class="post-metadata">

**Author:** ![Icepick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/icepick/32/56463_2.png) [@Icepick](https://community.homey.app/u/Icepick)\
**Post date:** [June 7, 2023, 9:54am UTC](https://community.homey.app/t/how-to-make-a-motion-triggered-flow-only-run-a-task-once-an-hour/81799/8 "2023-06-07T09:54:18Z")

</div>

I got it to work!

 ![Screenshot 2023-06-07 at 11.29.51](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/8/d8cfbd3765f8e20fae6ae75f3fbba48e8bbe4785.jpeg)

What is a bit confusing to me as a homey pro newbie is seeing some sense of logging of the flows. From what I can tell I can’t really see when a flow has been run etc.
