# Pull request discussion - node-red-node-suncalc (send msg at startup)

**URL:** <https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187>\
**Category:** Feature Requests\
**Created:** [22 September 2024 20:11 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187 "2024-09-22T20:11:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [22 September 2024 20:11 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/1 "2024-09-22T20:11:07Z")

</div>

Hi folks,

I would like to create a pull request to add a new feature to the [node-red-node-suncalc](https://github.com/node-red/node-red-nodes/tree/master/time/suncalc) node, but the contribution guidelines mention to discuss all new PR's in this forum.

I added last night the suncalc node to my flow, to know sunset and sunrise. That works fine. But when I restart Node-RED, I also need to know whether it is day or night. And I would like to avoid that my flow needs to store that info, because I like to keep my flows as simple as possible. And I also want to avoid reading the first output of the node (where an output msg is being send periodically), to avoid doing lots of unnecessary processing.

So I added this checkbox to the config screen:

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

Now it sends the output msg also on the second output when my flow is started.

Hopefully it is ok to create my pull request.

Thanks!  
Bart

---

<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:** [22 September 2024 20:41 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/2 "2024-09-22T20:41:04Z")

</div>

If you really can’t wait the minute for that first output then yes 🙂

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [22 September 2024 20:47 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/3 "2024-09-22T20:47:00Z")

</div>

Hey Dave,  
You seem to be aware of my impatient nature 😋

But I don't want to listen to the messages on the first output every minute, and check in my flow if the value has changed. The second output is great for me: I get 2 messages per day, one at sunset and one sunrise. As a result I have a simple flow, and I only get the required messages (when the value changes between day and night).

I just want an extra message in between, when my Node-RED is restarted. Just to know if it is day or night at that moment.

---

<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:** [22 September 2024 20:49 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/4 "2024-09-22T20:49:08Z")

</div>

Not a problem. Though a filter node would have a similar effect. Go for it.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [22 September 2024 21:12 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/5 "2024-09-22T21:12:05Z")

</div>

Here it is:

> <https://github.com/node-red/node-red-nodes/pull/1083>
>
> \- \[\] Bugfix (non-breaking change which fixes an issue)
> \- \[X\] New feature (non-…breaking change which adds functionality)
> 
> \## Proposed changes
> 
> As discussed on Discourse (see \[here\](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/3)), I would like to get an output msg (at the second output) at startup to know whether it is day or night.
> 
> BTW the grunt tests failed at another node:
> 
> !\[image\](https://github.com/user-attachments/assets/4ba77b14-1788-43c7-a08f-9b56e5d54873)
> 
> \## Checklist
> 
> 
> \- \[X\] I have read the \[contribution guidelines\](https://github.com/node-red/node-red-nodes/blob/master/CONTRIBUTING.md)
> \- \[X\] For non-bugfix PRs, I have discussed this change on the forum/slack team.
> \- \[\] I have run \`grunt\` to verify the unit tests pass
> \- \[\] I have added suitable unit tests to cover the new/changed functionality

---

<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:** [24 September 2024 20:40 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/6 "2024-09-24T20:40:39Z")

</div>

Thanks Bart, merged and published as version 1.2.0

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [25 September 2024 20:56 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/7 "2024-09-25T20:56:46Z")

</div>

Hi Dave,  
Thanks for the quick review and publishing!  
The new version is now running in my flow...  
Bart

---

<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:** [24 November 2024 20:56 UTC](https://discourse.nodered.org/t/pull-request-discussion-node-red-node-suncalc-send-msg-at-startup/91187/8 "2024-11-24T20:56:47Z")

</div>

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