fphammerle / switchbot-mqtt

MQTT client controlling SwitchBot button automators & curtain motors, compatible with Home Assistant :house_with_garden: 🐳
https://pypi.org/project/switchbot-mqtt/
GNU General Public License v3.0
51 stars 9 forks source link

Switchbot Bot not moving #180

Open djherbis opened 11 months ago

djherbis commented 11 months ago

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.

fphammerle commented 11 months ago

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.

fphammerle commented 10 months ago

Pre-release v4.0.0a0 supports pySwitchbot's latest release v0.40.1.

Could you upgrade and retry?