Hi everyone - I wonder if anyone can help me resolve this. I’m a HA newbie so apologies if there is an obvious fix.
Updates from my ESPHome devices appear to come from the future! The dashboard often reports ‘last updated’ time ‘in 1 second’. Is there anyway to fix this?
I have read these:
and tried the recommendations there but no help.
I have HA running on a VirtualBox VM under Win 11. Dashboard viewed in Chrome running on the same Win 11 pc
Taking the following steps still immediately gives ‘in 1 sec’ updates, so this does not feel like a time drift issue:
‘sync time now’ on Windows, even though already set to automatically sync
start VirtualBox and HA (Virtual box claims to sync to host every 10 secs)
run chrony add-on - which reported fixing a 0.002 sec skew
restart ESP device (which is using time: platform: homeassistant)
Not very scientific but comparing the folowing 4 visually:
ESP Time: scrolling log messages with time stamps (from UI on the ESPHome devices’ local webserver)
Windows Time: the Windows clock on the host PC
Internet time: a random ‘web clock’ (clockface online)
HA UI Time: the clock card on the HA dashboard…
It definitely looks like the HA dashboard is a second or so behind all the others, which presumably would explain the issue if this is the same time source as the dashboard uses for its calculation of the age of an update?
Hi Tom, thank you for quick response. Yes I tried that (first step above), but didn’t help. It definitely loks like the latency is with the HA dashboard clock.
It wasn’t clear from your post if you were just referring to the windows machine the VM was running on (which is also a bad choice of OS for a server).
Thanks for replying Nick. Just to be clear, the VM and Browser are running on the same win11 host. And within about 1 minute I synced Windows time, started VM (which syncs VM to Windows I believe) then synced HA with chrony (although I have tried without doing this too), then synced ESP device to HA. And immediately I get the issue, so I don’t believe it is ‘drift’ over time.
It definitely looks like the ‘slowest’ clock is HA dashboard, does it gets its time from HA server? Could there be > 1sec latency in that API?
re: No. The Web Browser gets the time from the system it is running on.
ah OK. I manually moved the system clock forward and sure enough, after a hard page refresh and about 20 seconds the HA dashboard adopted my custom time. So did the other web clock I looked at, very similar behaviour.
However, the HA one was consistently a second behind, so there clearly is some latency somewhere in there - presumably in the HA web frontend - which does tie up to the issue of updates 1 sec in the future.