home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.74k forks source link

Yale Linus L2 stuck in initializing #125086

Open Silkjaer opened 2 months ago

Silkjaer commented 2 months ago

The problem

The lock is stuck in 'initializing'.

It works great with the Yale Home (new in 2024.9.0b) and August Yale Home integration, and the Yale Access Bluetooth integration picked up the lock on bluetooth quickly, imported Offline_keys from the August integration and created new entities as it should.

But the lock continues a loop of 'initializing'.

It looks like the RSSI is -61, and the bluetooth integration doesn't appear to complain about connectivity?

Is it simply because this lock is not (yet) supported?

Logs from the yalexs_ble log:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 1020, in _execute_deferred_update
    await self._update()
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 113, in _async_wrap_operation_lock
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 157, in _async_wrap_retry_bluetooth_connection_error
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 707, in _update
    lock = await self._ensure_connected()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 566, in _ensure_connected
    await self._client.connect(max_attempts)
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/lock.py", line 188, in connect
    await self._setup_session()
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/lock.py", line 246, in _setup_session
    response = await self.secure_session.execute(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/session.py", line 268, in execute
    async with interrupt(
  File "/usr/local/lib/python3.12/site-packages/async_interrupt/__init__.py", line 89, in __aexit__
    raise self._exception(self._message) from exc_val
yalexs_ble.session.DisconnectedError: Fordør (B0:44:9C:13:03:39): Disconnected
2024-09-02 15:50:41.099 ERROR (MainThread) [yalexs_ble.push] Fordør (B0:44:9C:13:03:39): Disconnected while updating
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/session.py", line 271, in execute
    return await self._write(command, command_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/session.py", line 139, in _write
    return await self._locked_write(command, command_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/session.py", line 197, in _locked_write
    result = await future
             ^^^^^^^^^^^^
asyncio.exceptions.CancelledError: Interrupted by interrupt context manager

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 1020, in _execute_deferred_update
    await self._update()
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 113, in _async_wrap_operation_lock
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 157, in _async_wrap_retry_bluetooth_connection_error
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 707, in _update
    lock = await self._ensure_connected()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/push.py", line 566, in _ensure_connected
    await self._client.connect(max_attempts)
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/lock.py", line 188, in connect
    await self._setup_session()
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/lock.py", line 246, in _setup_session
    response = await self.secure_session.execute(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yalexs_ble/session.py", line 268, in execute
    async with interrupt(
  File "/usr/local/lib/python3.12/site-packages/async_interrupt/__init__.py", line 89, in __aexit__
    raise self._exception(self._message) from exc_val
yalexs_ble.session.DisconnectedError: Fordør (B0:44:9C:13:03:39): Disconnected

From bluetooth debug log:

2024-09-02 15:44:27.497 DEBUG (MainThread) [bleak_retry_connector] Fordør (B0:44:9C:13:03:39) - B0:44:9C:13:03:39: Connection attempt: 1
2024-09-02 15:44:33.603 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (00:1A:7D:DA:71:13) [connectable]: <BluetoothServiceInfoBleak name=LPOF1000XH address=B0:44:9C:13:03:39 rssi=-68 manufacturer_data={465: b'\x00\x009==\xc4\xb4\x98\x02\x04\xdd\xban\x1c\xc3<~P'} service_data={} service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000fe24-0000-1000-8000-00805f9b34fb'] source=00:1A:7D:DA:71:13 connectable=True time=17880.019265021 tx_power=None> match: set()
2024-09-02 15:44:34.597 DEBUG (MainThread) [bleak_retry_connector] Fordør (B0:44:9C:13:03:39) - B0:44:9C:13:03:39: Connected after 1 attempts

What version of Home Assistant Core has the issue?

core-2024.9.0b2

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

yalexs_ble

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?

No response

Additional information

No response

home-assistant[bot] commented 2 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!

Code owner commands Code owners of `yalexs_ble` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign yalexs_ble` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


yalexs_ble documentation yalexs_ble source (message by IssueLinks)

bdraco commented 2 months ago

This isn't a regression in yalexs_ble since there aren't changes there for 2024.9.x. I removed the milestone

bdraco commented 2 months ago

The Linux L2 isn't tested with this integration https://www.home-assistant.io/integrations/yalexs_ble so it may not work.

However most of the problem are usually due to the Bluetooth Adapter.

These locks seem to work best with this ESPHome Bluetooth proxy option: https://www.olimex.com/Products/IoT/ESP32/ESP32-POE-ISO-EA/open-source-hardware https://www.olimex.com/Products/IoT/ESP32/BOX-ESP32-POE-ISO/