Closed enkama closed 1 year ago
Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (bluetooth
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
bluetooth documentation bluetooth source (message by IssueLinks)
I too have the same problem with the built in Bluetooth adapter on my Intel NUC (Beelink Mini PC). I am currently using only the „passive scanning“ option of the hci0 adapter integration. From time to time I get the error message that it cannot reset the hci0 adapter but the adapter is still up in the device display. So my question is why it tries to reset the adapter and why it does not detect that it is still up and running. Here‘s the error message in the core log:
Logger: bluetooth_auto_recovery.recover Source: components/bluetooth/util.py:78 First occurred: May 13, 2023 at 05:14:18 (2 occurrences) Last logged: May 13, 2023 at 20:12:20 Bluetooth adapter hci0 [DC:21:48:2A:58:4F] could not be reset due to timeout after 5 seconds
I too have issues with the Bluetooth since a month or so. I am running HA docker. I used to use version 2022.11, now recently upgraded to 2023.5 to try to fix the issues, but alas.
The issue, as far as I can see, is that HomeAssistant is constantly scanning for new devices, and overloading the BT dongle.
I tested outside of the docker, if I pause the docker, then run bluetoothctl power off; bluetoothctl power on
, then a script external to the docker can read the metrics from my Airthings wave BLE device. However, as soon as I unpause the docker, I start getting a LOT of [CHG] actions in the output of bluetoothctl
, such as
[CHG] Device 41:6F:1B:32:00:55 RSSI: -70
[CHG] Device 14:4D:42:D9:6D:D9 RSSI: -63
[CHG] Device 69:E4:80:93:A9:58 RSSI: -67
[CHG] Device 04:69:F8:93:0E:BF RSSI: -71
[CHG] Device 57:41:2A:C1:0B:0E RSSI: -68
and it goes on and on and on. And from the start I start seeing this scan, then the external script that reads the Airthings Wave BLE device stops being able to read the metrics.
In the HA logs, I found only this:
Logger: homeassistant.components.bluetooth.scanner
Source: components/bluetooth/scanner.py:340
Integration: Bluetooth ([documentation](https://www.home-assistant.io/integrations/bluetooth), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+bluetooth%22))
First occurred: 4:21:07 PM (1 occurrences)
Last logged: 4:21:07 PM
hci0 (5C:F3:70:A9:74:31): Error stopping scanner: [org.bluez.Error.Failed] No discovery started
but it seems clear to me that something is wrong with the Bluetooth addon. We need to be able to stop it from scanning for devices and only scan manually. I tried disabling
Enable newly added entities.
If newly discovered devices for Bluetooth should be automatically added.
in the system options, but that does not stop the scanning.
Is there an progress regarding this issue? It seems there are no updates to get the bluetooth errors fixed. At the end on my side it influence all Bluetooth devices. Especially the Bluetooth Proxies are no longer reliable since weeks.
Logger: homeassistant.components.bluetooth.scanner Source: components/bluetooth/scanner.py:340 Integration: Bluetooth (documentation, issues) First occurred: 18:04:13 (24 occurrences) Last logged: 21:38:44
hci0 (C0:FB:F9:61:A9:68): Error stopping scanner: [org.bluez.Error.Failed] No discovery started
I am also still have the Bluetooth Problem (Just scanning activated, nothing else)
Please follow the issue in the operating system repo
Well thats happening with ubuntu with docker with ha-container. Not with HAOS in this case. So doing something like rolling back to HAOS 9.5 doesnt work for this. For reference for the others since it wasnt linked. https://github.com/home-assistant/operating-system/issues/2535
The problem is with bluez
and/or the linux kernel
so its not something can be solved in core (which is why we are still waiting for a solution).
So for the time being for anyone else in here this is what I have done to fix it for the time being. Works fine for me. You can find your entry id in /.storage/core.config_entries
alias: Bluetooth Debug
description: ""
trigger:
- platform: time_pattern
minutes: /5
condition: []
action:
- service: homeassistant.reload_config_entry
data:
entry_id: ***
mode: single
So for the time being for anyone else in here this is what I have done to fix it for the time being. Works fine for me. You can find your entry id in /.storage/core.config_entries
This fix did not fix my issue. I still have to unplug and reconnect USB Bluetooth dongle physically every couple of days.
Is there a way to power cycle the USB port from Home Assistant?
Is there an progress regarding this issue? It seems there are no updates to get the bluetooth errors fixed. At the end on my side it influence all Bluetooth devices. Especially the Bluetooth Proxies are no longer reliable since weeks.
Logger: homeassistant.components.bluetooth.scanner
Source: components/bluetooth/scanner.py:340
Integration: Bluetooth (documentation, issues)
First occurred: 18:04:13 (24 occurrences)
Last logged: 21:38:44
hci0 (C0:FB:F9:61:A9:68): Error stopping scanner: [org.bluez.Error.Failed] No discovery started
Is there an open issues for the proxies. I'm not aware of any unsolved problems with them
Yeea I am getting this now:
A message handler raised an exception: 'org.bluez.Device1'. Traceback (most recent call last): File "src/dbus_fast/message_bus.py", line 811, in dbus_fast.message_bus.BaseMessageBus._process_message File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 854, in _parse_msg condition_callback() File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 709, in callback self._properties[device_path][defs.DEVICE_INTERFACE][property_name] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'org.bluez.Device1'
I opened a PR to handle the case where the device is removed from the bus while we are waiting for a change https://github.com/hbldh/bleak/pull/1329
https://github.com/home-assistant/core/pull/99520 will fix the case where the device is removed from the bus while connecting. If the adapter itself it unstable, there isn't anything we can do about that though.
If you have an unstable adapter problem, please continue in https://github.com/home-assistant/core/issues/92379
The problem
So I have my Intel Nuc Bluetooth Adapter enabled to discover the values of my plant sensors. But the sacnner is always restarting for some reason some times resolving itself but also sometimes not so I have to press reload integration manually for it to work again.
What version of Home Assistant Core has the issue?
core-2023.5.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Bluetooth
Link to integration documentation on our website
https://www.home-assistant.io/integrations/bluetooth
Diagnostics information
config_entry-bluetooth-13ec0f89e00a8353c4df8e7ed7e10e7d.json.txt
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response