switchbot-mqtt
switchbot-mqtt copied to clipboard
Switchbot Bot not moving
I get messages like:
Error talking to Switchbot
Traceback (most recent call last):
File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/switchbot/__init__.py", line 283, in _sendcommand
self._connect()
File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/switchbot/__init__.py", line 232, in _connect
self._device = bluepy.btle.Peripheral(
File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/bluepy/btle.py", line 391, in __init__
self._connect(deviceAddr, addrType, iface)
File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral XX:XX:XX:XX:XX:XX, addr type: random
Cannot connect to Switchbot. Retrying (remaining: 1)
Successfully sent command to Switchbot (MAC: XX:XX:XX:XX:XX:XX)
switchbot XX:XX:XX:XX:XX:XX turned off
Which sounds like it failed, but then succeeded on a retry, however the bot doesn't actually move at all.
I'm running on a raspberry pi 4 if that helps.
According to the stack trace above, you are experiencing an issue within the PySwitchbot library.
switchbot-mqtt currently uses an ancient version of PySwitchbot (<0.13).
Upgrading PySwitchbot might fix the bug, however, I haven't found time yet to adapt switchbot-mqtt to the breaking changes in newer versions of PySwitchbot.