# Is there a scheduling node that does this

**URL:** <https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800>\
**Category:** General\
**Created:** [28 December 2021 16:57 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800 "2021-12-28T16:57:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [28 December 2021 16:57 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/1 "2021-12-28T16:57:35Z")

</div>

[edited to clarify some points]

This is kind of a question AND an idea for a contrib (if it doesn't exist). There are a tonne of scheduling nodes and I've tried quite a few of them. [Here's a good list](https://flows.nodered.org/collection/c8156f6276976bfb518d1e60442e01e2). Perhaps I've missed this as I haven't tried them all, in which case would love to know.

Here's what I am looking for:

- Imagine the Inject node, which has an ADD button at the bottom:  

- ... except each line you add is an event. You could then edit the details of that event. Within the details to edit, you could set name (to easily identify it from the list), and _any number_ of message properties (again using a little ADD button, which creates multiple lines). The latter would be the same as the inject node, which allows you to e.g. set msg.topic, msg.payload, and if you like, msg.blah

- Final two things: you could set the event start time, and a recurrence pattern like this:  

- Optionally it might allow setting a duration or end time, with different selection of message properties, the latter would be fired at the end time

- A bonus would be the ability to set dynamic start times, e.g. sunrise, sunrise plus offset in seconds/minutes/hours, and even have these form the recurrence patterns, i.e. every day at sunrise.

I _know_ what I'm asking for is simple, everyone does it, and there are tonnes of contribs that can do this functionality. But I simply haven't been able to find the ability to set multiple "timers" or events per single inject node, without a whole load of additional bells and whistles that confuse me a lot.

Here are some examples of what I have tried, but they don't work for me:

**node-red-contrib-light-scheduler** :

- assumes I want to set an OFF payload
- requires an end time
- recurrence is only weekly and the visual thing is annoying
- inflexible message properties: only allows setting topic and payload, and topic has to be same for ON and OFF

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b2a87e7200e28ba098e299baf8dbc7f1c081943.png)

**Inject Node set to "interval between times"**

- This actually comes really close but...
- Only allows every x _minutes_, and not seconds / hours / days
- Doesn't allows multiple events per node (although that's not a huge deal, you could just add multiple nodes)
- No option for an OFF message or some more advanced stuff like sunset  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee664a244573d79956eda2e7743377787a876e08.png)

**Scargill's Big Timer**

- I've no doubt this is the ultimate timer, but it doesn't have the simplicity. Maybe I just need to try harder to understand it. But I have stared at it for ages trying to work out how to send a simple message with configurable properties.
- No different message topics for different timers, or for ON vs OFF
- IT says "MQTT payload" but I don't want to use MQTT...

Can anyone help me find something similar to what I need?

---

<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:** [28 December 2021 16:59 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/2 "2021-12-28T16:59:14Z")

</div>

[Node-red-contrib-cron-plus](https://flows.nodered.org/node/node-red-contrib-cron-plus) does pretty much all of this.

---

<div class="post-metadata">

**Author:** ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)\
**Post date:** [28 December 2021 21:26 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/3 "2021-12-28T21:26:03Z")

</div>

Great node but I fail to see how I could construct an entire message as it only allows one "Output property". The OP wants

