Closed almirus closed 1 year ago
Hey there @jc2k, @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit_controller
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
homekit_controller documentation homekit_controller source (message by IssueLinks)
like similar https://github.com/home-assistant/core/issues/84038
The Aqara is over IP, and from the error you posted your door lock is over BLE. They are not comparable.
Unfortunately the errors you posted aren't something I can fix via homekit_controller. They indicate the Linux Bluetooth stack can't reach that device for some reason.
Usually if BLE works most of the time then starts to fail it is either a range issue or your Bluetooth dongle is crashing. There have been lots of problems with Bluetooth stability in HAOS10 (compared to 9.5).
So the usual list of things to try is
@Jc2k Aqara Door Lock connected via HomeKit not Bluetooth
The door lock talks HomeKit Accessory Protocol .... over Bluetooth
So homekit supports IP, Bluetooth and thread. HA supports all 3.
Your error message in the first post mentions Bluetooth.
i have Bluetooth adapter, how disable internal rpi4
If you have both it will use the strongest so it shouldn't matter.
I don't understand, the other BLE sensor works fine and great, the door lock is 1 meter away from this sensor. Therefore, the bluetooth adapter works fine (and the RPI chose the strongest one)
It's not just about your Bluetooth adaptor, some HomeKit Bluetooth locks deliberately cap their radio performance, possibly as a security feature.
There are also some Bluetooth devices that just don't work well with Linux.
@Jc2k That is, there is a possibility that my Smart Door Lock N100 rarely works via Bluetooth and does not work via WIFI?
Please stop posting on so many tickets. You are pinging lots of different people, it's rude to the people that have actually taken time to answer and it's not actually moving anything forward.
In this ticket you said you you use "Home Assistant Supervised". Are you sure thats correct, and that you didn't mean HA OS. Because https://github.com/home-assistant/operating-system/issues/2485 is for HA OS only. Can you confirm which you have? How did you install Home Assistant?
In another ticket you mentioned that you use a RTL8761b. Note that Realtek devices are notoriously unreliable and are not on the list of well supported devices I directed you to look at earlier. Realtek devices are known in the worst case to fail multiple times an hour, and some don't have the USB reset pin connected so we can't restart them from software.
@Jc2k I'm sorry. I just wanted to help the community with my case (logs) Yes, I have HA OS
Did it used to work with HA OS 9.5, or are you a new user, or has it never worked?
Connected the door lock to HA just today
So https://github.com/home-assistant/operating-system/issues/2485 is for people who had it working with HA OS 9.5 and then it broke when they upgraded to HA OS 10. So you probably shouldn't have posted there.
There is nothing in your logs that indicates there is a bug. It looks like HA is asking Linux to connect to the device and it is either out of range, out of battery, or your bluetooth dongle is having trouble.
One lock required the user to be inches away in order to work (due to limitations of the lock).
You could turn on debug logging and see if there is any more detail in there.
Ah, I reviewed them already. Those logs mostly contain examples of it working with your other devices, and the errors I can see are just from bluetooth failing to connect to your device.
now I'm trying to downgrade HA OS Thank you for your patience
Now the response speed has increased to about 3-5 seconds and there are no errors in the log. But the connection is one-way: open \ close from HA is work, but if you ring the doorbell or open it, HA does not receive a status. maybe this is a feature..., but HomeKit should register such events.
New error ` Logger: homeassistant.core Source: components/homekit_controller/connection.py:781 First occurred: 23:54:15 (1 occurrences) Last logged: 23:54:15
Error executing service: <ServiceCall lock.unlock (c:01H1AAYHSQGP1G3SNYGR79SHQV): entity_id=['lock.smart_door_lock_n100_c2b3']> Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 233, in connect await local_disconnect_monitor_event.wait() File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait await fut asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 344, in establish_connection await client.connect( File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 272, in connect connected = await super().connect(kwargs) File "/usr/local/lib/python3.10/site-packages/bleak/init.py", line 531, in connect return await self._backend.connect(kwargs) File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 141, in connect async with async_timeout(timeout): File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/connection.py", line 47, in establish_connection return await retry_establish_connection( File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 361, in establish_connection _raise_if_needed(name, device.address, exc) File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 310, in _raise_if_needed raise BleakNotFoundError(msg) from exc bleak_retry_connector.BleakNotFoundError: Smart Door Lock N100 C2B3 [D0:CE:00:6B:7A:4D] (id=FE:2C:2A:66:4C:9E) - D0:CE:00:6B:7A:4D: Failed to connect:
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1867, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, 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/homekit_controller/lock.py", line 120, in async_unlock await self._set_lock_state(STATE_UNLOCKED) File "/usr/src/homeassistant/homeassistant/components/homekit_controller/lock.py", line 124, in _set_lock_state await self.async_put_characteristics( File "/usr/src/homeassistant/homeassistant/components/homekit_controller/entity.py", line 89, in async_put_characteristics return await self._accessory.put_characteristics(payload) File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 781, in put_characteristics await self.pairing.put_characteristics(characteristics) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 189, in _async_operation_lock_wrap return await func(self, *args, *kwargs) File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 454, in _async_wrap_bluetooth_connection_error_retry return await func(args, kwargs) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 205, in _async_disconnect_on_missing_services_wrap return await func(self, *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 229, in _async_restore_and_resume await self._populate_accessories_and_characteristics() File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 1099, in _populate_accessories_and_characteristics made_connection = await self._ensure_connected(attempts) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 500, in _ensure_connected self.client = await establish_connection( File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/connection.py", line 59, in establish_connection raise AccessoryNotFoundError(ex) from ex aiohomekit.exceptions.AccessoryNotFoundError: Smart Door Lock N100 C2B3 [D0:CE:00:6B:7A:4D] (id=FE:2C:2A:66:4C:9E) - D0:CE:00:6B:7A:4D: Failed to connect: `
I also bought a new dongle with CSR8510A10 chip. I'll check tomorrow
do you know? Now the door lock is connected as a slave to E1 hub via Zigbee. In HA, the lock was added via Bluetooth and through it it works unstably. Is it possible to force the hub to throw my lock through itself.
Now I have CSR8510 and 9.5 OS The error is now: `Logger: homeassistant.core Source: components/homekit_controller/connection.py:781 First occurred: 20:23:04 (1 occurrences) Last logged: 20:23:04
Error executing service: <ServiceCall button.press (c:01H1CH8M6SG134YS8SS9JS908G): entity_id=['button.smart_door_lock_n100_c2b3_identify']> Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 204, in connect reply = await self._bus.call( File "/usr/local/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 371, in call await future asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 344, in establish_connection await client.connect( File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 272, in connect connected = await super().connect(kwargs) File "/usr/local/lib/python3.10/site-packages/bleak/init.py", line 531, in connect return await self._backend.connect(kwargs) File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 141, in connect async with async_timeout(timeout): File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/connection.py", line 47, in establish_connection return await retry_establish_connection( File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 361, in establish_connection _raise_if_needed(name, device.address, exc) File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 310, in _raise_if_needed raise BleakNotFoundError(msg) from exc bleak_retry_connector.BleakNotFoundError: Smart Door Lock N100 C2B3 [D0:CE:00:6B:7A:4D] (id=FE:2C:2A:66:4C:9E) - D0:CE:00:6B:7A:4D: Failed to connect:
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1867, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/button/init.py", line 116, in _async_press_action await self.async_press() File "/usr/src/homeassistant/homeassistant/components/homekit_controller/button.py", line 125, in async_press await self.async_put_characteristics({key: val}) File "/usr/src/homeassistant/homeassistant/components/homekit_controller/entity.py", line 89, in async_put_characteristics return await self._accessory.put_characteristics(payload) File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 781, in put_characteristics await self.pairing.put_characteristics(characteristics) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 189, in _async_operation_lock_wrap return await func(self, *args, kwargs) File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 454, in _async_wrap_bluetooth_connection_error_retry return await func(*args, *kwargs) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 205, in _async_disconnect_on_missing_services_wrap return await func(self, args, kwargs) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 229, in _async_restore_and_resume await self._populate_accessories_and_characteristics() File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 1099, in _populate_accessories_and_characteristics made_connection = await self._ensure_connected(attempts) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 500, in _ensure_connected self.client = await establish_connection( File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/connection.py", line 59, in establish_connection raise AccessoryNotFoundError(ex) from ex aiohomekit.exceptions.AccessoryNotFoundError: Smart Door Lock N100 C2B3 [D0:CE:00:6B:7A:4D] (id=FE:2C:2A:66:4C:9E) - D0:CE:00:6B:7A:4D: Failed to connect: `
I would set up an Ethernet connected esphome proxy to rule out the system running HA as the problem
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
@bdraco I set up ESP proxy - nothing has changed
@bdraco I set up ESP proxy - nothing has changed
Did you disable the local adapter?
@bdraco yes, via
# Disable Bluetooth
dtoverlay=disable-bt
The problem
I have Homekit controller paired with an e1 hub, which itself has around 3 sensors (2 thermostat) paired to it. Response time in the Aqara Hub and 2 thermostats and Home Assistant Is normally instant. However randomly the response time from when a Door Lock is triggered to when it reports in HA will go from instant, to taking 30 seconds to a minute OR NEVER.
"device": { "name": "Smart Door Lock N100 C2B3", "model": "ZNMS16LM", "manfacturer": "Aqara", "sw_version": "1.1.3", "hw_version": "1.0.0", "entities": [ { "original_name": "Signal strength", "original_device_class": "signal_strength", "entity_category": "diagnostic", "original_icon": null, "icon": null, "unit_of_measurement": "dBm", "device_class": null, "disabled": true, "disabled_by": "integration", "state": null }, { "original_name": "Smart Door Lock N100 C2B3", "original_device_class": null, "entity_category": null, "original_icon": null, "icon": null, "unit_of_measurement": null, "device_class": null, "disabled": false, "disabled_by": null, "state": { "entity_id": "lock.smart_door_lock_n100_c2b3", "state": "locked", "attributes": { "friendly_name": "Smart Door Lock N100 C2B3", "supported_features": 0 }, "last_changed": "2023-05-25T18:37:21.750688+00:00", "last_updated": "2023-05-25T18:37:21.750688+00:00" } }, { "original_name": "Smart Door Lock N100 C2B3 Identify", "original_device_class": null, "entity_category": "diagnostic", "original_icon": null, "icon": null, "unit_of_measurement": null, "device_class": null, "disabled": false, "disabled_by": null, "state": { "entity_id": "button.smart_door_lock_n100_c2b3_identify", "state": "2023-05-25T18:46:49.660779+00:00", "attributes": { "friendly_name": "Smart Door Lock N100 C2B3 Identify" }, "last_changed": "2023-05-25T18:46:49.661173+00:00", "last_updated": "2023-05-25T18:46:49.661173+00:00" } }, { "original_name": "Smart Door Lock N100 C2B3 battery_service", "original_device_class": "battery", "entity_category": "diagnostic", "original_icon": "mdi:battery-unknown", "icon": null, "unit_of_measurement": "%", "device_class": null, "disabled": false, "disabled_by": null, "state": { "entity_id": "sensor.smart_door_lock_n100_c2b3_battery_service", "state": "100", "attributes": { "state_class": "measurement", "unit_of_measurement": "%", "device_class": "battery", "icon": "mdi:battery", "friendly_name": "Smart Door Lock N100 C2B3 battery_service" }, "last_changed": "2023-05-25T18:30:21.265938+00:00", "last_updated": "2023-05-25T18:30:21.265938+00:00" } } ] }
What version of Home Assistant Core has the issue?
core-2023.5.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
HA OS
Integration causing the issue
Homekit Controller
Link to integration documentation on our website
https://www.home-assistant.io/integrations/homekit_controller/
Diagnostics information
` Logger: homeassistant.core Source: components/homekit_controller/connection.py:781 First occurred: 21:33:57 (4 occurrences) Last logged: 21:47:29
Error executing service: <ServiceCall button.press (c:01H1A2Z258E4FXJN1Y8HMZTK34): entity_id=['button.smart_door_lock_n100_c2b3_identify']> Error executing service: <ServiceCall lock.unlock (c:01H1A3H4BXSSJP9S3TDPWNC309): entity_id=['lock.smart_door_lock_n100_c2b3']> Error executing service: <ServiceCall button.press (c:01H1A3QBEZ84K24VJSR5ZT6DR4): entity_id=['button.smart_door_lock_n100_c2b3_identify']> Error executing service: <ServiceCall lock.unlock (c:01H1A3QKEVW56ZJYH58B79QMYH): entity_id=['lock.smart_door_lock_n100_c2b3']> Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 344, in establish_connection await client.connect( File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 253, in connect wrapped_backend = self._async_get_best_available_backend_and_device(manager) File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 355, in _async_get_best_available_backend_and_device raise BleakError( bleak.exc.BleakError: No backend with an available connection slot that can reach address D0:CE:00:6B:7A:4D was found
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/connection.py", line 47, in establish_connection return await retry_establish_connection( File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 421, in establish_connection _raise_if_needed(name, device.address, exc) File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 313, in _raise_if_needed raise BleakOutOfConnectionSlotsError( bleak_retry_connector.BleakOutOfConnectionSlotsError: Smart Door Lock N100 C2B3 [D0:CE:00:6B:7A:4D] (id=FE:2C:2A:66:4C:9E) - D0:CE:00:6B:7A:4D: Failed to connect: No backend with an available connection slot that can reach address D0:CE:00:6B:7A:4D was found: The proxy/adapter is out of connection slots; Add additional proxies near this device
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1867, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/button/init.py", line 116, in _async_press_action await self.async_press() File "/usr/src/homeassistant/homeassistant/components/homekit_controller/button.py", line 125, in async_press await self.async_put_characteristics({key: val}) File "/usr/src/homeassistant/homeassistant/components/homekit_controller/entity.py", line 89, in async_put_characteristics return await self._accessory.put_characteristics(payload) File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 781, in put_characteristics await self.pairing.put_characteristics(characteristics) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 189, in _async_operation_lock_wrap return await func(self, *args, kwargs) File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/init.py", line 454, in _async_wrap_bluetooth_connection_error_retry return await func(*args, *kwargs) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 205, in _async_disconnect_on_missing_services_wrap return await func(self, args, kwargs) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 229, in _async_restore_and_resume await self._populate_accessories_and_characteristics() File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 1099, in _populate_accessories_and_characteristics made_connection = await self._ensure_connected(attempts) File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 500, in _ensure_connected self.client = await establish_connection( File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/ble/connection.py", line 61, in establish_connection raise AccessoryDisconnectedError(ex) from ex aiohomekit.exceptions.AccessoryDisconnectedError: Smart Door Lock N100 C2B3 [D0:CE:00:6B:7A:4D] (id=FE:2C:2A:66:4C:9E) - D0:CE:00:6B:7A:4D: Failed to connect: No backend with an available connection slot that can reach address D0:CE:00:6B:7A:4D was found: The proxy/adapter is out of connection slots; Add additional proxies near this device `
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response