alextud / ha-switchbot-curtain

Controls switchbot curtain using Home Assistant
MIT License
55 stars 16 forks source link

Crashes with traceback #14

Open scstraus opened 3 years ago

scstraus commented 3 years ago

Any idea what would cause this? Am I missing some dependency?

2021-05-24 21:16:45 ERROR (MainThread) [homeassistant.helpers.entity] Update for cover.switchbot_
curtain fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_sta
te
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/switchbot-curtain/cover.py", line 164, in update
    self._device.update()
  File "/usr/local/lib/python3.8/site-packages/switchbot/__init__.py", line 189, in update
    devices = bluepy.btle.Scanner().scan(scan_timeout)
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 852, in scan
    self.start(passive=passive)
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 790, in start
    self._mgmtCmd("le on")
  File "/usr/local/lib/python3.8/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 'le on' (code: 17, error: Invalid Index)
gzone156 commented 3 years ago

Same issue here. All controls works, but I have the log full of those errors.

scstraus commented 3 years ago

I had to move onto a Pi. Apparently it didn't like my bluetooth hardware or something.

gzone156 commented 3 years ago

I'm already on a Pi4. Do you experience a total loss of functionality?

Probably in my case the issue could be related to the fact that I have another integration wich uses BTLE (Xiaomi BLE).

Il mar 1 giu 2021, 22:02 Sean Straus @.***> ha scritto:

I had to move onto a Pi. Apparently it didn't like my bluetooth hardware or something.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alextud/ha-switchbot-curtain/issues/14#issuecomment-852409074, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO46SWGTENBDJ6UO7OZJ4SLTQU4EDANCNFSM45SYII2Q .

scstraus commented 3 years ago

On the original machine it didn't work at all.

gzone156 commented 3 years ago

Still present for me, how can I help solving this issue?

nsaripalli commented 3 years ago

I had this issue as well and spent some time debugging it. It seems to be some sort of driver issue. I had a Bluetooth dongle connected to my raspberry pi which worked great until it didn't, but realized that my dongle wasn't even an option as a controller option within bluetoothctl. The solution for this was to just buy a new Bluetooth dongle. This is the one I got and it seems to be working fine now: https://www.amazon.com/dp/B007Q45EF4