Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting time has 1h offset #26

Closed
Robosoc11 opened this issue Jan 19, 2021 · 7 comments
Closed

Starting time has 1h offset #26

Robosoc11 opened this issue Jan 19, 2021 · 7 comments

Comments

@Robosoc11
Copy link

Robosoc11 commented Jan 19, 2021

Dear Cornelius,

I seem to have troubles with the clock in my system. I am new to Node-RED and your presence-faker and I was just doing initial tests. First I wanted to post, that my presence-faker-node would not send messages - although successfully deployed and enabled. But then I was distracted for a while by a business call, which was good, because 1h hour later I learned, that the presence-faker was doing its job, but with 1h delay. But why ?

image

In the debugging window you see what I find odd: Node-RED is putting the correct timestampt for this message (my local time was 10:17:00 AM when that alert appeared). So I would say that my system is set up correctly. However, as you see within the debug-message the time-window for the faker was set to 09:17 AM thought.

Any recommendations on where to look at or what to do?

As you and I are both from Germany, I do not expect that this is a bug in your code, but rather a wrong setting on my server...But on the other hand since Node-RED uses the correct time, I don't know what to do. Of cause I do know, that I could consider a offset time of 1 hour when setting up the faker, but that seems to be a lousy workaround.

BR, Sven

@csuermann
Copy link
Owner

Hi @Robosoc11,

Could you please share the debug output generated by this simple flow?

[{"id":"bc3d8224.38cea","type":"inject","z":"7ecdfb0b.fa7794","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":810,"y":860,"wires":[["f528217.ce14ae"]]},{"id":"f528217.ce14ae","type":"function","z":"7ecdfb0b.fa7794","name":"now","func":"const now = new Date()\n\nreturn {\n payload: {\n now_utc: now.toISOString(),\n now_local: now.toString()\n }\n};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":970,"y":860,"wires":[["dc36b050.b9127"]]},{"id":"dc36b050.b9127","type":"debug","z":"7ecdfb0b.fa7794","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1130,"y":860,"wires":[]}]

@Robosoc11
Copy link
Author

Thank you for the extrem quick response!
Sure, here it is:

1/19/2021, 12:00:32 PMnode: dc36b050.b9127
msg.payload : Object
object
now_utc: "2021-01-19T11:00:32.101Z"
now_local: "Tue Jan 19 2021 11:00:32 GMT+0000 (Coordinated Universal Time)"

@csuermann
Copy link
Owner

Thanks, I think that confirms my hypothesis of your server setting being set to the UTC timezone

This is the output of the test flow on my system:
image

Is your Node-RED running on the same machine as your browser or a different one?

@Robosoc11
Copy link
Author

Thank you so far.

My NR is running on a linux based Timberwolf server (home automation server) and my browser is on a windows system.
Within the servers time setting there is a page saying following (Server = Timberwolf, client = Windows Browser)
image

@Robosoc11
Copy link
Author

so I guess the mistake may be in the deployment of my Node-Red container process...maybe I need to set some environment differently.

@csuermann
Copy link
Owner

That would be my guess, too. Let me know if you managed to solve it somehow. Could be interesting for others, too.

@Robosoc11
Copy link
Author

Problem solved...
I found the solution in the Timberwolf-Forum, but it my occure on other Docker-Installations as well, so here is what I did:

Duplicate Container with additional ENV-Variable name=TZ value=Europe/Amsterdam
And after deployment I deleted the "old" container...all settings, bindings and panels alived :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants