core: Bluetooth LE sensors frequently unavailable
The problem
I have a bunch of Xiaomi Mijia (LYWSD03MMC) climate sensors throughout my house flashed with the ATC firmware using the HA BLE format. Up until 2022.9 I was using the custom integration Passive BLE Monitor to integrate them all into HA. When using the custom integration I never noticed my sensors being unavailable, but since switching to the new BT Home integration they are constantly becoming unavailable.
What version of Home Assistant Core has the issue?
2022.9
What was the last working version of Home Assistant Core?
n/a
What type of installation are you running?
Home Assistant OS
Integration causing the issue
BT Home
Link to integration documentation on our website
https://www.home-assistant.io/integrations/bthome
Diagnostics information
Not available for BT Home
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Nothing BT Home or bluetooth related
Additional information
Screenshot to show frequent gaps in availability for one of my sensors.

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 60 (33 by maintainers)
Commits related to this issue
- Automaticlly determine the advertising interval for passive bluetooth devices fixes #78702 fixes #79178 fixes #78195 fixes #78380 — committed to bdraco/home-assistant by bdraco 2 years ago
It is still going well, and I already count this as a record. I trust it has been solved. I apologize for wasting your time @Ernst79 and also for hijacking this issue. 😦 Would be great if @CZonin is also using BLE monitor in parallel and active scanning would solve his issue as well.
Running BLE monitor and the Bluetooth integration at the same time can be problematic. Try to set BLE monitor to “active scan” to have at least both integrations running in the same scanning mode.
BLE monitor sets the BLE scanner to passive scanning, while the Bluetooth integration uses active scanning (on most systems). This will confuse the adapter, so try to use both integrations in the same scanning mode.
BLE monitor normally wins this battle, so that could explain why BLE monitor continues to work and the xiaomi-ble integration not.