I’ve been trying to get the SwitchBot integration as I just bought a SwitchBot.
When going in the configuration and clicking on “Add Integrations”, I can find the SwitchBot integration:
I then click on it, and this shows for a little while, like about 5 seconds:
Then I get this:
I was able to download other integrations, so it does not seem to be related to my setup of home assistant, at least in terms of downloading integrations.
I also have no message at all in the logs of home assistant, as shown by docker logs (enabled up to info level of logging, debug was way to noisy to see anything, and I figured if there was an error, it shouldn’t require that much higher level of logging).
Had anyone had to go through that issue in the past ?
Am I missing a step ?
Ok so I’m going to reply to myself because that wasn’t clear in the first place.
If you manually go and add the configuration in your configuration.yaml, it will work and the integration will appear. It just feels weird it was not working through the UI
Note that if you change the password for your switchbot, for some reason it won’t update properly, so better fully configure it before adding it to home assistant.
Also note that I found the integration to be not very stable, in finding my switchbot (quite often there’s an issue getting info, and my switchbot is not available for a while after that). Even though it’s related to my having put a high delay between getting information (because I’m using my switchbot to press only).
thx for the solution… the integration is there… but i got this error:
Retrying setup: Unable to fetch switchbot services data
I have 4 curtains and i have 2 mac address must i fill in both?
i filled in one.
same problem with my switchbot hub mini. Is it possible to connect the hub mini and use the commands for my created remote controls in Homeassistant? Documentation says: “no hub required” - but if you have one, can you add and use them?
I put the BTE MAC Address in the conf file. No success.
Error Logs:
Logger: switchbot
Source: /usr/local/lib/python3.9/site-packages/switchbot/init.py:155
First occurred: 09:26:00 (1 occurrences)
Last logged: 09:26:00
Scanning for Switchbot devices failed. Stop trying
NoneType: None
Logger: switchbot
Source: /usr/local/lib/python3.9/site-packages/switchbot/init.py:151
First occurred: 08:58:59 (13 occurrences)
Last logged: 09:00:55
Error scanning for switchbot devices
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/switchbot/__init__.py", line 147, in discover
devices = bluepy.btle.Scanner(self._interface).scan(
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 854, in scan
self.stop()
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 803, in stop
self._mgmtCmd(self._cmd()+"end")
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 312, in _mgmtCmd
raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'scanend' (code: 11, error: Rejected)
it was working for me until the I upgraded to 2022.3.2 . I’m going to see if I can roll back , and then if that has fixed the issue.
Update: I had HA 2022.2.9 installed on a raspberry pi that was my HA server until I switched to using a VM a few days ago… Luckily, I still had it. I plugged it in and Switchbot works like a champ.
My new mission is to try to either clone the rpi boot SD card , or find a way to install 2022.2.9 in a VM. I’m still new to HA, so I don’t know their retention policy for older versions.
Update
After trying different configurations, it looks like my issue is with my HA VM being on a bridged interface. At least , that is my best guess. Every other device - Wemo, ecobee, and more - works on my virtualized HA server, except Switchbot.
Anyway, it isn’t HA’s fault. So I’ll be looking at other solutions to the “Retrying setup: Unable to fetch switchbot services data” switchbot integration issue.
Tried adding the SwitchBot lock. I have confirmed that my RPi has bluetooth and it’s enabled. I was able to scan for devices and saw the MAC of the SwitchBot lock.
I am also having the Failed to Connect issue.
When I try adding to the yaml directly, I also get the Unable to fetch switchbot services data.
I even put the lock into setup mode, but it still couldn’t connect the device in the integrations page.
I am ordering a SwitchBot hub mini. Hopefully I can connect to that and use it to control the lock.
I may have to rely on IFTTT to integrate it with HA. Hopefully it won’t come to that.
Did you ever get yours to work? Mine is still broken when using running HA inside of a virtual machine without bluetooth.
I have a mini hub so I don’t think my HA server needs to have BT. But maybe the integration is hard-coded to require it.
That might explain why it worked when HA was running on an rpi that has BT. I migrated my HA setup from the rpi to a virtual machine last December and
switchbot hasn’t worked since.
Could we get the New devices supported in this integration?
For me the Contact Sensor and the Motion Sensor. I have 2x ESP32’s on order, but on a v. slow boat from China.
Or possibly I’m missing something? I get “Failed to connect” whilst trying to add. I have a Pi 4 which should support Bluetooth.
I am having a Raspberry Pi 3 and I am having the same error when trying to add the integration. I dont see any error in the logs. Did anyone made it work?
I have the new Switchbot Thermometer/Hygrometer but I cant even add the integration.
Thats a personal thing and situation ofc. Aside from its actual ‘hub function’, it also is an IR blaster. So it actually has a actual use aside from ‘just being a hub’. But you do need to have a use case for that.
I got mine as part of the amazon deal recently, but it also simply solves the range issue for me personally. My HA is too far away from where the devices are. Even if the integration worked. I do believe the hun also creates a bluetooth mesh, but not looked into that.