-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switchbot Curtain 3, crashes when started with --fetch-device-info #232
Comments
Does the log contain any information before |
@fphammerle, sorry that it took so long for me to respond. This is the traceback of the crash that occurs when switcbot-mqtt is run with Traceback: Successfully sent command to Switchbot (MAC: fc:85:6b:9b:77:03) |
Could you try upgrading the |
I was running switchbot-mqtt version 3.3.1 with pySwitchbot version 0.12.0. and was unable to ugrade pySwitchbot to a newer version. It appears that upgrading to a higher version of pySwitchbot (using pip install) is only possible with switchbot-mqtt version 4.0.0a0. I did a quick check with Rasperry Pi Os Bullseye, Python 3.9.2. and switchbot-mqtt 4.4.0a0 and got pySwitchbot 0.40.1. I know4.0.0a0 is a pre-release, and you may be interested in my findings: It is working well when used in a normal way (including the device info). I see one (reproducible) crash that occurs when OPEN/CLOSE commands are being sent quickly after one another:
|
Thanks for your report! Great to hear that switchbot-mqtt version 4.0.0a0 worked. Unfortunately, I am unable to investigate the "IndexError: bytearray index out of range" error as I do not own a switchbot curtain device. Might alrighty be fixed in a newer version of pySwitchbot. |
I ran into another issue, that hopefully can be solved without having a curtain device at hand. The issue is, that when the bluetooth signal is disturbed, the switchbot devices tend to disconnect sometimes. If that happens, apparently the bleak_retry_connector tries to reestablish the connection several times. When all attempts fail, it gives up and raises an error.
This error is not handled by switchbot-mqtt, so the program crashes. Bluetooth connection failures can and will occur every now and then and imho switchbot-mqtt should keep running then. As it is now, I need to start switchbot-mqtt several times per day, because of these crashes, which is a nuisance, especally when I am not at home. I asume that the type of switchbot device is not relevant for this issue, and as said, I hope this is something that can be solved, without having a curtain device. |
I am using a couple of Switchbot Curtain 3 devices and I would like to get battery- and position information. Unfortunately switchbot-mqtt (latest version) crashes immediately on the first attempt to do so.
Although I don't understand much of the Switchbot API yet, I noticed that the protocols for Curtain 2 and Curtain 3 are different, especially with respect to the device info. I guess that this is the reason for the crashes.
If switchbot-mqtt is started without --fetch-device-info, it works well with my Curtain 3 devices.
@fphammerle, Is it possible to add support for Curtain 3 device info?
The text was updated successfully, but these errors were encountered: