# Alarm Clock / Setting inject to start withl global variable

**URL:** https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831
**Category:** General
**Created:** [21 August 2020 12:47 UTC](https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831 "2020-08-21T12:47:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![zimb86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zimb86/32/26925_2.png) [@zimb86](https://discourse.nodered.org/u/zimb86)
#### Post date: [21 August 2020 12:47 UTC](https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831/1 "2020-08-21T12:47:09Z")

</div>

Hi all,  
I´m looking for the easiest way to start a flow at a specific time.  
This time ist actually saved in a global variable global.alarmclock\_time  
I tried to achieve this using "inject enhanced" and set tje global variable as trigger.  
This works when creating the object and the correct time is displayed unter the inject.  
However when the global variable is changed the inject is not refreshed.

Maybe I´m thining in the completely wrong direction but i´m just looking for a way to set an alarm clock via dashboard and starting at the given time at next morning.

Any help is highly appreciated  
zimb

---

<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: [21 August 2020 13:03 UTC](https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831/2 "2020-08-21T13:03:25Z")

</div>

Have a look at node-red-contrib-cron-plus.

---

<div class="post-metadata">

### Author: ![zimb86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zimb86/32/26925_2.png) [@zimb86](https://discourse.nodered.org/u/zimb86)
#### Post date: [21 August 2020 13:05 UTC](https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831/3 "2020-08-21T13:05:34Z")

</div>

Thanks Colin - i already did and was a little bit overwhelmed passing the start time into it.  
However i just found the option "recalulate" in Inject enhanced. Its normally set to 2 hours.  
Shouldnt it do the trick so that the global variable is re-read after 2 hours?

---

<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: [21 August 2020 13:09 UTC](https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831/4 "2020-08-21T13:09:42Z")

</div>

> [@zimb86](#):
>
> was a little bit overwhelmed passing the start time into it

It is worth the investment to get it going. Apart from anything else you will learn. Show us what you have tried so far.

---

<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: [22 August 2020 07:27 UTC](https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831/5 "2020-08-22T07:27:34Z")

</div>

> [@zimb86](#):
>
> i´m just looking for a way to set an alarm clock via dashboard and starting at the given time at next morning

Here is a working example I did for anther member. Its pretty much a complete demo of what you are asking...

> [@Enter time on Dashboard and get event trigger in node-red](https://discourse.nodered.org/t/enter-time-on-dashboard-and-get-event-trigger-in-node-red/31615/2):
>
> You can do this with cron-plus node. There is even a dashboard demo in the built in importable flows (node-red menu, import, examples) The demo does it with a Cron input but you could swap this out for a date and time entry field. UPDATE... Here is an example... the flow... [{"id":"5e57cc8a.617d44","type":"change","z":"d391a194.5dc1d","name":"","rules":[{"t":"set","p":"ui\_add\_schedule\_name","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"",…

---

<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 October 2020 07:27 UTC](https://discourse.nodered.org/t/alarm-clock-setting-inject-to-start-withl-global-variable/31831/6 "2020-10-21T07:27:40Z")

</div>

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