# UPDATE: V1.2.1 node-red-contrib-cron-plus scheduler (incl solar events and Timezone support)

**URL:** <https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686>\
**Category:** Share Your Nodes\
**Created:** [25 July 2019 11:54 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686 "2019-07-25T11:54:30Z")\
**Posts on this page:** 20\
**Page:** 7

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 December 2019 07:22 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/123 "2019-12-07T07:22:37Z")

</div>

You could feed them via a trigger node set to send nothing then send last received. That way it would just send the last one it should have sent so the blinds etc should be set correctly for the current time.

---

<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:** [2 February 2020 23:06 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/124 "2020-02-02T23:06:39Z")

</div>

### Update V0.6.1 in GIT (not yet published to NPM) - need beta testers

#### Installation...

Install from GIT

```auto
npm install Steve-Mcl/node-red-contrib-cron-plus

```

#### Info...

Announcing large(ish) update. As well as several bug fixes and documentation improvements, the following is now supported...

- sunrise and sunset events (with +/- offset) by location with a popup map to simplify entering coordinates
- Support for cron special symbol `?`
- new msg flags `scheduledEvent` and `commandResponse` to clarify what the output msg is
- added option to direct command response messages to a separate (2nd) output

### Some graphics might help...

#### New features in action...

 ![cron-plus-new-features](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15745cf2ace2f9edece21b18a16658576e1462d2.gif)

#### Updated built in help now describes special commands and lists support of `?`...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/393da1620bdac6c4f3f2039a2583bdc70a5ff547.png)

