mamoja
(Max)
March 11, 2022, 1:19pm
1
Hello,
I am trying to get the switchbot integration to work and I am probably just completely stupid but I hope someone can help me. I have bulbs, motions sensors and a switch.
HA (2022.2.6) docker container
In the console of the container I can scan for bluetooth devices.
If I run the switchbot integration it just shows ‘Failed to connect’
But I get this error:
Failed to execute management command 'le on' (code: 20, error: Permission Denied)
If you need any information let me know and thank you!
mamoja
(Max)
March 28, 2022, 9:18pm
2
Hello,
I still have this problem.
Here the full log.
homeassistant | 2022-03-28 22:14:16 WARNING (SyncWorker_7) [switchbot] Error scanning for Switchbot devices. Retrying (remaining: 1)
homeassistant | 2022-03-28 22:14:17 ERROR (SyncWorker_7) [switchbot] Error scanning for switchbot devices
homeassistant | Traceback (most recent call last):
homeassistant | File "/usr/lib/python3.9/site-packages/switchbot/__init__.py", line 147, in discover
homeassistant | devices = bluepy.btle.Scanner(self._interface).scan(
homeassistant | File "/usr/lib/python3.9/site-packages/bluepy/btle.py", line 852, in scan
homeassistant | self.start(passive=passive)
homeassistant | File "/usr/lib/python3.9/site-packages/bluepy/btle.py", line 790, in start
homeassistant | self._mgmtCmd("le on")
homeassistant | File "/usr/lib/python3.9/site-packages/bluepy/btle.py", line 312, in _mgmtCmd
homeassistant | raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
homeassistant | bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 20, error: Permission Denied)
homeassistant | 2022-03-28 22:14:17 ERROR (SyncWorker_7) [switchbot] Scanning for Switchbot devices failed. Stop trying
homeassistant | NoneType: None
I have exactly the same problem. Pi4 running docker container.
I’m running docker container and have added
cap_add:
- net_admin
to docker.compose file. Now it works.