-
Notifications
You must be signed in to change notification settings - Fork 12
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
location with TZ Europe/Amsterdam one calculation one hour off #1
Comments
Hi Johan,
What time zone are you in? The data suggests that you have a
,"timezone":60 60 min offset added to your timezone - change that to 0
and you should be back on track with the values.
Mat Zolnierczyk
Maker, Robotics Engineer
Owner | NotEnoughTech
***@***.***
notenoughtech.com
Teesside, North Yorkshire, UK
[image: facebook] <https://www.facebook.com/NotEnoughTECH/>
[image: twitter] <https://twitter.com/NotEnoughTECH>
[image: linkedin] <https://www.linkedin.com/in/mat-zolnierczyk/>
[image: instagram] <https://www.instagram.com/notenoughtech/>
…On Thu, Jan 6, 2022 at 9:42 AM westerduin3451 ***@***.***> wrote:
Hi Mat,
thanks for your work, it helps me a lot with my home automation.
At the moment I am struggling with your project "Tracking daylight in
NodeRED".
My setup is Home Assistant (Hassio) with the node-red add-on.
When I entre my coordinates and enable timezone the daylight tracker
calculation of day and night is one hour off?
SunSet/SunRise info:
{"sunrise":"2022-01-06T08:45:03.000Z"
,"noon":"2022-01-06T12:45:45.000Z"
,"sunset":"2022-01-06T16:46:27.000Z",
"day_lenght":{"in_sec":28884,"in_hhmmss":"08h 01min"}
,"civil_twiligh_start":"2022-01-06T08:07:00.000Z"
,"civil_twiligh_stop":"2022-01-06T17:24:30.000Z"
,"nautical_twilight_start":"2022-01-06T07:23:44.000Z"
,"nautical_twilight_stop":"2022-01-06T18:07:46.000Z"
,"astronomical_twilight_start":"2022-01-06T06:42:44.000Z"
,"astronomical_twilight_stop":"2022-01-06T18:48:47.000Z"
,"timezone":60}
This information seems right/ok.
But the daylight tracker is one hour off / late?.
Did I do something wrong?
Do you have any suggestions, on how I can fix this?
Thanks in advance.
Regards Johan
—
Reply to this email directly, view it on GitHub
<#1>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDRL224FWCYZLUOZS2IQ23UUVPZLANCNFSM5LL5PSLQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi Mat, thanks for the quick response. |
Hi Johan, In the setting node (On Start) you should have the |
Hi Mat, The date and time of the Pi I am running shows correct date and time var latitude = "52.10743999864968"; flow.set("timezone", timezone); |
Both values in the tracker report the time in seconds node.warn(timeNow); You can use these to get the live output but looking at the payloads in debug - all seems to be fine - the most you should get is a delay of 1 min caused by the interval update |
Hmm 06/01/2022, 11:59:21node: Is it night time yet? |
code of "is it night time yet?" var time = global.get("Time"); var sunrise = time.sunrise; var now = new Date(); //from sunrise to sunset //from sunset to sunrise node.warn(timeNow); return msg; |
The debug values will show you current (in this case) time and sunrise time - obviously sunrise time will be the same for 24h period |
Sorry Mat, |
Don't worry about it. I have my silly moments about 20 times a day :)
…On Thu, 6 Jan 2022, 13:09 westerduin3451, ***@***.***> wrote:
Sorry Mat,
I have no idea what I was thinking silly of me ;-)
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDRL2YKLS6MI7WC3DXCJ2DUUWH73ANCNFSM5LL5PSLQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
OK it's 17:02 and it's still daytime, should it not be night time? 06/01/2022, 17:02:20node: 819883bf552b1c33 |
What the wanr messages say on your end ?
…On Thu, 6 Jan 2022, 16:07 westerduin3451, ***@***.***> wrote:
OK it's 17:02 and it's still daytime, should it not be night time?
06/01/2022, 17:02:20node: 819883bf552b1c33
msg.payload : string[41]
"According to my calculations it's daytime"
06/01/2022, 17:02:46node: 0de22e8d93416a14
msg.payload : Object
object
sunrise: "2022-01-06T08:45:03.000Z"
noon: "2022-01-06T12:45:45.000Z"
sunset: "2022-01-06T16:46:27.000Z"
day_lenght: object
civil_twiligh_start: "2022-01-06T08:07:00.000Z"
civil_twiligh_stop: "2022-01-06T17:24:30.000Z"
nautical_twilight_start: "2022-01-06T07:23:44.000Z"
nautical_twilight_stop: "2022-01-06T18:07:46.000Z"
astronomical_twilight_start: "2022-01-06T06:42:44.000Z"
astronomical_twilight_stop: "2022-01-06T18:48:47.000Z"
timezone: 60
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDRL24RHD5QAMC34SJIQBTUUW42RANCNFSM5LL5PSLQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
here are the warn msg node.warn(timeNow); 06/01/2022, 17:02:09node: 819883bf552b1c33 |
according to your flow the time in node.warn(timeNow); = 1641484940068
which is Thu Jan 06 2022 16:02:20 - before the sunset - please check your
RPI or whatever is hosting your NodeRED timezone and current time
Mat Zolnierczyk
Maker, Robotics Engineer
Owner | NotEnoughTech
***@***.***
notenoughtech.com
Teesside, North Yorkshire, UK
[image: facebook] <https://www.facebook.com/NotEnoughTECH/>
[image: twitter] <https://twitter.com/NotEnoughTECH>
[image: linkedin] <https://www.linkedin.com/in/mat-zolnierczyk/>
[image: instagram] <https://www.instagram.com/notenoughtech/>
…On Thu, Jan 6, 2022 at 4:15 PM westerduin3451 ***@***.***> wrote:
here are the warn msg
node.warn(timeNow);
node.warn(new Date(sunrise).getTime())
node.warn(new Date(sunset).getTime())
06/01/2022, 17:02:09node: 819883bf552b1c33
msg.payload : string[41]
"According to my calculations it's daytime"
06/01/2022, 17:02:20node: Is it night time yet?
function : (warn)
1641484940068
06/01/2022, 17:02:20node: Is it night time yet?
function : (warn)
1641458703000
06/01/2022, 17:02:20node: Is it night time yet?
function : (warn)
1641487587000
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDRL265ZRHA5K2LFAQGI63UUW5Z3ANCNFSM5LL5PSLQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Checked the timezone of the pi and it was correct. Thanks for your help Mat. |
I'll add this info to the write up thanks for letting me know
…On Sun, 9 Jan 2022, 09:57 westerduin3451, ***@***.***> wrote:
Checked the timezone of the pi and it was correct.
Found out that you have to specify a timezone in the config files of node
red as well.
Also set timezone On Start to false and it works.
Thanks for your help Mat.
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDRL2YNCSNBBFMYWAY4HO3UVFL2NANCNFSM5LL5PSLQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi Mat,
thanks for your work, it helps me a lot with my home automation.
At the moment I am struggling with your project "Tracking daylight in NodeRED".
My setup is Home Assistant (Hassio) with the node-red add-on.
When I entre my coordinates and enable timezone the daylight tracker calculation of day and night is one hour off?
SunSet/SunRise info:
{"sunrise":"2022-01-06T08:45:03.000Z"
,"noon":"2022-01-06T12:45:45.000Z"
,"sunset":"2022-01-06T16:46:27.000Z",
"day_lenght":{"in_sec":28884,"in_hhmmss":"08h 01min"}
,"civil_twiligh_start":"2022-01-06T08:07:00.000Z"
,"civil_twiligh_stop":"2022-01-06T17:24:30.000Z"
,"nautical_twilight_start":"2022-01-06T07:23:44.000Z"
,"nautical_twilight_stop":"2022-01-06T18:07:46.000Z"
,"astronomical_twilight_start":"2022-01-06T06:42:44.000Z"
,"astronomical_twilight_stop":"2022-01-06T18:48:47.000Z"
,"timezone":60}
This information seems right/ok.
But the daylight tracker is one hour off / late?.
Did I do something wrong?
Do you have any suggestions, on how I can fix this?
Thanks in advance.
Regards Johan
The text was updated successfully, but these errors were encountered: