r/HomeKitAutomation • u/BananaStandFlamer • 6h ago
Automation I built a way to control SwitchBot Bots from iPhone, Google Home, and Alexa without a SwitchBot Hub or SwitchBot’s cloud
I just got a Switchbot to press my air conditioner buttons (I didn't do a smart home project in a hot minute and it was on sale!) and I was frickin MAD when it couldn't connect to Google Home/Alexa/Apple without another $30 bridge.
One thing led to another and I utilized my VPS, built an iOS app, and a bridge app for my MacBook that utilized my HomePod as a Matter bridge.
Site page: https://hoagieman.xyz/projects/bot-controller/
Github: https://github.com/danbrag/switchbot-bot-bridge (MIT)
The description below is generated by Claude and yes, I vibe coded it today because I just had surgery yesterday and had a free day 🤣
What it has:
- iPhone/iPad app (SwiftUI). Talks to the Bot directly over Bluetooth. No account and no cloud. It includes a Home Screen widget with ON/OFF buttons, plus Shortcuts and Siri actions.
- Bot Bridge (Mac/Linux menu-bar app). Exposes each Bot as a Matter on/off device, so you can say “Hey Google, turn on the heat” or “Alexa, turn off the heat.” All the traffic stays on your local network.
- Small sharing server (Docker). Coordinates the phones and the bridge so two devices never press the same Bot at the same time, and keeps every device showing the same state.
The thermostat trick: a lot of thermostats ignore the first press while the screen is asleep. You can turn on “wake after idle” for a Bot. Then every client sends a wake tap first if that Bot has been idle for more than 45 seconds, waits 1–10 seconds (you choose), and then presses for real. The server tracks idle time across every device, so a command from Alexa right after one from your phone skips the extra tap.
Caveats:
- SwitchBot Bot only. Curtain, Lock, Plug, and other models aren’t supported. Password-protected Bots aren’t supported either.
- There’s no App Store build. You build the iOS app yourself in Xcode. The widget needs a paid Apple developer account. I'm going to see if I can publish it but I might have to adjust some things for App Store compatibility.
- Voice control needs an always-on computer within Bluetooth range of the Bot, plus your platform’s own Matter hub (a Nest speaker, an Echo, or a HomePod or Apple TV). If you already own a SwitchBot Hub, that’s the simpler route.
- The bridge isn’t Matter-certified, so your home app will warn you about it. Google Home may require a test integration in its developer console although mine did not.
- The bridge is tested on an Apple-silicon Mac with Google Home and Alexa. Apple Home, Linux with real Bluetooth, and Windows are untested. If you try one of those, I’d love to hear how it goes.
- The Bot has no sensor, so “ON/OFF” is the last command the Bot acknowledged, not the actual state of whatever it presses. In plain English: If someone changes the thermostat manually, the bridge can't capture it -- but there is an override in the app.
It’s a hobby project and not affiliated with SwitchBot. It uses their publicly documented BLE protocol. Feedback, issues, and PRs are welcome.