prankousky
(prankousky)
October 20, 2021, 1:24pm
1
Hi everybody,
can you please help me correct my settings to actually use to local time?
I run a Docker container, where I specified TZ=Europe/Berlin
. On my configuration.yaml
, I also have time_zone: Europe/Berlin
.
However, let’s say I click vacuum.medusa
on my Lovelace Dashboard, it’ll show the device as idle
from some time until 13:22
(which is now, but it is actually 15:22
at the moment).
I changed the TZ value (both for the docker container, as well as in my configuration) to Europe/Amsterdam
, as we share the same current time, thinking that, for some reason Europe/Berlin
was not recognized. This was not the case. After restarting Home Assistant, I still got the wrong time.
The server my docker container runs on will display the correct time when I run date
in the command line. When I run docker exec -it hass /bin/bash
, then anter date
, I also get the correct current time.
So why won’t the frontend work with the correct time?
Thank you in advance for your help
1 Like
AllHailJ
(J Gent)
October 20, 2021, 3:31pm
2
Can you put it in configuration → general and remove it from yaml?
1 Like
prankousky
(prankousky)
October 21, 2021, 10:10am
3
Thank you @AllHailJ
I took it out of the yaml, but still cannot manually edit that part (guess I’ll have to remove other parts as well for this to work).
However! I noticed that this only occurs on my desktop browser! It looks fine when I access the Home Assistant Android App (= displays the correct time).
I get this on my user configuration:
It was 12:07 at the time, but the browser still states 10:07. When I browse there on my phone, it shows the correct time again. My initial thought was that there is something wrong with my local time on the PC, but this is not the case. My system clock shows the correct time, my tmux status bar as well, and the date
command line output also has the correct value. ONLY Home Assistant inside the browser on the PC has the false time.
AllHailJ
(J Gent)
October 21, 2021, 10:32am
4
Can you go here and see what the geolocation is. I am wondering if you have the wrong home lat and long?
freegeoip.net.
Here is how you would setup the lat/long in configuration.yaml
homeassistant:
name: Home
latitude: 32.87336
longitude: 117.22743
elevation: 430
unit_system: metric
here is the basic configuration:
https://www.home-assistant.io/docs/configuration/basic/
I’m having the same problem, have you been able to fix it?
1 Like
tyjtyj
(Justin T.)
October 24, 2021, 10:12am
6
my frontend getting wrong time also… is this 10.6 issue ?
Nick4
(Nick)
October 24, 2021, 10:33am
7
I have this problem too a similar problem on 1 device, an Android system using the companion app.
Everything seems to be correct but from the logbook, events are 2 hours earlier.
prankousky
(prankousky)
October 24, 2021, 10:52am
8
Unfortunately, not yet. Times are fine on mobile, but two hours behind on any desktop browser.
I have had this issue for ages, just never found the time to do anything about it. This did not just start with 10.6
tyjtyj
(Justin T.)
October 24, 2021, 11:35am
9
Seems to be browser problem. I tried Chrome, Edge no issue. Android app is fine too. Only Firefox giving wrong clock
prankousky
(prankousky)
October 24, 2021, 11:49am
10
Thanks for testing those other browsers @tyjtyj
Look at this ; I just tried it (the javascript snippet), and that seems to be the cause!!
I am not going to change my privacy.resistFingerprinting
, but I believe that should do it.
1 Like
tyjtyj
(Justin T.)
October 27, 2021, 2:15am
11
I opened bug report
opened 02:07AM - 27 Oct 21 UTC
bug
### Checklist
- [X] I have updated to the latest available Home Assistant versi… on.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
### Describe the issue you are experiencing
This only applies to firefox(were tested on version 78.15.0esr 64-bit).
Home assistant frontend showing UTC time instead of time set in the home assistant config.
I have checked and verified my home assistant timezone set to +8.
Verified Chrome and HomeAssistant android app shows correct timezone. Also home assistant logs is on correct time zone
On firefox, time shows 8 hours behind
![image](https://user-images.githubusercontent.com/5368474/138987027-8d825bf9-0e72-4150-9c5f-f307eebafcf8.png)
On Chrome. It shows correctly
![image](https://user-images.githubusercontent.com/5368474/138987460-db35f610-edc0-41de-9acb-220a7c332469.png)
There is other user have same issue
https://community.home-assistant.io/t/incorrect-time-in-home-assistant-time-zone-is-set-correctly-though/348630/8
### Describe the behavior you expected
Firefox should shows correct timezone with default setting
### Steps to reproduce the issue
1. Access firefox and chrome
2. Check the history/logs. On firefox will be UTC
3.
...
### What version of Home Assistant Core has the issue?
2021.10.6
### What was the last working version of Home Assistant Core?
not sure.
### In which browser are you experiencing the issue with?
Firefox 78.15.0esr 64-bit
### Which operating system are you using to run this browser?
Windows 10 64bit pro edition
### State of relevant entities
_No response_
### Problem-relevant frontend configuration
_No response_
### Javascript errors shown in your browser console/inspector
_No response_
### Additional information
_No response_
and later found related bug reported
opened 08:02AM - 05 Jul 21 UTC
bug
### Checklist
- [X] I have updated to the latest available Home Assistant versi… on.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
### Describe the issue you are experiencing
Charts are using the timezone of my browser instead of the one I've set in the hass settings.
Because Firefox sets the timezone to UTC to prevent malicious fingerprinting, this makes the charts not very useful. Hass should just use the set timezone.
### Describe the behavior you expected
Expected for timezone to reflect my preferred timezone.
Confirmed that this works as expected in Safari.
### Steps to reproduce the issue
1. Use firefox
2. Take a look at any chart
3. Observe that the timezone is UTC
...
### What version of Home Assistant Core has the issue?
core-2021.6.6
### What was the last working version of Home Assistant Core?
Uncertain
### In which browser are you experiencing the issue with?
Firefox 89.0.2 (64-bit)
### Which operating system are you using to run this browser?
macOS Big Sur (11.4)
### State of relevant entities
_No response_
### Problem-relevant frontend configuration
_No response_
### Javascript errors shown in your browser console/inspector
_No response_
### Additional information
_No response_
opened 12:41PM - 06 Sep 21 UTC
bug
### Checklist
- [X] I have updated to the latest available Home Assistant versi… on.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
### Describe the issue you are experiencing
I have HA and i name it "SERVER" here. Server is on some place in some time zone and has some right set time. I think 99% of HA users has "local" measures, so "kitchen temp" or "garage door" is something **on server place**.
And HA records reality into DB (recorder) with **server** timestamp.
Example:
HA server has "now" time 6. september 2021, 14:00 CET.
User's PC has broken unsynced time for example 6. september 2021 8:00 CET.
And all graphs end not at 14:00 but at 8:00! = BUG. Someone steal me 6 hours of reality! 6 hours missing somewhere.
Tested on Chrome and Edge (chromium edge).
### Describe the behavior you expected
**I think client time cannot affect server times because only server time is correct and event occurred on server place on server time in server time zone.**
So i think right behavior is to show SERVER times on graph.
### Steps to reproduce the issue
1. Go to pc time settings, set time few hours back.
2. Show HA lovelace with some graphs and (hard?) refresh fe.
3.
...
### What version of Home Assistant Core has the issue?
2021.9.3
### What was the last working version of Home Assistant Core?
_No response_
### In which browser are you experiencing the issue with?
_No response_
### Which operating system are you using to run this browser?
_No response_
### State of relevant entities
_No response_
### Problem-relevant frontend configuration
_No response_
### Javascript errors shown in your browser console/inspector
_No response_
### Additional information
_No response_
1 Like
At the risk of doubling up, I’ve opened a bug report too. Useful if others could add any additional detail they have.
opened 11:02AM - 02 Nov 21 UTC
bug
### Checklist
- [X] I have updated to the latest available Home Assistant versi… on.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
### Describe the issue you are experiencing
Since updating to 2021.10.x (now on 2021.10.7) - various browsers attached to my Supervised install have been using UTC rather than local Sydney/Australia time. This has meant that yesterday's weather has been displayed etc.
I have replicated this issue on completely fresh install of Debian & Supervised and looking at the logs or any card dependent on timings (like weather) on Firefox on the host machine. Likewise, pointing my Fire HD10 (2019) at that instance shows this behaviour in both Fully Kiosk and the Companion App.
"Updating" to 2021.9.7 fixes this issue.
The issues do not appear on Chrome or Safari.
As an example of this issue, this is a screenshot of the logs section of Supervisor. You can see that the summary entries are appearing in UTC, while the detailed entries below are in local time. This did not occur prior to 2021.10.x.
(https://user-images.githubusercontent.com/39319760/139831303-deb733d9-d648-498a-ad94-f6260ca7b0b7.png)
### Describe the behavior you expected
I would expect to see a consistent application of local time at the front end of all devices and all browsers, as was the case on 2021.9.7.
### Steps to reproduce the issue
1. Point an impacted browser (Firefox, Amazon Webview based apps etc) at any HA instance from 2021.10.x onwards
2. Check to see whether the front end displays things like the logs, or weather forecasts in local time.
3.
...
### What version of Home Assistant Core has the issue?
2021.10.1 onwards
### What was the last working version of Home Assistant Core?
core-2021.9.7
### In which browser are you experiencing the issue with?
Various - see above
### Which operating system are you using to run this browser?
Debian Bullseye / FireOS in my own testing
### State of relevant entities
```txt
n/a
```
### Problem-relevant frontend configuration
```yaml
No changes made to config.yaml to replicate this issue. Everything left as vanilla as possible to eliminate any other interactions causing the issue. (Only added HACS to get my local weather sensors into the weather card).
```
### Javascript errors shown in your browser console/inspector
```txt
nil
```
### Additional information
Happy to undertake any further testing or turn on debug logging on any device if it helps.
Here is the same screenshot as above, but following a downgrade to 2021.9.7 - you'll see that local time is consistently shown. Obviously it doesn't really matter that these aren't the same - but it is an issue when time critical cards like weather forecasts are displaying UTC rather than the local time.
![Screenshot from 2021-11-02 21-56-57](https://user-images.githubusercontent.com/39319760/139834148-18043a79-be01-4652-bb52-c946dad25966.png)
I’ve made mine broader than just Firefox as I’ve replicated this issue on other devices and browsers. I’ve been told that its a known issue and that the most recent Beta release fixes it - but in my testing the issue persists.
1 Like
This happened to me, but it was getting the time from my vpn connection, not my local computer.
1 Like
jksalvo
January 23, 2023, 6:35am
14
Home Assistant seems to report everything in UTC regardless of selected timezone, which seems to be the case here (since Berlin is +02:00). Wherever you can use templates, you can convert datetime strings to datetime objects and then to your local timezone using as_datetime
and astimezone()
:
{{ as_datetime('DatetimeStringHere').astimezone() }}
Hope this helps!
2 Likes
Tazzios
(Tazzios)
May 31, 2023, 8:17am
15
I use this addon to fix the time:
I could not find an addon where you can choose on which site you want to change the time.
SeaMonster
(David Carrel)
June 28, 2024, 7:54pm
16
Interestingly I just found my Android HA app was using the wrong time zone. I had been travelling, but I am back now and HA was still using the “remote” time zone. I have been back in my “local” tz for several days, and Android definitely picked up the “local” tz as soon as I came out of airplane mode. But HA was still using the “remote” tz. I couldn’t find a way to tell HA to switch. Then I remembered that I had rebooted my phone while travelling, so I tried rebooting again, and that made HA use the “local” tz. It “appears” that the Android app grabs the TZ when it first starts after reboot, but doesn’t later check for changes.