# How can I check whether a value is a certain timeabove the value of another variable?

**URL:** <https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249>\
**Category:** General\
**Created:** [7 May 2020 15:06 UTC](https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249 "2020-05-07T15:06:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiwi\_gamer01](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@Kiwi\_gamer01](https://discourse.nodered.org/u/Kiwi_gamer01)\
**Post date:** [7 May 2020 15:06 UTC](https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249/1 "2020-05-07T15:06:44Z")

</div>

How can I check whether a value (e.g. from one variable) is a certain time (e.g. 15 minutes) above the value of another variable?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 15:28 UTC](https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249/2 "2020-05-07T15:28:38Z")

</div>

Use a Switch node to perform the test and if it is above then send a message to o/p 1, feed that into a Trigger node set to Send Nothing, then Send Original Message after 15 minutes. Back at the Switch node configure it Othewise send to output 2 and then use a Change node to set msg.reset (it doesn't matter what it is set to). Note msg.reset not msg.payload.reset. Then feed that into the Trigger node also.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/01e5b21fcb925fbff25e68b2f0d3a7cf31ea2047.png)

---

<div class="post-metadata">

**Author:** ![Kiwi\_gamer01](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@Kiwi\_gamer01](https://discourse.nodered.org/u/Kiwi_gamer01)\
**Post date:** [7 May 2020 15:37 UTC](https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249/3 "2020-05-07T15:37:20Z")

</div>

That would work as far as if the value of the variable changes over time, but unfortunately it doesn't

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 16:01 UTC](https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249/4 "2020-05-07T16:01:57Z")

</div>

I have no idea what you mean by that. Please explain in more detail what the inputs are and what outputs you want.  
Also exactly what situation the suggested flow does not support.

---

<div class="post-metadata">

**Author:** ![Kiwi\_gamer01](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@Kiwi\_gamer01](https://discourse.nodered.org/u/Kiwi_gamer01)\
**Post date:** [7 May 2020 16:15 UTC](https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249/5 "2020-05-07T16:15:26Z")

</div>

sorry i didn't know that you can reset the trigger

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 May 2020 16:15 UTC](https://discourse.nodered.org/t/how-can-i-check-whether-a-value-is-a-certain-timeabove-the-value-of-another-variable/26249/6 "2020-05-21T16:15:30Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
