I just learned how dependent I am on Home Assistant.
Yesterday was a dim day, but we were also away all day so not using electricity. I allowed the hot tub to get up to 100° because I really wanted a soak. I had been driving for hours, going to Costco and back. I’m lucky in that HA actually does the Costco shopping, but I was willing to drive for the privilege.
We had a nice soak, and when we went to bed in the garret there was plenty of charge for the house. When I stumbled back into the house in the morning to make coffee, however, the power had just cut out. What? I don’t know what happened, but I suspect we brought too much stuff back from Costco that had to go in the freezer, so the freezer ran a lot more than average overnight.
I staggered, bleary-eyed, down to the generator and fired it up. It seemed to work for a little while, but then it cut out. Ugh. I let it run a little longer, as every two minutes it would come online for a minute or two and put some charge on the batteries. When I had stable power, I tried to see what was happening, but Home Assistant was offline. I tried turning the server off and on again, but that didn’t work. The generator was still cutting in and out. Fortunately, Solar Assistant was still running. By dialing the generator draw down to 2,500 watts (out of its rated 9,000) I got it to stay stably online. I made coffee, took some up to HA, and life was better.
Then I began to realize what we were missing without Home Assistant. Naturally, our monitor display wasn’t working, but also the car wouldn’t charge, the hot tub wouldn’t start, and the bathroom and kitchen water heaters were offline. Yes, I could bypass Home Assistant manually, but I really wanted my fully-automated system back.
Multiple attempts to restart the server failed. It runs on a Raspberry Pi 5, and in my experience the most failure-prone part of them is the SD card. I couldn’t remember if I had any backups that weren’t also on the SD card, so the first thing I did was make a duplicate of the card on my laptop’s hard disk so that I could recover all the scripts and configuration I’d done if the worst came to pass. It took a long time to copy the 128GB SD card over what I suspect was USB 2. I tried to run fsck on the SD card, but Home Assistant uses squashfs and I wasn’t familiar enough with it to effect a repair. I discovered that I did, in fact, make regular automated backups of my Home Assistant server on my laptop, so I re-installed Home Assistant OS and, sure enough, it offered to restore from backup. It had, interestingly, been one year to the day since I configured Home Assistant, so I guess I can be forgiven for not remembering that I had configured automatic backups.
I started the restore, and it cheerfully told me that the backups were encrypted and I needed the key. I’m fanatic about storing things like keys in my password manager, but there was none there. I was crestfallen. But a search of my hard drive revealed that Home Assistant had created an “emergency kit” file with the key. I copied the key into my password manager, did the restore, and everything seems to be working properly now.
It’s always a good idea to practice restoring from backups — though it would be time-consuming and scary to do so with Home Assistant (I guess buying a second SD card would be the way to go), but I would have been a lot less stressed if I’d successfully completed the project in the past.
—2p