There are posts going back five years or more about issues relating the system time after a power failure… If internet is not available when Home Assistant boots, automations turn on/off at the wrong times endlessly… Right now, for example, my backups say the next backup will happen “today at 1:00 am”, which was 12 hours ago… No backup happened. The system doesn’t seem to know what time it is. And this isn’t new.
Now I realize people say you can add an add-on called “chrony” to solve this, but I don’t feel that the developers should be let off the hook that easy. This is a home automation platform, and one of the most basic things it’s designed to do is run automations based on what time it is. This is “Automation 101”, and the fact that a fix for this isn’t baked right in, is unacceptable.
The developers need to ensure that a platform that does things based on time, knows what time it is. Nothing makes a spouse hate your automations more than lights coming on when your sleeping, or all of them going off while you’re watching TV.
Even more basic and why it’s usually not a problem is to have your router or firewall provide a standard time for your sub-net. Then when your devices get DNS info, it has NTP info also. If you are for whatever reason using someone else’s router and can’t configure that, Chrony can supply that function as well as other methods.
Right, but if the internet is down when Home Assistant boots, it simply never updates the correct time. And since one of the most popular methods to run HA on is a Raspberry Pi, your time is dead in the water if the internet is down on boot.
I think it’s known that it’s consequence of using rpi that does not have real time clock.
But… if Chrony is NTP server only then I assume that it would be enough to have ntp within HAOS, right?
It still would not survive rpi restart, so wouldn’t Chrony.
If so, why devs are against that?
Anyway the bullet proof solution is to have router with NTP, right?
Correct. Which is why I’m somewhat annoyed and short on this one. It’s an automation platform, for God’s sake. Setting the time is basic stuff. Yet when you mention it, you’re directed to some third party add-on like you’re weird or something. LOL
Which would still loose time if restarted assuming the internet NTP reference is missing.
The gain with an add-on is it is still running when you restart HA and is less likely to loose the time.
That’s the advantage. Completely lost if HA itself is storing the time.
If you want better than that, you need hardware with a battery (Like a real computer or something).
I’m a simple guy. What I know is that there is a “Home Assistant OS”, much like my Linux or Windows machine. It’s downloadable from the HA website, an “Operating System”, and one of the preferred ways that is recommended to run the HA container.
Just like my other computers, it can simply send an NTP request periodically and set the time. Like my laptops do, like my home automation hubs do, etc… This isn’t overly complicated, and it seems like nobody wants to tackle it simply because “there is an add-on available”.
If the teeny-weenie OS on a cheap Chinese camera can periodically ask the network, “Hey what time is it”, why can’t my super-duper advanced home automation platform do the same thing?
I haven’t seen an acceptable answer to that except, “well, there’s an add-on”…
There is no clock in the default dashboard, and I have not found the current time shown anywhere in the settings (other than logging).
I am not even sure at this point, how the time was even originally set.
It would make sense to me that the current time/date should be shown in the settings, and provided NTP connection configuration and interval options.
edit:
exploring a little bit, I found @ Time & Date - Home Assistant which just provides a sensor which I guess can be used in dashboard etc.
also @ Troubleshooting installation problems - Home Assistant which specifically states that time will be acquired on startup, but does not indicate that time is/can be checked or set at any point after, whether automatically or manually.
there does not appear to be much else in the support pages about time or ntp
It isn’t a problem… unless people block the ntp server that HA tries to use, block access to the repository where HA can get the latest version, etc. Time would also not be a problem if your hardware has a RTC. And the time is crucial if HA needs to use an SSL protected resource. And it does. So comparing it to a camera that does not care if its firmware is Chinese old crap and does not care about the right time is not exactly fair.
Not to mention, the NTP package is already written, free and open source, and runs on the platform Home Assistant OS is using.
It’s just lazy. Don’t get me wrong. I’m a huge fan, a paid subscriber, and I love the work that goes into this. But a huge part of getting your family on board with automation when it’s not typically “their thing”, is not have the kitchen lights go off for no reason while in the middle of cooking dinner. Simply because the power blinked the day before.