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:
framework:
type: esp-idf
Now arduino framework is used instead of esp-idf and your BT proxy should work again.