# Variable timers

**URL:** https://discourse.nodered.org/t/variable-timers/2497
**Category:** General
**Created:** [22 August 2018 21:49 UTC](https://discourse.nodered.org/t/variable-timers/2497 "2018-08-22T21:49:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jumecittu](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Jumecittu](https://discourse.nodered.org/u/Jumecittu)
#### Post date: [22 August 2018 21:49 UTC](https://discourse.nodered.org/t/variable-timers/2497/1 "2018-08-22T21:49:13Z")

</div>

Hi everyone , I'm Enzo a new community member. I've a problem that I can not solve.  
I have a node that send me a number es 3 , 5 ,7 etc for me that numbers are second, i have a second node takes in input these second and active a light for a time (second ) in input . My problems is: for example time are 10 second and start a timer for 10 second , after 3 second of a start the node receive a second inpunt with 5 second the new final time is 12 second . You as you would program it ?

Many thanks

---

<div class="post-metadata">

### Author: ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)
#### Post date: [22 August 2018 21:57 UTC](https://discourse.nodered.org/t/variable-timers/2497/2 "2018-08-22T21:57:43Z")

</div>

Once the countdown of the time has started you can not modify the time on the fly, you can change online from a message or the dashboard the value of the timer using the delay node configuring the timer as per msg.delay

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f153ed1a4bbe1e161f2a6df20297155bbefe2519.png)

If you know that you can receive 2 or 3 values or similar you can make something like a cascade, the first value receive will write the first value for the first delay timer and once is over reset a global variable, if during this time a new message is received then signal will be redirected to other line that blocks the out of the first one and write the value on the second delay timer, once timer is over will send the message and reset the sequence.

Something like this is easy to achieve however is a bit twisted to realize.

I think some day I wrote some post with one similar example I will try to find it out and give you the link as this could be one idea.

Regards

---

<div class="post-metadata">

### Author: ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)
#### Post date: [22 August 2018 21:59 UTC](https://discourse.nodered.org/t/variable-timers/2497/3 "2018-08-22T21:59:31Z")

</div>

Here we go.... has nothing to do with timers but the principle could be the same....

> [@Input order in the Chart node](https://discourse.nodered.org/t/input-order-in-the-chart-node/1213/12):
>
> Hello Charles You told me you wanted to ensure as soon as the system is started or deployed. In order to do that if you see at start I set all flow variables to off to initiate the sequence on this part: [image] If you wanted this to happen also when you push on delete the data you just need to wire this also from wherever you use to clean the chart to set to "off" again the variables. like this on the example flow I gave you: [image] This will restart the sequence on the same way that ha…

copy the flow and check it how it works to understand better.

Regards

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [29 August 2018 03:47 UTC](https://discourse.nodered.org/t/variable-timers/2497/4 "2018-08-29T03:47:18Z")

</div>

CHeckout Mytimeout by Cherry - it is great and will do exactly what you want with very little effort.

Craig
