Bluetooth lost connection after one/two day

Hi everyone.
I have a problem with my bluetooth connection on my HA.
Every two day it loses connection.
I have HA Core Docker on Linux Debian. Zexmte bluetooth adapter.

If i restart linux the bluetooth works again but only for one/two day.
I have seen several open issues on Github with similar problems. But no solution.
How can I solve it?
This is the error:

Logger: bluetooth_auto_recovery.recover
Source: components/bluetooth/util.py:78
First occurred: 13 ottobre 2023 alle ore 21:32:36 (18836 occurrences)
Last logged: 18:52:58

Could not reset the power state of the Bluetooth adapter hci0 [8C:88:2B:61:2E:3A] due to timeout after 5 seconds
Could not cycle the Bluetooth adapter hci0 [8C:88:2B:61:2E:3A]: [Errno 1] Operation not permitted
Bluetooth adapter hci0 [8C:88:2B:61:2E:3A] could not be reset:
Closing Bluetooth adapter hci0 [8C:88:2B:61:2E:3A] failed: [Errno 9] Bad file descriptor

and

Logger: bluetooth_auto_recovery.recover
Source: runner.py:186
First occurred: 13 ottobre 2023 alle ore 21:32:36 (4709 occurrences)
Last logged: 18:52:53

Bluetooth management socket connection lost: [Errno 22] Invalid argument

Thanks
Luca

Hi, I’ve found this workaround to solve, partially, the problem.
In my Linux debian I modified this configuration file:

sudo nano /etc/default/bluetooth

Change the values ​​to these parameters

HID2HCI_ENABLED=1 ----- change from 0 to 1
HID2HCI_UNDO=1 ----- change from 0 to 1

While previously the connection was lost every 1/2 days, now it stays connected!

1 Like

Hello Luca
You say this solution solved “partially” the problem.
What was non solved?

I am experiencincpg similar issues with ZEXMTE connected to Debian 11 running a HA Supervised.

I am trying to test this integration https://github.com/alistair23/AutoMower-BLE?tab=readme-ov-file#automower-ble but the pairing process ends because of BT saying

Thanks

Hi GitWally, my solution worked for a few months, then I updated Debian and HA and the problems started again. I didn’t understand what triggered the problem. I’m eliminating all bluetooth sensors to stick to zigbee or wifi only.

I’d pick another adapter from the high performance list https://www.home-assistant.io/integrations/bluetooth/#known-working-high-performance-adapters or use an ESPHome Bluetooth proxy Ready-Made Projects — ESPHome

See the warning about the RTL8761BU based adapter you are using

These adapters do not have a reset pin. If they stop responding, there is currently no way for the kernel to reset them automatically. A generic USB reset for these adapters has been introduced in Linux kernel 6.1 and later.

Hi, unfortunately I abandoned Bluetooth due to known problems. I use zigbee or wifi.