# Simple on/off timer with dynamic input

**URL:** <https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848>\
**Category:** General\
**Created:** [18 May 2020 10:50 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848 "2020-05-18T10:50:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)\
**Post date:** [18 May 2020 10:50 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/1 "2020-05-18T10:50:59Z")

</div>

Hi,  
Im looking for a simple daily timer with an on/off set daily but with dynamic override from a UI on the dashboard. For example, every day a light comes on at 8.00pm and goes off at 11.00pm but for a couple of days I need to change it to 7.00pm and off at 10.00pm and then return to original times. I would use the inject node but I cant pass variables with msg.payload. Is there a node for this?. Cheers...

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 May 2020 11:13 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/2 "2020-05-18T11:13:12Z")

</div>

Although there are numerous ways to do this, do you need to be able to change it from the dashboard or would the node-red editor also work ?

If the latter, you could use [light scheduler](https://flows.nodered.org/node/node-red-contrib-light-scheduler) to visually setup the schedule.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [18 May 2020 11:26 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/3 "2020-05-18T11:26:16Z")

</div>

Does the timer interval stay the same or does it change too? Your example has a time on for three hours, does that change?

---

<div class="post-metadata">

**Author:** ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)\
**Post date:** [18 May 2020 12:34 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/4 "2020-05-18T12:34:39Z")

</div>

Hi, thank you for your reply. I need to be able to change the on/off times from my mobile so it must be changed from the nodered UI. Does light scheduler allow this ??. Kind regards...

---

<div class="post-metadata">

**Author:** ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)\
**Post date:** [18 May 2020 12:36 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/5 "2020-05-18T12:36:03Z")

</div>

Hi, Thank you for your reply. It can vary from 1 hour to 8 hours but I must be able to amend it on the fly from the nodered UI. Kind regards...

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2020 13:06 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/6 "2020-05-18T13:06:20Z")

</div>

You could adapt this...

[https://flows.nodered.org/flow/79a66966a6cc655a827872a4af794b94](https://flows.nodered.org/flow/79a66966a6cc655a827872a4af794b94)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [18 May 2020 13:36 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/7 "2020-05-18T13:36:57Z")

</div>

> [@Thewaver](#):
>
> Is there a node for this?.

> **[node-red-contrib-schedex](https://flows.nodered.org/node/node-red-contrib-schedex)**
>
> Scheduler for node-red which allows you to enter on/off times as 24hr clock (e.g. 01:10) or suncalc events (e.g. goldenHour). It also allows you to offset times and randomise the time within the offset.

---

<div class="post-metadata">

**Author:** ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)\
**Post date:** [20 May 2020 06:36 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/8 "2020-05-20T06:36:42Z")

</div>

Hi, thanks for everyones help. eztimer was the solution for my project

---

<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:** [3 June 2020 06:36 UTC](https://discourse.nodered.org/t/simple-on-off-timer-with-dynamic-input/26848/9 "2020-06-03T06:36:43Z")

</div>

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