Home automation upgrade woes

Most of the Home Assistant updates I’ve installed have gone smoothly, so it was only a matter of time before my luck ran out.

At some point last year, I upgraded the Z-Wave add-on and lost access to my Z-Wave devices. In fact, it appeared that Home Assistant couldn’t even see the USB stick that controls the Z-Wave network. That, of course, should have been a clue, but, since the problem occurred immediately after the update, I naturally assumed that was the cause.

I’d taken a backup of the add-on, through the Home Assistant UI, so I restored the older version. That didn’t fix the problem. In frustration, I rebooted the whole server and, to my surprise, the Z-Wave network started working again. I say it was a surprise, because this isn’t Windows – turning it off and on again shouldn’t be the answer…

I put the upgrade on hold until I had time to investigate it properly.

A few weeks later I tried again, and this time there was a more recent version of Home Assistant itself. I took a complete VM snapshot from the host OS, and took the plunge, upgrading both.

Once again Z-Wave stopped working. Unfortunately, so did Frigate. So, once I again, I restored everything and once again, Z-Wave didn’t start working until I rebooted. Again, not a reboot of the HassOS instance – I had to reboot the actual host machine.

I investigated the Frigate issue and discovered that that a change in the Home Assistant code had broken the custom component for Frigate. A fix was in development but hadn’t been released. I decided to wait until the fix was in the released version of Frigate.

Fast forward a month, and I tried again, having established that the Frigate fix had been released.

Once again, it broke Z-Wave. This time, though, I had time to work through the issue so I didn’t immediately restore my backup. Instead, I started off with a full reboot of the server. As if by magic, the Z-Wave network came back online and everything worked.

Lesson learnt. I’m now almost certain that if I’d rebooted first on my other attempts at upgrading, I wouldn’t have needed to restore my backups. In my defence, all of the previous updates to the Z-Wave add-on had worked without a reboot, so I think I can be excused for jumping to the conclusion that it was the update.

That left Frigate to sort out.

I upgraded the custom component, but then discovered that it needed a later version of the Frigate server, which I’m running as a podman container outside of Home Assistant. I hadn’t touched podman since I set up the server, so it took me a few tries to get the update working, but I got there in the end.

The only problem with the upgrade is that there has been a major change to the way that Frigate operates. Clips from motion detection are no longer stored as individual files. Instead, the motion clips are extracted from continuous recordings. That means that my method for uploading clips to offsite cloud storage no longer works. The solution appears to involve using both the MQTT and HTTP APIs within Frigate to extract the clips. I’ll come back to that in a separate post, because it’s going to take some time to sort out.

There’s one more twist to the tale. Each time I restored my backup, the SmartThings component stopped working and I had to remove it from Home Assistant and set it up again from scratch. That was a pain, because I’d renamed most of the entities, some of which were on the dashboard or used in automations, so I had to go through and rename them every time.

I suspect the SmartThings problem was down to an authorisation token being updated between taking the backup and restoring it, so that the backup was presenting an out of date token. I’m not sure why the SmartThings integration was the only one to fail, as I imagine some of my other integrations use a similar authentication mechanism. I can only assume that the issue is either with the way the integration is coded or with the SmartThings platform itself.

My experience suggests that if there’s an issue with two potential causes, one of which is SmartThings, then the cause is SmartThings.

So far, so anecdotal. What lessons can I share from this story?

First of all, always read the release notes when upgrading Home Assistant, paying particular attention to the breaking changes.

Secondly, if you’re using custom components that are not part of the core Home Assistant installation, expect to have the occasional problem. It’s reasonable to assume that the integrations that are part of Home Assistant itself will continue to work, give or take documented breaking changes, but there are no guarantees when you’re using third party custom code.

Finally, make sure you give yourself time to upgrade. I’d become complacent after a series of painless upgrades, so I hit the update button and assumed all would be well. I didn’t have time to troubleshoot, so I restored my backup instead.

I should stress that I’m not criticising Home Assistant. Problems with updates are rare, especially with the core components. Any update of any code can introduce problems – who hasn’t experienced issues with Windows updates, or Android updates, or with individual apps on their phone? Home Assistant is a large codebase, with complex integrations to many external services, so it’s hardly surprising that there will be an occasional glitch.

So don’t let this story put you off trying Home Assistant if you don’t already use it. It’s still a great system, and 99% of the time upgrades are completely painless.

in Home Automation

Add a Comment

Your email address will not be published. All comments will be reviewed.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts