niklaswall / node-red-contrib-light-scheduler

Light Scheduler is a node-red node that provides a weekly schedule mainly focused on controlling light in home automation scenarios.
Apache License 2.0
41 stars 15 forks source link

UTC Time? #22

Closed addd45 closed 5 years ago

addd45 commented 5 years ago

I've seen a few people who have posted about this issue but they all seemed to magically resolve it. I have noticed that the schedule is firing about 6 hours before than the set time, which would be the UTC time, instead of my local time. As far as I know the server has the correct time zone set, since the debug log has the correct timestamps. All the settings for the node are setup correct as well. Am I missing something?

marc-gist commented 5 years ago

you ever solve this?

marc-gist commented 5 years ago

I believe I may have found a solution. I am running node-red-docker, so I needed to add -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro to my docker run command.

niklaswall commented 5 years ago

This is most likely due to badly set clock or time-zone on the server / docker instance.

niklaswall commented 5 years ago

If the docker instance have the correct time the only thing that could cause problems is the latitude and longitude setting as far as I know.

There could of course be some odd corner case that causes issues, so please provide as much problem as possible and i will try to look into it.

/Niklas

Den sön 21 apr. 2019 12:35simonk83 notifications@github.com skrev:

I'm struggling with this as well. It's currently 8:33pm in Australia and pitch black outside. Light Scheduler however is showing as Sun.

I'm running Node-RED in docker and see:

simon@docker:~/docker$ date Sun 21 Apr 20:33:47 AEST 2019

and

simon@docker:~/docker$ sudo docker exec -it nodered bash root@7f2d6e245a82:/usr/src/node-red# date Sun Apr 21 20:34:33 AEST 2019

So as far as I can tell the times etc are set correctly. What else could be causing this?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/niklaswall/node-red-contrib-light-scheduler/issues/22#issuecomment-485241560, or mute the thread https://github.com/notifications/unsubscribe-auth/ADNLZHI2LS4N6AOCBVR4L7LPRQ7QDANCNFSM4GJNNODQ .

simonk83 commented 5 years ago

Hi, Yep there's a huge issue unfortunately, and it's that I'm an idiot :) I was playing with this far too late at night and just read it wrong, your code is fine and I tried to delete the comment but you must have already seen it ;)