> [@bakman2](#):
>
> If you inject `{"command":"status-all"}` - this produces `msg.payload` with an object, which means you can not distinguish between a payload value and the status.

New version has `msg.scheduledEvent` flag for scheduled events and `msg.commandResponse` for ... you get the idea 🙂

> [@bakman2](#):
>
> Consider a second output for status only output ?

Done 🙂

> [@krambriw](#):
>
> - send out "1" while sun is down
> - send out "0" while sun is up
> - having an offset of +/- 1 hour for both sunrise and sunset
> - automatically update schedules since they will change every day

Done. 🙂

> [@dceejay](#):
>
> Don't forget that the special character options L, W, ? etc are non-standard - so does the cron library used support them ?

`?` now also supported (the author of the cron library I use was kind enough to add support) 🙂

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [2 February 2020 23:29 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/125 "2020-02-02T23:29:43Z")

</div>

Nice, though the map is a little over the top - love it!

---

<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:** [2 February 2020 23:31 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/126 "2020-02-02T23:31:35Z")

</div>

> [@TotallyInformation](#):
>
> map is a little over the top

Perhaps 😛

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 February 2020 00:00 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/127 "2020-02-03T00:00:56Z")

</div>

Don't forget, not everyone is online all the time, so loading maps may not work. Hopefully it fails gracefully.

---

<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:** [3 February 2020 00:02 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/128 "2020-02-03T00:02:45Z")

</div>

Yeah, at some point I intend to put a "no internet" message or something when I figure a nice way of handling that. Any pointers?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 February 2020 00:10 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/129 "2020-02-03T00:10:32Z")

</div>

Could try [https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine)

---

<div class="post-metadata">

**Author:** ![junoprima](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/junoprima/32/63547_2.png) [@junoprima](https://discourse.nodered.org/u/junoprima)\
**Post date:** [17 March 2020 09:43 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/130 "2020-03-17T09:43:01Z")

</div>

Hello Can possible to send payload as Object or set flow  
I try with object message but show me the type message not a value in object

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/05f029beedea27d94f2bb7203b296e61305a884f.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:** [17 March 2020 20:21 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/131 "2020-03-17T20:21:19Z")

</div>

Change `type` from `str` to `json`

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [25 March 2020 08:42 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/132 "2020-03-25T08:42:42Z")

</div>

Hi Steve,  
Tested your latest where you have sunset/sunrise and offset options available, works fine  
Just one thing I miss; to allow synchronization of attached services or devices, it would be useful if it could be possible to set a repeat time of last output message. Like once a minut or every 30 second etc, you know what I mean

Currently, in my test setup, I made this "helper flow" around to let the last message be repeated every 60 second to sync a LED on a GPIO output. It works fine but would be nice if I could get rid of it

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

---

<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:** [25 March 2020 09:30 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/133 "2020-03-25T09:30:03Z")

</div>

This is a useful node for repeating messages at defined intervals. I use it a lot.

> **[node-red-contrib-msg-resend](https://flows.nodered.org/node/node-red-contrib-msg-resend)**
>
> A Node Red node to resend flow messages

---

<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:** [25 March 2020 11:45 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/134 "2020-03-25T11:45:54Z")

</div>

> [@krambriw](#):
>
> Tested your latest where you have sunset/sunrise and offset options available, works fine

Thanks. I'm in the last stages of publishing the finished article soon.

> [@krambriw](#):
>
> it would be useful if it could be possible to set a repeat time of last output message. Like once a minut or every 30 second etc, you know what I mean

As you know a Cron entry can do that already. Additionally, the dynamically programmed Cron entry can have a limit set

But...  
Do you mean an option to accompany sunrise/sunset that would permit `x` amount of resends at `t` intervals?

I'm willing to explore additional options if they make sense but in truth, there is a node like @Colin suggests - if it does this well then perhaps it's better outside of this node?

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [25 March 2020 12:11 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/135 "2020-03-25T12:11:39Z")

</div>

Yep, exactly that functionality but as you say, the recommendation by @Colin (I was not aware of that node) will do it. So does my simple "helper flow". Anyway, fine, might be better not to make the node "too fat", it's anyway easy enough to configure the functionality if required

---

<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:** [25 March 2020 12:13 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/136 "2020-03-25T12:13:36Z")

</div>

Is there a way when using sunrise/sunset to get it to send the appropriate value on deploy? That is a bit of an issue for me if node red is not running at that time.

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [25 March 2020 12:17 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/137 "2020-03-25T12:17:17Z")

</div>

> [@Colin](#):
>
> to get it to send the appropriate value on deploy?

Yes, that would be really good

---

<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:** [25 March 2020 12:30 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/138 "2020-03-25T12:30:40Z")

</div>

I'm sure I can sort that bit could you give a little detail please.

E.g. suppose you have a sunrise for NE England set (let's say that's 6:43am tomorrow) and your box is off until 13:00 - what would you expect to happen?

Suppose you have a sunrise +60m offset event called "kids bed time alarm" and the box is powered on at 3am?

Let me know your logic - I'll be happy to add small tweaks like this.

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [25 March 2020 12:41 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/139 "2020-03-25T12:41:30Z")

</div>

> [@krambriw](#):
>
> Yes, that would be really good

...a wish, also if that could be triggered by an input command?

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [25 March 2020 12:50 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/140 "2020-03-25T12:50:02Z")

</div>

> [@Steve-Mcl](#):
>
> E.g. suppose you have a sunrise for NE England set (let's say that's 6:43am tomorrow) and your box is off until 13:00 - what would you expect to happen?

sorry interferring, it was for @Colin I know, but is it ok to give an opinion on this?

I think,,,,in the example you give, the sun will be up at 1:00 pm so I would expect to get the "sunrise" schedule to send out its configured payload on the output

In any moment, whenever deployed (or triggered if you accept that idea) the node should send out either the sunrise or sunset configured payload depending on the actual sun state at that specific moment (in that geo location). EDIT: And if you have multiple sunrise/sunset entries of the same sort fulfilling that rule, I would expect payloads from all of them being sent out

---

<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:** [25 March 2020 13:29 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/141 "2020-03-25T13:29:13Z")

</div>

@krambriw's suggestion would work well for me, but I can see there is some subtlety required in the algorithm. I suppose the test is whether it is after sunrise and before sunset, or vice versa, allowing for wraparound into the next day.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [25 March 2020 20:44 UTC](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686/142 "2020-03-25T20:44:40Z")

</div>

Always nice to see other people tying themselves in logic knots for a change 🤣

[Previous page](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686.md?page=6)

[Next page](https://discourse.nodered.org/t/update-v1-2-1-node-red-contrib-cron-plus-scheduler-incl-solar-events-and-timezone-support/13686.md?page=8)
