Open vin100ross opened 4 months ago
Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (yalexs_ble
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
yalexs_ble documentation yalexs_ble source (message by IssueLinks)
I got a new lock under warranty from Yale a couple weeks back and I have been testing this further. I can confirm that I observe the same behavior, with battery state not updating or updating very inconsistently when "always connected" is on. So the old, defective lock was not at fault. All other sensors update almost instantly and consistently.
This is not a game-changer, but can be problematic, especially when the battery starts to get low.
The library doesn't poll the battery when always connected mode is on https://github.com/bdraco/yalexs-ble/blob/6c97cc8a2c9b4e69903bea5e1a1a2b0cd74655ca/src/yalexs_ble/push.py#L715
Doing so seemed to crash the lock and require a physical reset (battery pull) so this is unlikely to get changed unless yale fixes the firmware
Ok, thanks.
Since the battery seems to update when connecting/reconnecting, a periodic "force reconnect", would probably patch the issue until the upstream issue is resolved. Since the battery drains very slowly on a healthy lock, reconnecting once every 24h (at night?) would probably suffice and have negligible effects.
I understand that this is mostly an upstream problem, so feel free to close this as "not planned" if you don't intend to implement a patch like the one I suggest.
Thanks for the great work!
We can leave it open. It might eventually get fixed in the firmware and than I can go back and adjust the library. TBH, it might be a long long time before that happens though.
The problem
While investigating excessive battery drain on my Yale Assure 2 Touch lock (probably unrelated to this integration), I noticed that the battery status (voltage, percent) does not update consistently when the "always connected" option is on. It can sometimes take hours or even days to update, often only when I restart the integration or core. Upon disabling the "always connected" option, updates occur about every minute. I have repeated the test several times over the last few months with the same result.
Calling homeassistant.update_entity on the battery voltage sensor makes no difference.
Below is a graph of the battery voltage showing the issue:
I must note that the excessive battery drain does suggest that I have a defective lock (I have a ticket open with Yale). It is therefore possible that the lock itself is responsible for the problem, but I have no way to test this. It is strange that the battery would update normally with "always connected" off, however.
Also, I use an m5 Atom Lite Bluetooth proxy a few feet from the lock. The connection seems stable, and all other events (look, door) are almost instantaneous when "always connected" is on.
What version of Home Assistant Core has the issue?
core-2024.6.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Yale Access Bluetooth
Link to integration documentation on our website
https://www.home-assistant.io/integrations/yalexs_ble
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response