Mark Loveless, aka Simple Nomad, is a researcher and hacker. He frequently speaks at security conferences around the globe, gets quoted in the press, and has a somewhat odd perspective on security in general.

Delving Into Home Assistant

Delving Into Home Assistant

Generated by dreamlike.art.

It only makes sense that I automate things around the house. I mean, I’m already running mail and web services out of my house, so what’s even more work? Now some of you might ask why complicate things further, and truthfully I thought the same thing during parts of the install. There were various points along the way made me want to pull my virtual hair out (I’m bald). So after a bit of research, I opted for Home Assistant, and I’m now all in.

Reasons Why

I had a few reasons why I would do this.

  • Better home OPSEC. I wanted better home security, in that I wanted the home to look like I was inside, even if I wasn’t. Therefore I wanted outside lights to turn on and off as well as shades to open and close at specific times - namely sunset and sunrise - whether I was home or not.

  • Conserve energy. If I could control the lights and other electrically-powered device a bit better, that meant that I could ever-so-slightly improve my electrical usage, as I am quite energy-conscious and trying to be as lean and green as possible.

  • Nerd factor. It’s another thing to geek out over, and I figure that trying to set up various automations as well as manage the infrastructure running it would be quite the learning experience. For those IoT technologies I have that are not “smart” enough to be fully managed, I will have to get creative and that seemed like a great challenge and learning experience.

Choices made

After a bit of online research, it came down to using Home Assistant. I wanted everything to work without Internet dependency and I preferred something open source, and Home Assistant fit the bill. After downloading and playing with the container version, and reading up on the various methods of install, I opted for Home Assistant Supervised. I wanted some of the more advanced features and wanted to be able to use community add-ons (and potentially write my own if needed), but I still wanted some semblance of control over the underlying operating system.

This meant not going for the more traditional route of Raspberry Pi, and setting up a new server. I considered just setting things up inside a VM but I had only one server with the space for that and it is already pulling triple duty running other services. For grins, I ordered a new System76 Meerkat (this is my second, the first one has been running a GitLab instance for NMRC members for a few years now), and elected to wipe and reload the operating system and load up Debian 11 (Bullseye).

For Home Assistant Supervised, Debian is the only “supported” OS, and as every other Linux server or laptop in the house is running Ubuntu, I figure this could be interesting. This turned out to be an understatement.

Server load and difficulties

The Meerkat shipped with PopOS, so I downloaded and set up a USB drive with Debian 11 for the install. Immediately I was shocked by Debian’s website, which was shall we say functional, but looking like it hadn’t gotten a facelift since the mid ‘00s. Wow. The instructions talked about burning the install image onto a CD, but fortunately mentioned one could use a USB stick. Are people still burning boot CDs for Linux installs? Are people still burning CDs period?

After “burning” things to a USB stick and booting up the Meerkat, it promptly dropped me to a bash prompt and seemingly refused to load grub. I spent way too long messing with this, and finally wiped and reloaded the USB stick with the exact same image, and this time it worked and I could start the install.

Guess what else looks like the mid ‘00s? Debian’s installation program. It really was a weird combination of nostalgia and uneasiness dealing with that interface. After the install, I rebooted and logged in via SSH, and basically kind of looked around. This was even more frightening.

Yes, Debian is keeping things patched up security-wise, but there is nothing new or cutting edge running. For example on my laptop I’m running the Linux kernel 6.2.6, on Debian it’s 5.10.0. I understand it is “stable” and all, but wow. Anything in the OS that’s new that I want to use those new features is now out of the question.

Hivemind, sitting atop my other Meerkat - Blackhole.

Hivemind

A good friend of mine came up with a great name for a Home Assistant server - Hivemind. And so once I finally had Debian up and running, I started the Home Assistant install. This also had its problems.

During Home Assistant’s install, things simply froze, which prompted a reboot. The next attempt made it through the install but not long after it was installed, it froze again. A bit of investigation led me to believe that the Meerkat had simply gone to sleep and refused to wake up. So a quick boot and a check of the BIOS at the power settings I could see that it was in some type of power conservation mode. I turned all that off and rebooted. Things seemed fine.

They weren’t. It simply ran longer before freezing. This time I went into Debian itself, and found the place to turn off the settings that conserved batteries, which was interesting as the Meerkat is not a laptop. It is in essence an Intel NUC. Maybe Debian sees it as a laptop, and since it is functioning as a server being accessed remotely, Debian keeps putting it to sleep. This didn’t correct the problem, so I then looked through logs like I should have done originally.

I didn’t realize systemd-sleep was on Debian. I barely remember it even existed, but one systemctl command later, the problem is now corrected. This isn’t on Ubuntu, at least by default, so I wasn’t used to seeing this. And it emphasized an important point - examine the logs first when troubleshooting, particularly on Linux distros you aren’t used to running.

Where Things Are

I have a few integrations loaded up and I’ve been tinkering around with them, and sitting next to me on the table is a pile of Lutron smart switches as well as a Lutron hub. My next steps will involve getting some lights integrated and automated, followed by various shades and blinds. I’ll report progress later on, including the steps I take to secure the setup - including Debian. But so far I am enjoying using Hivemind.

The New Car

The New Car

Fun Friday: Tea Secrets

Fun Friday: Tea Secrets