jensrossbach / node-red-contrib-chronos

Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes
https://jensrossbach.github.io/node-red-contrib-chronos
MIT License
28 stars 1 forks source link

Local Time vs Server Time and Astronomical Phenomenon #98

Closed nanofortran closed 1 year ago

nanofortran commented 2 years ago

I see in issue #80 the discussion of the configuration file, that being a case in which the server is in a different location (like a cloud provider) but your use case local timezone differs from the remote server time. The setting of the timezone field in the configuration works for me. So, I request an event at 8:45 PM and it performs as scheduled, the node compensating for the time shift. My issue is with the sun position calculations.

My use case is in America/New_York but my server is 4 hours ahead in Reykjavik. Sunrise tomorrow (locally in New York) is at 7:26, but when I use the pull down menu to assign sunrise the 'next event at . . ." time is 11:26. (NY + 4). I am not sure if the issue is that the 'next event at . . .' note is wrong or if the module is computing sunrise in New York based upon the server time.

I have the correct latitude and longitude in the configuration, confirmed by Open Street Map. I will set an event for sunrise tomorrow and see when/if it triggers, so I will know more in a day and report back.

nanofortran commented 1 year ago

Yes, to confirm, local sun position calculations are calculated with reference to the timezone of the remote server, even if one specifies the local time zone for the server to utilize in the configuration file.

jensrossbach commented 1 year ago

Hi @nanofortran, currently I cannot explain this because also for the sun an moon times, the node should shift the time according to the configured time zone. Can you please double check that you really entered the NY time zone in the configuration node (the latitude and longitude coordinates have no influence on the time zone, they are solely used for the geographic position that is needed for sun/moon time calculation).

Regards, Jens

nanofortran commented 1 year ago

Jens:

Yeah, pretty sure the timezone in the config file is correct, I have typed in "America/New_York". When I remove this, leaving the field blank, the node defaults back to the server's time in Iceland, when I add it back in I am on EST again. This change takes place after I re-Deploy. However, the sunrise (and other ephemera) are time shifted to that of the server. So, yes, the sunrise is computed correctly for the latitude and longitude, but it is time shifted to the server's timezone.

Thanks,

nf

jensrossbach commented 1 year ago

Problem should be fixed with release 1.18.3. Feel free to re-open the issue if you still encounter problems, thanks.

nanofortran commented 1 year ago

Rock and roll, that looks good. Thank you.