-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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 Lock IndexError #89061
Comments
Hey there @bdraco, @Danielhiversen, @RenierM26, @murtas, @Eloston, @dsypniewski, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) switchbot documentation |
the same here |
Quick update, the lock may also become unavailable after giving the IndexError. It has to be deleted and re-added to show up again. Not sure whether this is an issue with the bluetooth proxy or the integration. Sometimes the lock can be re-added after a restart, others the bluetooth proxy needs to be restarted. |
yes, but restarting every x time lock or integration or esp isnt good idea |
I am experiencing the same issue. |
back to the February release solve problem, so this is for sure march release problem |
Facing the same error also in .1 update. |
Same problem here... it seems to be linked to python 3.11 update (just a BIG guess here) |
Same problem here on 2023.3.1, reverting to 2023.3.0 seems to resolve it for the time being |
Same here-- unable to restore functionality even with a backup at this point in time. |
I don't have the issue but I'm running firmware 6.2 on the lock |
I am on V6.5 and get the error every couple of hours |
I'm having the same issues even though i was running firmware v6.2 My log as below:
|
Same problem after upgrade to 2023.3 |
Can someone check if this was fixed in 2023.3.2? |
Appears to be working as expected for me now! Though I've had sporadic function lately. Will edit this reply if I find it is not working again later. **EDIT: Yeah, still broken. ** |
Still broken for me in 2023.3.2. Same as before. Will respond normally for a bit until it give the same IndexError. Edit: It appears the state changes when manually unlocking/locking and the door state changes as well now. Door state did not previously work for me. However I cannot send a lock/unlock command. Same error. |
I can confirm that 2023.3.2 did not fix the problem. |
The problem indeed persists in 2023.3.2. |
Experiencing the same issue. |
Same issue for me! |
I am experiencing the same issue as well on 2023.3.3 Home Assistant 2023.3.3 I reverted back to 2023.2.5 and it works again. |
i too. |
This has nothing to do with the Switchbot Locks themselves. Either Roll-Back to an earlier backup (prior 2023.03) or wait for a fix. |
In my case, the SwitchBot Lock also does not show “unavailable” in HA just prior to failing - the lock appears working normal, showing battery level, etc. And the SwitchBot Integration appears OK as well. Recyling the Integration immediately causes the lock to run I on again. Appreciate the automations posted here. This should help for now until a fix is available in the future. :-) |
nope - reloading the integration is the bypass for now |
Problem solved for me in latest core update |
Strange, it is not mentioned in the changelog. |
Update: it's still intermittent however works better than previous time. Still the error message exists. Tested after 12 hours of inactivity and it worked couple of time. After that after an hour it did not and after few mins it did. So it's weird |
Works better for me as well. But will crash ever so often. Then must reload the service. |
Same here. HA 2023.3.3. |
is some progress with this issue? 3 weeks gone... |
Yeah an update about a work in progress would be much appreciated. Right know the lock is 99% of the time unreliable. |
I don't think anyone is working on this. Someone who can replicate the issue will need to fix it. I can review a fix when someone comes up with one but that's the extent to which I can help here. |
@KiraPC any chance you can look into this issue? |
Hi @federicotravaini I was looking to the diff from the old February release and the first of march but I didn't see any changes on Switchbot files. I think it is an issue on the new python version. In this weekend if I have time I'll try to take some debugs for investigate. Btw, does someone has it installed not as container but with python? In case, with python 10 it has the same error? Edit: I read better the log, it is python10, but the error coming from the switchbot lib, not from hass Edit 2: the only changes from 2022.2.5 is the update of the PySwitchbot lib from 0.36.4 to 0.37.3 so I think this issue is opened to the wrong repository. Tomorrow I'll open it to the correct one if no other do it before me (if you'll do, please tag me) |
Should be fixed in 2023.3.6 thanks to the person who didn't wanted to be named that mailed me a lock that had the issue. |
Wow, big thanks to you both
…On Wed, Mar 22, 2023, 8:38 PM J. Nick Koston ***@***.***> wrote:
Should be fixed in 2023.3.6 thanks to the person who didn't wanted to be
named that mailed me a lock that had the issue.
—
Reply to this email directly, view it on GitHub
<#89061 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGIX76JNXOTUFWVQWKAIFVTW5OLQVANCNFSM6AAAAAAVNZVJNE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
fixes #90090 fixes #89061 changelog: Danielhiversen/pySwitchbot@0.37.3...0.37.4
fixes #90090 fixes #89061 changelog: Danielhiversen/pySwitchbot@0.37.3...0.37.4
I do not think this is fixed. I upgraded to 2023.3.6 because I was experiencing the same symptoms as described above. |
Yes @brintal i have the same problem when upgrading to 2023.3.6 |
So far appears to be fixed for my lock and HA setup using 2023.3.6. |
Unless you have the exact same error as the op in the log, please open a new issue as you have a different problem. Please include full debug logs in the new issue |
Updated yesterday to 2023.4 and the lock is back and working as before. |
The problem
After upgrading to home assistant 2023.3 the the Switchbot lock works after restart, but after some time will generate an error of "IndexError: bytearray index out of range". This lock is connected via an esp32 running the ESPhome Home assistant bluetooth proxy.
What version of Home Assistant Core has the issue?
2023.3
What was the last working version of Home Assistant Core?
2023.2
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Switchbot
Link to integration documentation on our website
https://www.home-assistant.io/integrations/switchbot/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: homeassistant.components.websocket_api.http.connection Source: components/switchbot/lock.py:54 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 2:41:26 PM (5 occurrences) Last logged: 2:43:03 PM [140336955975392] bytearray index out of range [140336996131280] bytearray index out of range [140336906908960] bytearray index out of range [140337048416464] bytearray index out of range Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 198, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 961, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 726, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/lock/__init__.py", line 106, in _async_unlock await entity.async_unlock(**remove_entity_service_fields(service_call)) File "/usr/src/homeassistant/homeassistant/components/switchbot/lock.py", line 54, in async_unlock self._last_run_success = await self._device.unlock() File "/usr/local/lib/python3.10/site-packages/switchbot/devices/lock.py", line 168, in unlock return await self._lock_unlock( File "/usr/local/lib/python3.10/site-packages/switchbot/devices/lock.py", line 196, in _lock_unlock self._update_parsed_data(self._parse_basic_data(basic_data)) File "/usr/local/lib/python3.10/site-packages/switchbot/devices/lock.py", line 175, in _parse_basic_data "battery": basic_data[1], IndexError: bytearray index out of range
Additional information
No response
The text was updated successfully, but these errors were encountered: