freakent / node-red-contrib-sunevents

A node for node-red that generates events based on the position of the Sun at the appropriate time of day.
Apache License 2.0
15 stars 13 forks source link

Does not output current sunevent (or prev/next) #42

Closed sandervandenberg closed 1 year ago

sandervandenberg commented 1 year ago

I noticed that the node does not output the current sunevent. So, when starting/deploying node red, I can inject the lat/long and then it calculates the events, and then it sits there until a sunevent happens.

I'd like to set -for example- my lights to a certain brightness/kelvin based upon the sunevent we're currently in, but there is no way to do that. I have to wait until the next event triggers. Another thing I want to do is show the current sunevent in my HA dashboard.

It would be nice if this node could also -optionally- send out a message with the current sunevent, either on startup or upon receiving a certain message.

freakent commented 1 year ago

Please see latest 3.1 release. There is now an additional output that provides a list of the "missed" sun events. Please note, conceptually there is no such thing as a "current event". An event occurs at a precise moment in time, once that time has passed it is no longer current. The concept you are describing is State. States and events are not the same thing. Events can cause a change in State and there can be a current state. For example, the event "sunset" causes a change in system state of "lights on". The "lights on" state stays current until another event such as "dawn" occurs causes it to change to "lights off". With the missed events output you can decide how you wish to initialise system state.