gcobb321 / icloud3

iCloud3 v3 - iCloud3 is an advanced iDevice tracker that uses Apple iCloud account and HA Companion App data for presence detection and location based automations.
MIT License
577 stars 55 forks source link

Confused over timezone #395

Closed sion-roberts closed 2 days ago

sion-roberts commented 3 days ago

I am seeing that my sensors are all reporting time as GMT (UK time). I am in the USA EST, so these are all 5 hours ahead. Log timestamp is my local time as expected. See pic.

(I should say that originally my system was located in the UK, then I moved - I guess it's to do with this somehow ??). I can't see where I can change this.

image

gcobb321 commented 3 days ago

Click your initials in the circle at the bottom of the HA sidebar to go into the HA settings. If you can not see that, Google Home Assistant settings to find something in the Home Assistant docs

sion-roberts commented 3 days ago

Hi Gary. I appreciate the rapid answer, and for the excellent integration. It isn't a display issue. The entries being logged are logged as being in a different timezone, which they are not. If you look at the image in this email, the timestamp in the top right is the HA timestamp and the correct time that the update happened in my local time. So that's good. BUT the integration's entries for this device (in the middle of the screen), all show 5 hours in the future - i.e. the current time in the UK. As I mentioned before, I originally built this system when I lived in the UK. I believe I've changed every setting, but somehow these are being logged in a way I'm not expecting. Any clues ? Thanks in advance.

image

gcobb321 commented 3 days ago

All times in iCloud3 are kept in utc time and adjusted for the local time zone when they are displayed by adding/subtracting a tz offset. The local time is provided by HA/Python modules. The offset is displayed in the Event Log when it starts (Stage 1). There must be some other timezone value at a low level, which I can not help you with.

There is a feature in iCloud3 for adjusting the time zone if you are on vacation in another tz. You could use that, I suppose, to make your own adjustment to the time your system thinks it is. Go to Configure Settings > Away Time Zone

sion-roberts commented 2 days ago

OMG. Most stupid oversight on my part. It uses the TZ from the computer itself and not HA. Hadn't realised that the Linux host itself was still on UK time. My very bad !!