When I got a SwitchBot, I was wondering whether I’d need a SwitchBot Hub to make it work with Home Assistant.
Turns out, you don’t need a Hub. As long as the device you’re using for Home Assistant has Bluetooth, you can connect SwitchBot devices to it.
But having a Hub does add more functionality, so here’s a quick guide to setting up SwitchBot inside HA.
SwitchBot devices can integrate with Home Assistant without a Hub via Bluetooth.
All you need is a Home Assistant device with Bluetooth, or a dongle/adapter for it. However, using a Hub offers extended functionality like WiFi connectivity and Matter support.
The integration process involves enabling Bluetooth, noting the BTLE MAC addresses, and pairing devices. Using a Hub provides better range and cloud integration. For complex setups, the SwitchBot API can be used.
Does SwitchBot Need A Hub To Work With Home Assistant?
No, SwitchBot does not need a Hub to work with Home Assistant. You can connect your devices to Home Assistant directly via Bluetooth. However, with the Hub’s WiFi connectivity, it does have benefits, including Matter support with the SwitchBot Hub 2.
Now, setting up SwitchBot with Home Assistant can be a bit tricky, so here’s a detailed guide to get it up and running quickly.
A Detailed Breakdown of the SwitchBot and Home Assistant Integration
1) Setting Up SwitchBot and Home Assistant With Bluetooth
If you don’t have a Hub, all you need is a Bluetooth-enabled device to run Home Assistant. If you don’t have Bluetooth on your device, you can use a Bluetooth dongle.
Here’s how you can set it up:
a) Enable Bluetooth Integration on Home Assistant Device
First, we need to make sure the Bluetooth integration is enabled on your HA device, otherwise it can’t pair with SwitchBot.
- Navigate to the Settings > Devices & Services page on your Home Assistant device.
- Click on the ‘Add Integration’ or “+” sign to add a new integration.
- In the search bar, type and select “Bluetooth”.
- Follow the on-screen prompts to enable Bluetooth and grant necessary permissions.
b) Add the SwitchBot Integration on Home Assistant
Next, you need to add and enable the SwitchBot integration inside HA.
Use this link on your Home Assistant device, and follow the instructions to set it up quickly.
Alternatively, just follow the same steps as above to add the SwitchBot module.
c) Note Your SwitchBot Devices’ BTLE MAC Addresses
Before you can pair your SwitchBot devices with Home Assistant, you need to note down each device’s BTLE MAC address. This is a unique identifier so you can easily distinguish between devices of the same type (like all your Bots and Curtains).
- Open the SwitchBot app and go to Device Settings.
- Click on ‘Device Info’, and note the BTLE MAC address.
- Repeat this and note each device’s address, plus how you configured them.
Your settings, configurations, device names, etc., will not carry over to Home Assistant once you pair them. So make a note of everything you’d like to keep, as you’ll have to reconfigure these.
d) Pair SwitchBot with Home Assistant
Now, it’s time to pair your SwitchBot device with Home Assistant.
- Press and hold the pairing button on the SwitchBot device until the LEDs flash (this is pairing mode), then go to the Home Assistant interface and click on the SwitchBot integration.
- The SwitchBot device should automatically be discovered within a few moments.
- Click on it to pair it. Repeat this process for each device.
If you face any errors, it’s worth waiting a few moments and retrying. You can also restart your Home Assistant device. And make sure the devices are close to the HA device while pairing. Check Home Assistant’s official page for more error codes and troubleshooting.
2) Connecting SwitchBot and Home Assistant With A Hub
While the Bluetooth method earlier offers a neat setup for anyone who doesn’t have a Hub, it does have some limitations.
Mainly, the range of Bluetooth is limited, so if your SwitchBot devices are spread out all over your home, your Home Assistant device may not be able to reliably communicate with all of them, which can cause some automation scripts to fail.
With a Hub, you can extend this range and add the power of cloud integration to your SwitchBot system. So if you have a Hub, or you’re planning to buy one, this is a great option.
The best way to connect the SwitchBot Hub 2 with Home Assistant is to use the new Matter integration. However, older Hub models may not work this way.
Another way to add the Hub to Home Assistant is via the SwitchBot API. This is quite technical, and may seem very daunting if you haven’t used API connections before, but here’s a quick overview:
a) Set Up The SwitchBot Hub
First, you need to make sure your Hub is up and running, and connected to all your SwitchBot devices.
- Plug in the Hub and connect it to your WiFi network using the SwitchBot app.
- Once connected, the Hub should automatically discover any nearby SwitchBot devices. Ensure they’re powered on and within range.
- Follow the on-screen instructions to pair each device with the Hub.
b) Integrating With Home Assistant Via The SwitchBot API
You’ll need your SwitchBot API token and key; to generate it:
- Inside the SwitchBot app, go to Profile > Preferences.
- Tap the App Version 10 times to enable Developer settings.
- Open Developer Options and click on ‘Get Token’.
Copy and paste these in a safe place, like a password manager or encrypted document.
Next, I recommend following this video to learn how to integrate the API keys inside Home Assistant.
Remember, Home Assistant is meant to act as a Hub by itself, so if this API process seems too complex for you; it might be best to skip it. Using the Bluetooth method works well most of the time, and of course, the Hub 2 with Matter support makes it very easy too.
Important Notes About SwitchBot and Home Assistant Integration
- Custom Integration Conflict: Sometimes, other custom integrations in Home Assistant might not play nicely with SwitchBot. It’s rare, but it’s good to be aware.
- Unconfigured Devices: If a device isn’t set up correctly in the SwitchBot app, you might hit a snag during integration. Reconfigure or reset these devices.
- Slow Connection: It’s a common issue with smart devices. Make sure your internet connection is stable and fast, and consider using a high-performance Bluetooth dongle or adapter on your Home Assistant device.
- Firmware Updates: Make sure your SwitchBot and Home Assistant devices are all updated to the latest firmware; this can often resolve any issues you face.
- Check Logs: If you face any errors while automating in Home Assistant, check the logs by going to the Logbook. This can help you troubleshoot any issues.
Why isn’t my SwitchBot device being detected by Home Assistant?
If your SwitchBot device isn’t being detected by Home Assistant, then make sure your Bluetooth integration is enabled, the device is in pairing mode, and bring them close together. Check the battery levels, and try restarting the Home Assistant platform.
Can I control multiple SwitchBot devices simultaneously through Home Assistant?
Yes, you can group multiple SwitchBot devices in Home Assistant and control them together. It acts as a Hub itself, so you can create automation routines and more, as well as integrate smart devices from other brands in a single place.
How secure is the connection between SwitchBot and Home Assistant?
When paired directly via Bluetooth, the connection between SwitchBot and Home Assistant is as secure as the Bluetooth protocol itself. If using the Hub and API, ensure that you store your API token securely and maintain good security practices with your Home Assistant setup.
I hope by now you were able to integrate your SwitchBot devices with Home Assistant, whether with or without a Hub. With the right setup, you can now control your SwitchBot devices with ease, network them with any other smart devices, and have them all work smoothly as part of your home automation system.
The possibilities are endless – let us know what you plan to do, and share any helpful tricks and tips in the comments below.