Set date + time without internet

TL;DR: How do I set the time/date without an internet connection?

We’ve recently moved house and don’t yet have broadband.

Home Assistant seems to work happily, but all the automations, statistics, etc. are running on the wrong time.

I can’t see any way to set the real time/date in the UI and attempting to SSH in and set using date gives a permission error (because I’m not actually ROOT on the host operating system?)

I’m using a Pi4 with HAOS.

1 Like

If you’re going to be without broadband for a while, you might consider mobile broadband as a backup. You can get a basic router for around £50.

If you want to do anything with it (streaming etc) you’ll need a decent 4G signal. If all you want is the time, 3G is fine.

For anyone finding this in the future…

I ended up installing chrony on another system on the network and setting DHCP to offer this NTP server.
For bonus points I used a USB GPS receiver to get / keep accurate time without an internet connection.
HA picked this up after a reboot and all is now correctly (and not 8 months ago)

I still think being able to set the time manually is a very important feature - especially for installs using the image on things like Raspberry Pis, which don’t have their own clock.

1 Like

i’ll necro this topic as i have had the exact issue of no internet.

lost power and internet follwing weather event, power came back in hours (plus i do have backup so not an issue), but internet took days (cell coverage was down as well).

so my rpi4 with HA was useless as there is NO MEANS to manually set time & date!!!
that’s a MASSIVE issue.

the reason i went with HA is BECAUSE it’s self hosted, thus do not NEED internet!
but it actually DOES.

so i’ll ask again, HOW to manually set date & time without connecting to internet, as “date” command in SSH returns “operation not permitted”?

a lot of automation are time based, this is mandatory to have correct enought time so there shall be a way to SET it