Date and Time of Hass.OS very old in Raspberry Pi 3B (solved)

Hi there,

until HA OS 9.4 everything was fine on my Raspi 3B. Automations are fine, ….
Since HA OS 9.5 the date is set to July 2022 and time ist also wrong.
Reboot doesn’t fix it.
configuration.yaml hat folgendes:

homeassistant:
  currency: EUR
  name: homeassistant
  latitude: 53.51xxxx
  longitude: 9.67xxxx
  time_zone: Europe/Berlin

My automations doesn’t work since HA OS 9.5. So I try to find and my wife told me that lights goes on at night instead of 4PM.
I checked in Terminal (screenshot) and my Raspber6ry Pi3B ist in July 2022, but we have February 2023.

Anybody any ideas?

Is your HA connected to the Internet? Any restriction to access an external ntp server?

Take a look at this discussion as it looks quite similar to the issue you are reporting. Note that they fixed basically disabling the settings via yaml and doing it via UI, as I understood:

Hi Edward,
until HA OS 9.4 everithing fine, starting HA OS 9.5 update date on RPi3B was middle 2022.
NTP Setting not visible in HA OS.
But I found the request on “tome.cloudflare.com” in my pihole and cloudflare was blocked. I enable time.cloudflare.com and reboot my RPi. Everything fine date & time are OK.

cu

1 Like

I am having the same symptoms. Also RPi3B and the issue showed up after the HA OS 9.5 update.

I’m not using pihole so no blocked NTP requests that I’m aware of.

The time issue eventually resolved over night, based on log messages I think it was about 2-3 hours after the reboot. But the issue reappears after a subsequent reboot.

Have you tried to ping time.cloudflare.com from command line in the terminal?
I use the Add-On Terminal&SSH.
type in “ping time.cloudflare.com
If that works, your HA have access to the NTP server.

2023-02-02 10_09_36-Terminal – Home Assistant

On my side it was blocked by pihole, do you use routing or firewall in your network?

1 Like

Well now I can’t reproduce, date seems fine after a system reboot, and no problems pinging the NTP server. Earlier yesterday I was concerned maybe it was an issue with my modem/router so I also rebooted that. If I see this again I’ll try pinging the NTP server right away. Thanks.

I gotta write about my very similar symptoms but very different root causes.

Unifi running with the same settings for a year.
PiHole running with the same settings for a year.
HAOS on Raspberry Pi settings related to this not changed either. Been running perfectly for 3 years.

All of a sudden, like 2 weeks ago when it started getting darker here in the north I noticed the absolute times for lamps was getting off. Also for bedtime routines etc. Noticed when I activated a sensor it reported “36 minutes ago”.

Checked in the SSH-terminal addon with “date” and the Raspberry Pi system time was off by exactly 36 minutes. Tried to turn it off for 10 minutes and when booted up again it was about 46 minutes off. Implying it could not access any NTP server.

So I thought the PiHole was the problem - checked the logs in PiHole - all good and the cloudflare messages were passed through PiHole from/to my Raspberry Pi like anything else. Looked good several full reboots of the raspberry pi except the Pi would never update its old cached time.

Then before trying the chrony addon I looked in my Unifi Network NTP settings - not much to change there except I could turn off the NTP server hosted by my Unifi Gateway/router. So I turned off the local DHCP NTP server. And at boot the Pi started updating its system time ok.

Not sure what else on my network I have screwed up by turning off the Unifi NTP server that has been running the same for years… Latest possible changes are the HA Core but that was some weeks ago… don’t think that should affect it?

Anyways, these are the differences seen by PiHole between a local NTP on and with it turned off:

when the Unifi NTP server was on (like it had been for many years) but Rpi didnt update its time:
time.cloudflare.com fivepi.localdomain OK (answered by 1.1.1.1#53)

after I had disabled the Unifi NTP server and Rpi started updating its time:
time.cloudflare.com fivepi.localdomain OK (answered by 1.0.0.1#53)

So it looks like the local NTP was wrong but it hasn’t been changed for years… or ever. So it’s very hard to understand the actual root cause.