# Test if a value is below a limit for a while

**URL:** <https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762>\
**Category:** Questions & Help\
**Tags:** advancedflow\
**Created:** [July 17, 2023, 4:05pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762 "2023-07-17T16:05:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mats\_Johnson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mats_johnson/32/56590_2.png) [@Mats\_Johnson](https://community.homey.app/u/Mats_Johnson)\
**Post date:** [July 17, 2023, 4:05pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/1 "2023-07-17T16:05:55Z")

</div>

Is a good way to test this to use a “When X becomes less than Y” → “delay 5 minutes” → “and X is less than Y” → action, or will this become a mess due to the somewhat long delay for some reason?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 17, 2023, 4:24pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/2 "2023-07-17T16:24:47Z")

</div>

In those 5 minutes X can become greater than Y.

---

<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:** [July 17, 2023, 5:01pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/3 "2023-07-17T17:01:12Z")

</div>

I suggest 3 simple flows,  
Flow 1: IF value x less than y THEN start timer of 5 minutes  
Flow 2: IF value x changed AND x bigger or equal to y THEN reset timer  
Flow 3: IF timer ends THEN “do your thing”

Edit: timer from f.i. chronograph app

> **[Chronograph](https://homey.app/nl-nl/app/nl.fellownet.chronograph/Chronograph/)**
>
> Voegt accurate timer, stopwatch en transitie functionaliteit toe aan Homey.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 17, 2023, 6:52pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/4 "2023-07-17T18:52:15Z")

</div>

You have to explain “start timer” because that’s not a built-in feature.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [July 18, 2023, 1:00am UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/5 "2023-07-18T01:00:59Z")

</div>

How about:

 ![Screenshot_20230718-030212_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/4/949dc5bcb994344d5cf22622412d4e63035649fe.jpeg)

[Device Capabilities app](https://community.homey.app/t/app-pro-device-capabilities-enhance-the-capabilities-of-devices/43287)

---

<div class="post-metadata">

**Author:** ![Valentin\_Ciopei](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@Valentin\_Ciopei](https://community.homey.app/u/Valentin_Ciopei)\
**Post date:** [July 18, 2023, 10:01am UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/6 "2023-07-18T10:01:18Z")

</div>

I think he is referring to countdown.

---

<div class="post-metadata">

**Author:** ![Mats\_Johnson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mats_johnson/32/56590_2.png) [@Mats\_Johnson](https://community.homey.app/u/Mats_Johnson)\
**Post date:** [July 18, 2023, 4:39pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/7 "2023-07-18T16:39:40Z")

</div>

I’m aware, that is why I had a test after the period as well. I wasn’t checking during the period though, but I wanted to keep this simple task simple, so I thought the limitation would be worth it.  
I suspected though that I might risk triggering a lot of running flows with delays that then would execute a lot of chaotic actions that seem unrelated to the current state if the value would oscillate around the limit. I suppose this is not a good solution, which is why I asked in this forum 🙂

---

<div class="post-metadata">

**Author:** ![Mats\_Johnson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mats_johnson/32/56590_2.png) [@Mats\_Johnson](https://community.homey.app/u/Mats_Johnson)\
**Post date:** [July 18, 2023, 4:42pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/8 "2023-07-18T16:42:22Z")

</div>

This seems like a much better solution than mine, thanks. It is a bit complicated though if you want several of those kinds of actions.

---

<div class="post-metadata">

**Author:** ![Mats\_Johnson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mats_johnson/32/56590_2.png) [@Mats\_Johnson](https://community.homey.app/u/Mats_Johnson)\
**Post date:** [July 18, 2023, 4:44pm UTC](https://community.homey.app/t/test-if-a-value-is-below-a-limit-for-a-while/84762/9 "2023-07-18T16:44:11Z")

</div>

This is fantastic, I thought this would be something others must’ve wanted, and it turns out it was. I’ll try this out for sure!
