Adjust time?
-
This is from the Domoticz forum:
At the moment this is used: case I_TIME: //send time in seconds from 1970 with timezone offset { time_t atime = mytime(NULL); struct tm ltime; localtime_r(&atime, <ime); sstr << mktime(<ime); SendCommand(node_id, child_sensor_id, message_type, I_TIME, sstr.str()); } I would expect it to be local time now If your gateway system set to the correct timezone ?Does the serial gateway modify the time before sending it to the nodes/sensors?
-
This is from the Domoticz forum:
At the moment this is used: case I_TIME: //send time in seconds from 1970 with timezone offset { time_t atime = mytime(NULL); struct tm ltime; localtime_r(&atime, <ime); sstr << mktime(<ime); SendCommand(node_id, child_sensor_id, message_type, I_TIME, sstr.str()); } I would expect it to be local time now If your gateway system set to the correct timezone ?Does the serial gateway modify the time before sending it to the nodes/sensors?
@moffen666 said:
Does the serial gateway modify the time before sending it to the nodes/sensors?
UTC is the convention for time sync. UTC-local offset has to be adjusted in the callback function.
(I'm adding this because I had the same issue/request for MYSController: one can choose UTC or local time for sync...) -
-
Thx tekka
Im way in over my head here, but do I adjust the callback function in my Irrigation controller sketch.
The time reported from my sensors in the webUI is correct its only the time on my LCD in the irrigation controller that's off -2h.
Regards
-
@moffen666 said:
Does the serial gateway modify the time before sending it to the nodes/sensors?
UTC is the convention for time sync. UTC-local offset has to be adjusted in the callback function.
(I'm adding this because I had the same issue/request for MYSController: one can choose UTC or local time for sync...)@tekka said:
UTC is the convention for time sync. UTC-local offset has to be adjusted in the callback function.
(I'm adding this because I had the same issue/request for MYSController: one can choose UTC or local time for sync...)I am a little confused and running into the time difference issue. What is the 'standard' for the controller to report time?
-
If we want to be able to use the same (unmodified) sketch all over the world, I'd put my vote for letting the controller sending out local time (time adjusted).
I do it like that in the Vera plugin anyway.
@moffen666 @hek Solved in latest beta of Domoticz thanks to very quick reaction of @GizMoCuz . Domoticz was sending UTC
-
Is there a Domoticz fix for this? Because if it's returning UTC, you cannot use the time correctly through out the year. UTC doesn't have summer and winter time correction. This means that you have to recalibrate the time in your sensor, depening on the current date. In my opinion things like that should be handled by the Home Automation Server. But that's just my opinion ;)
Ow. Responded to quick. Didn't saw the response of @AWI. I second @moffen666 I love the MySensor and Domoticz community