Do not use ESPHome Ready-Made Projects Bluetooth Proxy in Home Assistant!

It’s a little strange that such important information is not available anywhere, but “never say never” - maybe it is available but I just couldn’t find it with a simple search.

Anyway, for all those who encounter the same annoying problem.

A little while ago I had a need for a bluetooth proxy. So I went to the ESPHome Ready-Made Projects page and installed the bluetooth proxy I needed. Unfortunately, I immediately started getting error messages in the esphome log.
It discovered device but was unable to connect.

`[11:14:22][I][esp32_ble_client:067]: [0] [00:A0:40:EF:35:66] 0x00 Attempting BLE connection
[11:14:22][D][esp-idf:000]: W (6091062) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[11:14:23][D][esp-idf:000]: W (6091692) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[11:14:24][D][esp-idf:000]: W (6092337) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[11:14:24][D][esp-idf:000]: W (6093102) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x3e

[11:14:24][D][esp-idf:000]: W (6093107) BT_APPL: gattc_conn_cb: if=4 st=0 id=4 rsn=0x3e

[11:14:24][D][esp-idf:000]: W (6093110) BT_APPL: gattc_conn_cb: if=5 st=0 id=5 rsn=0x3e

[11:14:24][D][esp-idf:000]: W (6093114) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e

[11:14:25][D][esp32_ble_client:172]: [0] [00:A0:50:EF:35:1E] ESP_GATTC_DISCONNECT_EVT, reason 62`

I couldn’t find any help for these errors anywhere. I knew the Home Assistant bluetooth works but the proxy doesn’t. It seemed very ESPHome bug. Since I had no solution here, it seemed that the project would simply remain unfinished.
Since I don’t like things that I don’t know what they contain, I eventually went to the esphome page firmware/bluetooth-proxy/esp32-generic.yaml at f9290e1925a3840ef5fc43a5ec5dcb2c704b2d7f · esphome/firmware · GitHub and actually looked into this. This was the place where I had a “eureka” moment.

If you use ESPHome bluetooth proxy in Home Assistant, YAML configuration must (at least at the moment) be entered manually!
When using BT proxy in Home Assistant, in the YAML must be removed lines:

    type: esp-idf

Now arduino framework is used instead of esp-idf and your BT proxy should work again.

Sounds like an issue unique to your device, as ESP-IDF is recommended per the BT Proxy docs.

Did you maybe not flash it initially via serial?

Usually I use the Esphome Web, device connected to USB, after that OTA. There must be something in ESPHome side bcs all the time device was discoverable directly with HA bluetooth. So there must be a technical difference there. Nor is I smart enough to know if there may be differences in the BT device side that could cause such problems.
As I said, hopefully this is solution to all those who encounter the same annoying problem.

What esp board are you using?

Proxy works only ESP32 so I have that. But on chip is written ESP32-WROOM-32D

Thats a common misunderstanding. Yes, technically you have an esp22, just like I own a “car”. Esp32 is the series and a broad term that covers the entire variety of esp32’s each with a specific name that follows “esp32”

You should really be including the specific board on any future posts and then people can better help you and also not have to wait around for an answer. It’s not always the case, but a lot of times the specific board matters and is an important detail.