Hey Siri, open the garage door
December 17, 2022•773 words
I went smart garage door shopping a little while ago. After looking around at the options, I settled on the Chamberlain Smart Garage Control.
But wait, Mattie! You're deep, and I mean deep, into the Apple ecosystem. This ain't a HomeKit deal.
And I'm in it for good reason. I mean, I was chomping at the bit for my HomePods to get upgraded to audioOS 16.2 so that I could get into Advanced Data Protection as soon as possible. End-to-end all the things!
But the Smart Garage Control had a few things going for it.
It supported Amazon Key for in-garage delivery out of the box.
It didn't require me to connect anything to anything. It acts like another garage door remote.
All I had to do to install it was stick a sensor on the door with sticky Velcro so that it could tell when the door was open and when it was closed. Everything else was just plug this in here, set this thing there.
It was $20. 🤑
I'm pretty dang happy about that. The app is… well, functional. I guess.
Chamberlain used to sell a bridge for HomeKit. It was the cost of 3½ Smart Garage Controls.
But I had another option: hook it up to Homebridge.
My last foray with the delightful Homebridge project was when I ran it on a now-busted first-gen Raspberry Pi so I could talk to some Wemo Mini Smart Plugs that had spontaneously decided they no longer spoke HomeKit. Homebridge got me talking to them again.
Eventually, I replaced all those plugs with Meross Smart Wi-Fi Plug Minis. They're a little finicky to get set up, but they still work, and not as an afterthought. So I decommissioned Homebridge and moved on.
Fast-forward to today, and my desire to ask Siri to open the garage for me. I no longer have a Pi, but I have an M1 Mac mini for a handful of little projects.
Homebridge works on macOS, but of course I kind of hated the way they recommend installing it. I didn't want to tie it to my main user account, for starters. I also hesitated pretty hardcore about having it depend on a packaged Node installer.
I decided what I wanted to do was create another account that could run Homebridge for me. I briefly tried creating a user from the command line with dscl which was failing for some reason or another on Ventura, so I just went in through the Users & Groups Settings panel instead and added an account there.
Studying the official directions, I suspected I could leverage nodenv. They just wanted me to
npm install -g something, and when you run that in nodenv, it gets installed into that nodenv version, not a system-global directory. And every user owns all their own nodenv versions, which was even better.
So I installed nodenv using Homebrew with my main account, which owns all the Homebrew stuff. Hopping back over to the new account, I set up nodenv there, and installed the version of Node they said they wanted:
% nodenv init 2>>.zprofile % source .zprofile % nodenv install 16.16.0 % nodenv global 16.16.0
It looked like I could just install the Homebridge NPM packages without sweating Sudo, and I was right:
% npm install -g homebridge homebridge-config-ui-x
Next step is to use the
hb-service to install Homebridge as a system service. I suspected I did need to use Sudo here, since I was setting up a launch-on-startup system item.
A quick detour:
hb-service is a new command we just installed. nodenv didn't set it up with shims. So we need to rehash, or else we can't find the command:
% nodenv rehash
And now we can set up the service!
% sudo hb-service install
I won't bore you with the details of linking Homebridge to my home, or adding the myQ plugin. But there was one other thing I wanted to do.
The myQ plugin wants a username and password to operate. But I didn't want to use mine—and besides, I'd signed in with Amazon, so I didn't expect it'd even work.
I used a "plussed user" by adding
+homebridge to my email address, and invited it as a co-owner to my myQ home. After signing out of the myQ app and creating a new account there, I had a username and password I could give to the plugin.
And it works! I can open and close the door from any Home app, I can ask Siri about it… yep. It's all there. Thanks, Homebridge. ❤️