Device unavailable using bluetooth proxy

I’ve recently setup a ESP32 to run ESPHome as a bluetooth proxy. I used the online portal to flash the ESP32. The ESP32 was detected by my HA install automatically and subsequently detected my Xiaomi LYWSDCGQ which is showing up under the Xiaomi BLE integration.

Now after a few days the LYWSDCGQ is showing as unavailable, and I have no idea how to get it back. Ive tried power cycling the ESP32 and the LYWSDCGQ without success. Any ideas on how to get it back?

Unavailable where? In esphome or in home assistant?

Can you ping it?

The ESP32 is connectable, it’s the Xiaomi BLE sensor that isn’t.

Disconnect from the xiaomi app.

@PANiCnz could I see your code?

A few things to check.

We know it works because you set it up and it worked.

Check your logs on your esp32 bluetooth proxy and I think it may show a connection then a disconnection (connection closed) every 1 minute.

if so and you have another esp32 running or doing something else that is within bluetooth range try putting this in your code.

# For Bluetooth Proxy
esp32_ble_tracker:

bluetooth_proxy:

He used the online portal. The yaml is documented here. bluetooth-proxies/esp32-generic.yaml at 3d4b712885cd43f20d69d482d1d0ccc735ed5d34 · esphome/bluetooth-proxies · GitHub

I’ve removed all of the devices from HA and started again, so far so good.

I’m running version 2022.8.3 of the ESPHome addon in HA, but the ESP32 is reporting version 2022.9.0-dev. Is it safe to have the HA addon adopt the ESP32?

Pretty sure esphome 2022.8.2 and later have bluetooth proxy support. ESPHome 2022.8.0 - 17th August 2022 — ESPHome

By the way did you remove the device from the xiaomi app?

Never added it in the first place, or if I did it was a long time ago.

Sorry I misunderstood something you posted above.

Your log please. :slight_smile:

yes it should be fine

For the ESPHome proxies:

If you flashed your ESPHome proxy before 7:00AM UTC on Tuesday, December 13, 2022, please flash again as it should improve the connection times.

Please use the web flash tool below or ESPHome addon 2022.12.0b5 or later as the main line ESPHome addon does not yet have the connection time improvements or aarch64 flashing fix:
https://esphome.github.io/bluetooth-proxies/

If you use the ESPHome addon you MUST connect the device via serial to flash it or you will not see the performance improvements with active connections.

@bdraco If we have set it up manual through ESP home?

Install 2022.12.0b5 and flash with a serial cable.

Also be sure to use esp-idf framework instead of arduino