> [@hazymat](#):
>
> _any number_ of message properties

---

<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:** [28 December 2021 21:34 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/4 "2021-12-28T21:34:11Z")

</div>

Have you used it?

You can have 1 or hundreds of, schedules, each with own topic and unique payload, from one output pin or many. It is 100% dynamically programmable, has solar schedules with offset and pretty much everything the OP asked for.

> [@LosinIt](#):
>
> it only allows one "Output property". The OP wants
> 
> > [@hazymat](#):
> >
> > _any number_ of message properties

Fan out mode permits many outputs. Did you read the readme?

Ps, it also has built in demos and a Cron builder for anyone not familiar with the powerful syntax of Cron.

---

<div class="post-metadata">

**Author:** ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)\
**Post date:** [28 December 2021 21:43 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/5 "2021-12-28T21:43:24Z")

</div>

> [@Steve-Mcl](#):
>
> Have you used it?

Yes.

> [@Steve-Mcl](#):
>
> Did you read the readme?

Yes.

I can see that a msg.payload can be quite extensive but how do I assign a msg.topic in addition to the msg.payload?

---

<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:** [28 December 2021 21:55 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/6 "2021-12-28T21:55:20Z")

</div>

The 2nd field is the topic. The 1st field is the name of the schedule. It's described in the built in help.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [28 December 2021 21:56 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/7 "2021-12-28T21:56:11Z")

</div>

It couldn't be easier...

 ![Inkedcron_LI](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd430a5614f969ad9a4a2a60aeaea8816737efb2.jpeg)

Cron+ IMO is the better choice.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [28 December 2021 22:04 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/8 "2021-12-28T22:04:34Z")

</div>

> [@Paul-Reed](#):
>
> It couldn't be easier...

Hmm it could be a teeny bit easier if the two fields you have filled with "name" and "topic" were not both initialised to "schedule1"  
Or, to be fair, if I'd noticed the tooltips or RTFM. 🙃

 ![Untitled 4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bdaf48e04f93b40d07dcfa0c95177636cb2774a9.jpeg)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [28 December 2021 22:06 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/9 "2021-12-28T22:06:17Z")

</div>

> [@jbudd](#):
>
> Hmm it could be a teeny bit easier if the two fields you have filled with "name" and "topic" were not both initialised to "schedule1"

Look at the image I posted, in the second row I typed name, topic, payload...

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [28 December 2021 22:10 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/10 "2021-12-28T22:10:22Z")

</div>

Yes, I saw that thanks @Paul-Reed.  
I just wanted to suggest that initial values "name1" and "topic1" would be clearer.

Until now I had not realised the topic field was there, now I can go and remove the change nodes I used to st msg.topic.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [28 December 2021 22:13 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/11 "2021-12-28T22:13:05Z")

</div>

> [@jbudd](#):
>
> I just wanted to suggest that initial values "name1" and "topic1" would be clearer

Yes, I also agree, maybe it's something that @Steve-Mcl could consider?  
(I guess we are drifting off-topic, sorry @hazymat)

---

<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:** [28 December 2021 23:16 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/12 "2021-12-28T23:16:48Z")

</div>

> [@jbudd](#):
>
> Or, to be fair, if I'd noticed the tooltips or RTFM

Jeeez how many clues do you want 😂😂😂

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [28 December 2021 23:46 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/13 "2021-12-28T23:46:56Z")

</div>

Okay cronplus is really cool, really like the cronplus object it adds into the msg.

If I need msg.foo = bar, I can set msg.payload to a JSON message {"foo": "bar"}, then just use a change / function node to basically overwrite the msg object with whatever comes in from msg.payload.

Also the expression builder is very cool.

I would also add that the pre-filled text "schedule1" and "schedule1" completely confused me at first and I would have uninstalled it thinking "I have no idea what that is". Yes, I can RTFM - but after having RTFM multiple times for multiple different contribs - some of which are really badly written and take ages to get your head around, I sometimes get lazy and thing "if it isn't obvious from the UI then I don't want to invest the time". I know it's lazy but hopefully have justified why people get lazy sometimes. I usually gravitate to things that explain themselves, then dig deeper into manuals if I need to later...

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [29 December 2021 00:00 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/14 "2021-12-29T00:00:13Z")

</div>

> [@hazymat](#):
>
> (i.e. some other message property that isn't topic or payload)?

Including flow/global?

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [29 December 2021 00:17 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/15 "2021-12-29T00:17:29Z")

</div>

> [@Paul-Reed](#):
>
> Including flow/global?

I believe you can set msg.payload to flow.whatever or global.whatever

But I'm talking about being able to set msg.anything to xyz. Like the Inject node allows.

---

<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:** [29 December 2021 00:18 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/16 "2021-12-29T00:18:31Z")

</div>

> [@hazymat](#):
>
> . I usually gravitate to things that explain themselves, then dig deeper into manuals if I need to later

I do understand that train of thought however it is an absolute art to achieve. I try my best.

I certainly can change the default topic to `topicx` for next revision.

---

<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:** [29 December 2021 00:20 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/17 "2021-12-29T00:20:37Z")

</div>

> [@hazymat](#):
>
> But I'm talking about being able to set msg.anything to xyz. Like the Inject node allows

You can do that too. The payload (or whatever you want to call it) can be set to whatever. What you can't do is set multiple properties of msg (but you can set multiple properties of msg.xxx)

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [29 December 2021 00:39 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/19 "2021-12-29T00:39:05Z")

</div>

> [@Steve-Mcl](#):
>
> What you can't do is set multiple properties of msg (but you can set multiple properties of msg.xxx)

Not sure I understand this distinction -

Do you mean I would do it like the below?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/31100c4e48da3aaa7ce0b1ecdd5a6628e3ceb390.png)

---

<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:** [29 December 2021 01:03 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/20 "2021-12-29T01:03:00Z")

</div>

What you have is perfectly fine. Setting multiple properties of msg.payload.

---

<div class="post-metadata">

**Author:** ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)\
**Post date:** [29 December 2021 01:31 UTC](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800/21 "2021-12-29T01:31:30Z")

</div>

> [@jbudd](#):
>
> "name" and "topic" were not both initialised to "schedule1"

> [@jbudd](#):
>
> I just wanted to suggest that initial values "name1" and "topic1" would be clearer.  
> Until now I had not realised the topic field was there, now I can go and remove the change nodes I used to st msg.topic.

> [@hazymat](#):
>
> I would also add that the pre-filled text "schedule1" and "schedule1" completely confused me at first and I would have uninstalled it thinking "I have no idea what that is". Yes, I can RTFM - but after having RTFM multiple times for multiple different contribs - some of which are really badly written and take ages to get your head around

This 👆 is why it completely escaped me.

> [@Steve-Mcl](#):
>
> I certainly can change the default topic to `topicx` for next revision.

That likely would have avoided my confusion and it will be much appreciated. Cronplus is the best scheduler I tried and that's why I've stuck with it. Now that this topic has shown me "the rest of the story" it's even better and I can clean up some of the kludges I've done.

Thanks all!

[Next page](https://discourse.nodered.org/t/is-there-a-scheduling-node-that-does-this/55800.md?page=2)
