Using Homebridge to automate with Apple Home

Automating your home can be expensive. Automating it with Apple can be stupidly so.

Using Homebridge to automate with Apple Home

Automating your home can be expensive. Automating it with Apple can be stupidly so. Some things are worth paying for, but 'works with Homekit' is often equivalent to 'You're an Apple customer, so let's add a zero to that".

The average Apple customer...

It doesn't have to be that way, though, as a ton of things can be controlled by Homebridge, including a cheap sensor-suite which can be built using Zigbee sensors with MQTT (Free as in speech), a Pi Zero (<£10) and the CC2531 from Texas Instruments (~£5).

Homebridge has over 2000 plugins to connect things to Apple Home, comes with a web-based GUI and is super easy to set up and use. It's available as a docker container, or as a Pi image so you can get started quickly and easily.

The Zigbee world is on fire right now, and you'd be amazed how much stuff the CC2531 can control. The Xiomi, Ikea and even Hue ecosystems all say they need a hub, when actually they just need a Zigbee Coordinator. The CC2351 is a great, cheap bit of kit, and certainly helps fill the gaps in the 'cheap sensor' space when automating with Apple. They can be daisy-chained for better coverage, too!

So, here are my home devices. Every single one of these is connected to my Apple Home, either Directly via Homekit integration, via Homebridge(HB) plugin, or via Homebridge using Zigbee(Z). We have:

  • Hive heating and hot water (Direct)
  • Hue lighting everywhere (Direct)
  • 2 x Eufy 2K cameras, one looking out, one in the lounge (Direct)
  • Ring Doorbell, with chimes upstairs and Down (HB)
  • Harmony Remote+Hub for TV Control (HB)
  • Sonos Beam Soundbar (HB)
  • Sonoff BASICR2  switch for the garden lights (via WeLink) (HB)
  • 4 x AOZBZ Wireless Switch for the Kitchen and Conservatory (HB)
  • 8 x Teckin Wifi Plugs controlling all sorts of things (HB)
  • XiaoMi MiJia Light Sensor in the front window (Z)
  • Ikea Tradfri Motion Sensor in the Lounge (Z)
  • Sonoff SNZB-03 Motion Sensor in the upstairs hallway (Z)
  • Sonoff SNZB-04 Door Sensor on the under-stair cupboard door (Z)

Phew, That's the first time I've written that down, I have a lot of gadgets in my house! What do they all do?

Well, first-off Homekit is location-aware, so there's an action that turns everything (except the slow-cooker!) off when the house is empty.

Lighting: Every room has colour bulbs, some have the antique-looking ones. Some rooms have classic bulbs controlled by Zigbee switches. The garden has a string of lights plugged into the mains (though powered by a wifi switch cut-and-pasted into the wire).
There are a bunch of Hue Buttons, some which work through Hue to automate room lights, some which are Zigbee'd into Homekit to automate other things. This is a hangover from a previous version of home automation which ran with HomeAssistant and NodeRed, but it turns out Homekit can respond to button presses via Hue, so these will be moved back onto the Hue hub eventually, mainly because it makes them easier to update. Pro-Tip: Use Shortcuts to enable toggling of lights controlled by on/off wifi switches

Heating: I've been playing with Hive, here's the kicker. While you can ask Siri to control the temperature, Homekit can't control the hot water 😭. This isn't something I do often though, nor do I really need to automate it outside of the Hive app, but because of this I'm looking at a replacement maybe with Tado this winter.

Motion and Light Sensors: I have automations to turn on the lights when we're in and it gets dark, and during the darkest periods when motion is detected. These are simple and effective.
The cupboard under the stairs has a light that comes on/off depending on the door.
Pro-Tip: Automation based on multiple triggers and values is sometimes impossible in the Home app. You may need to use something like Eve For Homekit(free) to make them work properly.

Audio/Video: Apple already does a good job via Airplay, but to control the TV I linked up my Harmony Hub/Remote with Homekit via Homebridge. Pro-Tip: If you have a very very simple setup, like me, this works easily

Plugs and switches: On and Off, that's all they do and they do it well.

I will follow up with a post about setting all this up, but it's pretty simple if you follow the links above :)