Closed schildbach closed 1 year ago
I am currently updating this node to make sure it is working on the latest node-red. Once that is stable I will look at this. I have some uses for this too. Can you describe the use case you are think of so I can add your usage to my test cases?
Well, since I love looking at a rising full moon while the sky is still lit by the sun, I'd like an announcement as soon as the moon rises and is (still) almost full. It would be a combination of the data 'suncalc' provides.
Suncalc has separate api for sun and moon events, are you suggesting you'd like to see one node-red node do both? I was thinking I would create another similar node for moon events.
I guess two nodes would be nice.
I have now read the suncalc docs properly for moon times and there is clearly a difference between sun and moon times. The suncalc library will return the moon rise and moon set times that I could emit as events on days that have them, but there can be days where the moon is it either always up or always down. What would be the desired behaviour on those days?
I'd say just ignore the sun, and therefore ignore days. Just fire an event if the moon rises, and fire an event if the moon sets.
(Note that depending on where you live, there can also be days without sunrise or sunset.)
Getting the moon's illumination (moon phase changes) would be nice too, so you can visualize it in the Dashboard, for example. 🌝
Sorry this is out of scope.
The Suncalc library can do this, see https://github.com/mourner/suncalc#moon-rise-and-set-times and https://github.com/mourner/suncalc#moon-illumination.