I need to restart Home Assistant twice to make bluetooth work

Been having this issue since I updated to 2023.1.6 (had 2022.12 before).

Whenever I restart HA the bluetooth integration cannot start properly, which causes some other integrations that depend on that to fail as well.

2023-02-02 18:37:10.432 ERROR (MainThread) [homeassistant.setup] Error during setup of component bluetooth
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.9/site-packages/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/home/pi/.local/lib/python3.9/site-packages/homeassistant/components/bluetooth/__init__.py", line 176, in async_setup
    await manager.async_setup()
  File "/home/pi/.local/lib/python3.9/site-packages/homeassistant/components/bluetooth/manager.py", line 205, in async_setup
    self._all_history, self._connectable_history = async_load_history_from_system(
  File "/home/pi/.local/lib/python3.9/site-packages/homeassistant/components/bluetooth/util.py", line 31, in async_load_history_from_system
    ] = BluetoothServiceInfoBleak.from_device_and_advertisement_data(
AttributeError: type object 'home_assistant_bluetooth.models.BluetoothServiceIn' has no attribute 'from_device_and_advertisement_data'
2023-02-02 18:37:12.869 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of thermopro. Setup failed for dependencies: bluetooth
2023-02-02 18:37:12.874 ERROR (MainThread) [homeassistant.setup] Setup failed for thermopro: (DependencyError(...), 'Could not setup dependencies: bluetooth')
2023-02-02 18:37:24.803 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: bluetooth
2023-02-02 18:37:24.804 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: bluetooth')

If I try to restart a second time I get no error and the integration works as expected.
Tried to restart but I still have the same problem at the first start

It could be a poor performance BT adapter and/or an integration that lock the device exclusively, so no other devices there after can access it.

Sounds plausible, but then it wouldn’t explain why it started happening once I updated…just a coincidence?

I only have 1 device that uses the bluetooth integration and no other integration that uses bluetooth, at least that I know

There have been several changes to how bluetooth is used under HA, so there can easily have been changes that affected your setup.

Reinstall this package. You have an out of date version

Nope, I have 1.9.2 which is the latest version.

It seems I have suddenly an AirTag integration that require Bluetooth access, so maybe that is the one Messi g it up for you.

Was my thought as well but there are no other integrations that use bluetooth besides the Thermopro integration in my setup :frowning: