/ Adam's Pile of Hacks / blog

My home automation project is a fucking disaster

August 27, 2021

This article hasn’t quite gone where I wanted it to, but should serve as a warning to others. Maybe I’ll update it as I continue to learn the hard way.

Siri’s just turned my kitchen lights red. I can’t really blame her, it does match my mood. I didn’t ask her to do it, but she thinks she’s talking to some premium light bulbs, so it’s probably my fault.

LIFX

I guess I was a pretty early adopter of LIFX smart lights. The ones I have are either first or second generation multicoloured things. The novelty of changing colours wears off pretty quickly, but being able to turn my lights on and off without transferring between bed and my wheelchair was a pretty big deal. A friend did once tell me to “just get a Clapper, dude”. I probably should have listened.

It Just Works

I switched from Android to iOS after getting sick of Samsung, and while HomeKit and Apple’s home automation can work reasonably well, you have to be all the way in their ecosystem. So I bought a HomePod Mini, too. Actually, two of them. Now, every Apple user I’ve spoken to says this shouldn’t happen, but sometimes when I ask the HomePod to do something, my phone will answer, or vice-versa. At a certain point you realise whispering to your phone so that your other voice assistant won’t hear you is batshit crazy.

“It Just Works”, for certain definitions of “It”, “Just” and “Works”

I couldn’t find my lights in Apple’s Home app, and started looking for answers. The LIFX app worked well on my new iPhone and even offered to add Siri shortcuts.

This brings me back to my intro: because I have an “early” version of LIFX, they lack the chip Apple requires for HomeKit. I’d have to replace 4x$60+ lightbulbs if I wanted it to “just work”.

What about Android and Google?

I used Android and a Google Home voice assistant for a long time, too. The Google Home is still sitting on my bench, gathering dust.

Have a look at the documentation for setting up Google Assistant to work with Home Assistant. You have to create an entire Google Cloud project for it. I can forgive the upsell to Home Assistant Cloud ($5USD/month) here after following the full tutorial. The Google Cloud project and the “test” Assistant Skill are probably still running somewhere on my account at this point. You’re tying your voice commands to Google’s API, which has already changed since Home Assistant started working with it. Yes, you’re also making this tradeoff with Siri, or Alexa. Yes, I also know about mycroft and wish them the best.

Home Assistant

At some point I found Home Assistant. I can’t actually remember the impetus for setting it up, all I know now is that it’s a load-bearing Python application now. I should love this software, it ticks all of the boxes I normally look for: open source, huge amount of plugins, massively configurable. My friend set up the Docker version and hasn’t touched it since. I didn’t. I probably should have listened.

Home Assistant has a pretty good integration for HomeKit - it made my lights turn up in the Apple Home app and pretty much work as expected. I have to give Apple credit for this - they pop up a warning that I’m not using a supported accessory, but other than that they seem to allow everything to work, even features like the HomePod allowing remote access to devices over the Internet.

Because for some reason I’m unable to do the maths between spending $240 versus thousands and thousands of dollars of my time, I was pretty happy with this.

Seeing Infra-red

My first (infra)red-flag should have come when I needed to use an exploit to change the firmware on a $20 IR blaster. tuya-convert is actually pretty cool: it sets up a wifi network which Tuya-based IOT devices use, then reconfigures and re-flashes the firmware with something called Tasmota.

What I should have remembered is that when you’re relying on an exploit, just like when you’re relying on a jailbreak or rooting your phone, you’re also relying on something that the company involved would like to fix (you’d hope). Tuya did, and now when you buy a $20 IR blaster from K-Mart, you might get one that you need to open up and solder to re-flash.

MQTT

MQTT is a protocol for sending messages between Internet of Things devices and a server (broker). “Internet of Things” was coined by someone at Procter&Gamble in 1999, around the same time as IBM was creating the first version of MQTT, but I don’t think the two were connected yet.

Many years later, I’m sitting here wondering why the fuck my air conditioner won’t turn on and why all of the IR blasters are suddenly blinking at me. MQTT has gone down but Home Assistant thinks everything is fine. Everything is not fine.

