Home Assistant 2023.9.1 bluetooth dongle failed to set up after upgrade

My bluetooth dongle stopped working after HAOS recent update.
I removed the configuration of dongle from system and then re-add it (tried also with replugging) and logs are only saying:

Logger: homeassistant.config_entries
Source: components/bluetooth/util.py:78 
First occurred: 9:08:22 AM (6 occurrences) 
Last logged: 10:48:08 AM

Error setting up entry 04:7F:0E:28:58:FE for bluetooth
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 223, in _async_start
    await self.scanner.start()  # type: ignore[no-untyped-call]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 198, in start
    await self._backend.start()
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/scanner.py", line 185, in start
    self._stop = await manager.active_scan(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 383, in active_scan
    self._check_adapter(adapter_path)
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 209, in _check_adapter
    raise BleakError(f"adapter '{adapter_path.split('/')[-1]}' not found")
bleak.exc.BleakError: adapter 'hci0' not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 286, in async_setup_entry
    await scanner.async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 210, in async_start
    await self._async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 279, in _async_start
    await self._async_reset_adapter()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 364, in _async_reset_adapter
    result = await async_reset_adapter(self.adapter, self.mac_address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/util.py", line 78, in async_reset_adapter
    return await recover_adapter(adapter_id, mac_address)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 393, in recover_adapter
    if adapter and await _power_cycle_adapter(adapter):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 468, in _power_cycle_adapter
    return await _execute_reset(adapter)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 554, in _execute_reset
    power_state_before_reset = await adapter.get_powered()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 265, in get_powered
    response = await self.protocol.send("ReadControllerInformation", self.idx)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 153, in send
    with asyncio_timeout(self.timeout):
TypeError: 'Timeout' object does not support the context manager protocol

I’m using Home Assistant 2023.9.1

2 Likes

I’m seeing the same error. I’m using RPi4 hardware.

Logger: homeassistant.config_entries
Source: components/bluetooth/util.py:78
First occurred: 10:47:20 AM (4 occurrences)
Last logged: 10:50:58 AM

Error setting up entry E4:5F:01:02:8E:84 for bluetooth
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 223, in _async_start
    await self.scanner.start()  # type: ignore[no-untyped-call]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 198, in start
    await self._backend.start()
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/scanner.py", line 185, in start
    self._stop = await manager.active_scan(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 416, in active_scan
    assert_reply(reply)
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
    raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 286, in async_setup_entry
    await scanner.async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 210, in async_start
    await self._async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 279, in _async_start
    await self._async_reset_adapter()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 364, in _async_reset_adapter
    result = await async_reset_adapter(self.adapter, self.mac_address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/util.py", line 78, in async_reset_adapter
    return await recover_adapter(adapter_id, mac_address)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 393, in recover_adapter
    if adapter and await _power_cycle_adapter(adapter):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 468, in _power_cycle_adapter
    return await _execute_reset(adapter)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 554, in _execute_reset
    power_state_before_reset = await adapter.get_powered()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 265, in get_powered
    response = await self.protocol.send("ReadControllerInformation", self.idx)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 153, in send
    with asyncio_timeout(self.timeout):
TypeError: 'Timeout' object does not support the context manager protocol
1 Like

I’m seeing the same problem. Home Assistant Yellow and Sena UD100. Home Assistant 2023.9.1

Logger: homeassistant.config_entries
Source: components/bluetooth/util.py:78 
First occurred: 11:57:09 AM (1 occurrences) 
Last logged: 11:57:09 AM

Error setting up entry 00:01:95:8A:A4:21 for bluetooth
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 223, in _async_start
    await self.scanner.start()  # type: ignore[no-untyped-call]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 198, in start
    await self._backend.start()
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/scanner.py", line 185, in start
    self._stop = await manager.active_scan(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 416, in active_scan
    assert_reply(reply)
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
    raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 286, in async_setup_entry
    await scanner.async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 210, in async_start
    await self._async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 279, in _async_start
    await self._async_reset_adapter()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 364, in _async_reset_adapter
    result = await async_reset_adapter(self.adapter, self.mac_address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/util.py", line 78, in async_reset_adapter
    return await recover_adapter(adapter_id, mac_address)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 393, in recover_adapter
    if adapter and await _power_cycle_adapter(adapter):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 468, in _power_cycle_adapter
    return await _execute_reset(adapter)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 554, in _execute_reset
    power_state_before_reset = await adapter.get_powered()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 265, in get_powered
    response = await self.protocol.send("ReadControllerInformation", self.idx)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 153, in send
    with asyncio_timeout(self.timeout):
TypeError: 'Timeout' object does not support the context manager protocol

Reverting to 2023.9.0 allowed me to work around this issue for now.

Having the same issue. Rebooting HAOS fixed the Bluetooth problem for a few hours, but then it resurfaced.

This also means your bluetooth adapter is unstable and is having to be reset. There is a regression in the auto reset process in 2023.9.1 that is fixed in 2023.9.2 but the fact that the adapter is having to be reset means its offline during a reset. You can still do this manually by power cycling the adapter/host system.

I’d recommend switching to a high performance one from:

If you are wondering which one I use for production (and never have this problem), its: a Feasycom FSC-BP119 (CSR8510A10) https://www.aliexpress.us/item/2255799901392975.html https://www.aliexpress.us/item/2255800893640297.html


or and ESPHome proxy (these usually have the best connect times as well Bluetooth - Home Assistant)

For extended range, I also use the Olimex ESP32 Power-over-Ethernet ISO

I am hitting the same issue with the internal RPI 3 bluetooth component. Just after I updated to Home Assistant 2023.9.1.

Logger: homeassistant.config_entries
Source: components/bluetooth/util.py:78
First occurred: 3:59:53 PM (3 occurrences)
Last logged: 4:02:13 PM

Error setting up entry B8:27:EB:B1:B4:A6 for bluetooth
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 223, in _async_start
    await self.scanner.start()  # type: ignore[no-untyped-call]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 198, in start
    await self._backend.start()
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/scanner.py", line 185, in start
    self._stop = await manager.active_scan(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/manager.py", line 416, in active_scan
    assert_reply(reply)
  File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
    raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 286, in async_setup_entry
    await scanner.async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 210, in async_start
    await self._async_start()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 279, in _async_start
    await self._async_reset_adapter()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 364, in _async_reset_adapter
    result = await async_reset_adapter(self.adapter, self.mac_address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/util.py", line 78, in async_reset_adapter
    return await recover_adapter(adapter_id, mac_address)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 393, in recover_adapter
    if adapter and await _power_cycle_adapter(adapter):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 468, in _power_cycle_adapter
    return await _execute_reset(adapter)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 554, in _execute_reset
    power_state_before_reset = await adapter.get_powered()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 265, in get_powered
    response = await self.protocol.send("ReadControllerInformation", self.idx)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 153, in send
    with asyncio_timeout(self.timeout):
TypeError: 'Timeout' object does not support the context manager protocol