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 14 forks source link

Recent problems with sunevents - Invalid date #3

Closed njh closed 5 years ago

njh commented 5 years ago

Hi,

I have been using sunevents very happy for several years now to trigger my lights to come on based on the sunsetStart event.

However a little while ago, I think after upgrade node or node-red, it has stopped working:

28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Calculating times for Sat Sep 28 2019 23:59:59 GMT+0100
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring solarNoon, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nadir, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunrise, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunset, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunriseEnd, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunsetStart, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring dawn, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring dusk, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nauticalDawn, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nauticalDusk, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nightEnd, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring night, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring goldenHourEnd, was Invalid date, NaN hours ago
28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring goldenHour, was Invalid date, NaN hours ago
28 Sep 17:00:59 - [info] Stopping flows

However, after a restart it does seem to calculate the times correctly:

28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Initialising job to calculate sunevents
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Calculating times for Sat Sep 28 2019 23:59:59 GMT+0100
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring solarNoon, was Today at 12:54 PM, -4 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nadir, was Today at 12:54 AM, -16 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunrise, was Today at 6:58 AM, -10 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting sunset Today at 6:49 PM in 1 hours
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunriseEnd, was Today at 7:01 AM, -9 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting sunsetStart Today at 6:46 PM in 1 hours
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring dawn, was Today at 6:24 AM, -10 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting dusk Today at 7:23 PM in 2 hours
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nauticalDawn, was Today at 5:45 AM, -11 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting nauticalDusk Today at 8:02 PM in 3 hours
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nightEnd, was Today at 5:05 AM, -11 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting night Today at 8:42 PM in 3 hours
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring goldenHourEnd, was Today at 7:42 AM, -9 hours ago
28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting goldenHour Today at 6:05 PM in 1 hours

Are you or anyone else seeing similar problems? Any suggestions on how to diagnose what is wrong?

Thanks for creating this module!

nick.

freakent commented 5 years ago

Hi Nick, I must confess to have not touched that code for a long time. It just runs in my home raspberry pi and does it’s job. I also realise my version of node-red is probably very old now too. I am away at the moment but will take a closer look when I get back.

Regards, Martin

On 28 Sep 2019, at 19:24, Nicholas Humfrey notifications@github.com wrote:

 Hi,

I have been using sunevents very happy for several years now to trigger my lights to come on based on the sunsetStart event.

However a little while ago, I think after upgrade node or node-red, it has stopped working:

28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Calculating times for Sat Sep 28 2019 23:59:59 GMT+0100 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring solarNoon, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nadir, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunrise, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunset, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunriseEnd, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunsetStart, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring dawn, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring dusk, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nauticalDawn, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nauticalDusk, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nightEnd, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring night, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring goldenHourEnd, was Invalid date, NaN hours ago 28 Sep 00:00:00 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring goldenHour, was Invalid date, NaN hours ago 28 Sep 17:00:59 - [info] Stopping flows However, after a restart it does seem to calculate the times correctly:

28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Initialising job to calculate sunevents 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Calculating times for Sat Sep 28 2019 23:59:59 GMT+0100 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring solarNoon, was Today at 12:54 PM, -4 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nadir, was Today at 12:54 AM, -16 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunrise, was Today at 6:58 AM, -10 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting sunset Today at 6:49 PM in 1 hours 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring sunriseEnd, was Today at 7:01 AM, -9 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting sunsetStart Today at 6:46 PM in 1 hours 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring dawn, was Today at 6:24 AM, -10 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting dusk Today at 7:23 PM in 2 hours 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nauticalDawn, was Today at 5:45 AM, -11 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting nauticalDusk Today at 8:02 PM in 3 hours 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring nightEnd, was Today at 5:05 AM, -11 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting night Today at 8:42 PM in 3 hours 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Ignoring goldenHourEnd, was Today at 7:42 AM, -9 hours ago 28 Sep 17:00:59 - [info] [sun events:2ae43e80.8e0782] [sunevents] Emitting goldenHour Today at 6:05 PM in 1 hours Are you or anyone else seeing similar problems? Any suggestions on how to diagnose what is wrong?

Thanks for creating this module!

nick.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

njh commented 5 years ago

I am not certain how, but I think I have managed to fix this.

I suspect that is the most likely thing that fixed it was upgrading suncalc.

At some point I need to try upgrading node-red to version 1.0.

Thanks for this module!