At some point in the last two years, Aurynn Shaw introduced me to the term recreational sysadmin. It shouldn’t bother me so much, I run ZFS and OpenWRT for fuck’s sake. But at the point where I was looking at serious business monitoring tools to work out why my air conditioner wasn’t turning on, I started thinking about how I ended up here and what I was actually trying to do.

I could definitely write another article on some of the design decisions that Home Assistant have made as a community - but not including and monitoring an MQTT server, even as an optional download is the one that’s really biting me at the moment.

Air conditioners and air strikes

Ha ha! Business!

Before all this, I’d actually bought a Sensibo ($150) smart device. This is an ESP8266 ($5) based wifi thing that uses a USB charger ($1) and an (admittedly slick) IR blaster to make the temperature in your lounge room reliant on AWS’s us-east-1. Apparently they’re quite successful now. I installed the app, which had improved a fair bit, then it popped up an offer to subscribe to some premium air-conditioner-on-off service for a monthly fee. I uninstalled the app.

How smart?

When I was looking for a new air conditioner, the salesperson touted smart features - funnily enough this wasn’t a major selling point because I figured I’d just use another IR blaster to control it, or even… the normal remote! When I got the air conditioner, there was a “wifi” button on the remote but it didn’t seem to do anything. When I looked into it, it seemed like Fujitsu didn’t sell that module for my system, or maybe not in Australia at all. They did, however, sell ($100+) an ESP8266 ($5) module to make the temperature in my bedroom reliant on… oh you get the point. No subscription this time, but the app also didn’t work well and the Tasmota IR stuff I was using didn’t support that particular remote. I kept using the normal remote. At the time of writing Tasmota does support that remote now, but for some reason if I set the temperature in half degrees, it won’t work (despite the real remote working in half degrees).

Zigbee

One of the few things I am reasonably happy with is the temperature sensors I have placed around my house - they let me find out that the bedroom was dropping to a far lower temperature overnight than I thought, possibly contributing to some health issues I was having (see also, the purchase of the new reverse-cycle air conditioner above). The temperature sensors I ended up choosing were Xiaomi Aqara. They’re powered off a coin cell battery, have adhesive backing so you just stick them anywhere and pair with… Xiaomi’s gateway and app. Now, Xiaomi’s wifi to Zigbee gateway is theoretically fine, but last I checked the features of the app changed if you selected China vs anywhere else as your location. I think I even ended up with a Chinese gateway - amusingly it had a speaker and could play Internet radio, except I could only get it to play something that sounded distinctly state-sponsored, in Mandarin.

The way to use the Zigbee temperature sensors with your own software is to use another “cheap” dongle - TI’s CC2531, which is an often cloned radio board using an (ancient but ubiquitous Intel chip)[https://en.wikipedia.org/wiki/Intel_8051] that can be pressed into service as a Zigbee “router”. Zigbee is theoretically a standard, and like any good standard there’s a hundred different incompatible implementations. Luckily the firmware I was looking at can speak Xiaomi’s dialect. So, I ticked the box on the website that said I totally wasn’t going to use my AliExpress knockoff board to launch an air strike (thanks US ITAR!) downloaded TI’s SDK and fiddled with the annoyingly tiny connector to flash the dongle. I think I spent $200 (multiple programming kits, including a genuine Texas Instruments one) and a fair few hours trying to save $50 (Conbee 2), this time.

Even if this all works, you need to choose some software to make it all work (publish temperature messages to MQTT in my case). I installed yet another copy of NodeJS and chose Zigbee2Mqtt. What was I trying to do again? Why is it so dark and cold in here?

An unfinished project

I don’t really have a coherent “end” to this article, hell, I’m writing this after I’ve published and tweeted about it. A lot of the time when I’m thinking about home automation, I’m thinking about accessibility - remember, the less I have to transfer in and out of my wheelchair, the better. I really have to wonder if this situation improves. My email client tells me it’s been 5 years, 1 month since I got a confirmation of my order of four LIFX bulbs, and things have gotten worse since then. What about the people without the time, money and stubbornness that I’ve put into this? Maybe they’ll buy a Clapper, instead.