ESPHome BLE proxy stopped working

I had set up a couple of ESP32s with bluetooth proxy, I had a Xiaomi Plant Sensor and a couple of Airthings Wave integrated through them, and all was well in the world.

Last I looked though, they no longer worked (there had been a few updates to HA/ESPHome since I last checked in, so can’t say exactly what happened when they stopped working). I tried re-installing them both from ESPHome dashboard and via the esphome github page.

This was the last working config used
substitutions:
  name: esp32-bluetooth-proxy-01-4d83b0
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false

api:
logger:
ota:
improv_serial:
captive_portal:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true

I’ve also tried with the config listed here (without the ethernet section, and changing the board to esp32dev).

I can see that the BLE devices are still active and broadcasting (Bluetooth scanner on phone picks them up just fine), and the devices are very close (centimeters, not meters) from the nearest ESP32.

With:

logger:
  default: info
  logs:
    homeassistant.components.bluetooth: debug

in config.yaml, the only mentions of bluetooth in the logs are:

2022-12-20 09:47:19.214 DEBUG (MainThread) [homeassistant.components.bluetooth] Triggering bluetooth usb discovery
2022-12-20 09:47:24.231 DEBUG (MainThread) [homeassistant.components.bluetooth] Rediscovered adapters: {}

Any idea how to get this working again?

2 Likes

Update: I can see that sometimes when I flash from the ESPHome website and adopt, it briefly finds the BLE devices and report data tot he sensors, but the disappears, and never returns again.

I’m guessing it’s “sometimes” since it has to fit with the flash/boot/adopt/whatever happening when the devices report data, which I think it about every 5 minutes.

But after a few seconds to minutes, the reporting is gone, and the bluetooth device shows as “unavailable” again forever.

Any luck with getting your bluetooth devices to stay connected? I have a similar problem with some Triones BLE LED’s. They’ll connect for a while then they go unavailable despite having an ethernet proxy about 6 feet away from it. Once they go unavailable they’ll be like that for days. Sometimes a combination of restarting HA or pulling the plug on the proxy might help but not always. Just wondering if you had any luck finding a solution.

Unfortunately not. Well, not without restarts, re-flash, or the like. It doesn’t ever “just work”.

But please do update if you find a solution.

Are you using the latest esphome? I am on 2022.12. The esp32 freezes before when there are too much components enabled especially web server part. Try to have a bare esp configuration and disable the active proxy.

Could you expand a little more on your response of a bare esp and disabling the active proxy? I am currently on 2022.12.3 of esphome and have 2 ethernet proxies setup trying to connect with 2 BLE LED’s. The config is what was added when I originally set them up. One seems to connect flawlessly while the other is almost never. I would think disabling the active proxy would break the connection or never connect. I am stumped why one works so well and the other not so much

@accelle, Could you share that config? If I don’t change anything after flashing via the ESPHome Bluetooth Proxy Installer website, it fails for me.

so something like this fails
substitutions:
  name: "ble-proxy-02"
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

If I try to manually install from HA UI using the content in the link that is used by the ESPHome website installer (link here), I can’t adopt after flashing. And without being able to manually put in the config (i.e. if using the ESPHome website installer), I can’t change the bluetooth_proxy = active, and since this is all pulled from the github link.

I found the same problem a couple weeks ago. Neither flashing from the website or ESPhome works. The same issue is reported here on git. Bluetooth-proxy doesn't work for HA anymore · Issue #3951 · esphome/issues · GitHub

1 Like