BT proxy detecting devices but nothing found in HA

I have two esp32 devices configured like so for BT proxy (names different ofc):

substitutions:
  name: bt-proxy
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
  fast_connect: true

logger:
  level: verbose  

As far as I can see both are connected to esphome and working but if I unplug the first esp32 and leave only the second one plugged in, nothing works (I have some switchbot curtains which go unavailable when just the 2nd bt proxy is plugged in)

For this second esp32, in the log I can see it finding all sorts of devices however nothing is being passed to HA:

[15:34:31][C][ota:089]: Over-The-Air Updates:
[15:34:31][C][ota:090]:   Address: bt-proxy.local:3232
[15:34:31][C][api:138]: API Server:
[15:34:31][C][api:139]:   Address: bt-proxy.local:6053
[15:34:31][C][api:143]:   Using noise encryption: NO
[15:37:58][V][bluetooth_proxy:026]: Proxying packet from  - 5D:6D:F0:xxxx. RSSI: -86 dB
[15:37:59][V][bluetooth_proxy:026]: Proxying packet from Smart Tag - 5F:4D:0D:xxxx. RSSI: -54 dB
[15:38:01][V][bluetooth_proxy:026]: Proxying packet from  - 4D:35:E6:xxxx. RSSI: -72 dB
[15:38:02][V][bluetooth_proxy:026]: Proxying packet from  - 5D:6D:F0:xxxx. RSSI: -77 dB

As far as I can tell the 2nd BT proxy doesn’t send anything to HA even though it is working correctly?
I would have assumed that any BT proxy in the vicinity can control the switchbot curtains for example or once connected to the first one they will only respond to that BT proxy? Silly if that’s the case

you need this in your code.

# For Bluetooth Proxy
esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true

my understanding is they pick the best signal.

I don’t as that is being added already by the linked yaml so it is there already:

As the first esp32 device works just fine with that exact same code.

Must have it… this is the link you provided and it also has the info. Can’t work without it. Below is the link code you provided.

substitutions:
  name: esp32-bluetooth-proxy
  wifi_ap_password: ""

esphome:
  name: ${name}
  name_add_mac_suffix: true
  project:
    name: esphome.bluetooth-proxy
    version: "1.0"

esp32:
  board: esp32dev
  framework:
    type: arduino

wifi:
  ap:
    password: ${wifi_ap_password}

api:
logger:
ota:
improv_serial:
captive_portal:

dashboard_import:
  package_import_url: github://esphome/bluetooth-proxies/esp32-generic.yaml@main

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

bluetooth_proxy:
  active: true

button:
- platform: safe_mode
  name: Safe Mode Boot
  entity_category: diagnostic

The esp32s were created using the BTproxy online tool: ESPHome Bluetooth Proxy
So that code above was added by the online tool, I just added the logger to see what it is doing.
One works, the one second doesn’t, same code.
Am I missing something?

Unless this device is just not working/not supported?

What devices are you trying to proxy? Have you tried enabling debug logging for homeassistant.components.bluetooth?

Switchbot curtains, which have been paired ok with one esp32 device so maybe it only works with that esp32 now not with others which I have around the house?
I thought any BT proxy would be able to send commands to any of the added integrations but maybe not?

Depends when you did it as they have updated ESPHome and changed the code. See

If you have the correct code then :+1: you should check it by using ESPHome in HA. Using the online tool only installs the Firmware at the time of install. They could be out of date.

Assume you have the latest ESPHome (Current version: 2022.10.0) and you have updated the devices. That is important… you need to make sure you have update the devices (ESP32) with the latest firmware. Try clean build files and install again.

Once you have done that and you are still having problems then check connectivity of your Wi-Fi to the ESP32. You may want to get a Olimex ESP32 Power-over-Ethernet ISO.

It doesn’t work like that it finds the best Bluetooth connection. There is no pairing. I think Switchbot works better with Olimex ESP32 Power-over-Ethernet ISO… or a ESP32 with direct Ethernet connection.

Yes it can.

You could also try getting a ZEXMTE BT-505 adapter with -63 RSSI and a USB extension cable.

this also may help

also have a look at troubleshooting & interference

So it turns out both devices do in fact work. I was able to use ibeacon integration with the second esp32 just fine but what does not work is the second esp32 to control switchbot, as soon as the first esp32 is unplugged switchbot integration goes unavailable so it must be paired to just one device or something?
Using Esphome 2022.10 and latest FW builds, cleaned them a few times.
Swtichbot works flawlessly only when the first esp32 device is switched on :man_shrugging:

Are they the same ESP32 or is one a ESP32-C3?. ESP32-C3 don’t work.

Maybe if they are different ESP32 it could be just that one ESP32.

Can the switchbolt reach the second esp32

I think they are having issues with switchbot.

Some BT devices only like to be connected to one thing at a time but if you disconnect it from the ESP32 it should connect to the other one so long as it is within range. It must be a switchbot thing.

They are both ESP-WROOM-32 but slightly different
1st esp32 - connected to switchbot
2nd esp32
So yeah I guess it might be a switchbot thing then

I think it is the ESP… if you have 2 of the same type as the first ones try that or try another different one for the 2nd.

Just those two so far but I do have one of these on the way AZ-Delivery ESP-32 Dev Kit C V4 — PlatformIO latest documentation
But not sure if it’s even supported.

I have about 20 of these and they work well. It has got a addressable led and a button that is handy for extra options.

I also got about 5 of these… they work but for what we do they are not really necessary

Yeah I was going to go for a few atoms lite but running out of IPs in my network with everything being smart now so I am hoping to do a bit of 2-in-1 with the BT proxy and multi sensor ESP device.

Surprise surprise 520kb ram one not working either - I guess impossible run screen and BT proxy on esp32

[17:18:19][D][esp32_ble_tracker:264]: Starting scan...
[17:18:19][C][wifi:037]: Setting up WiFi...
[17:18:19][D][esp-idf:000]: E (2517) wifi:
[17:18:19][D][esp-idf:000]: Expected to init 16 rx buffer, actual is 6
[17:18:19][D][esp-idf:000]: 
[17:18:19]
[17:18:19][E][WiFiGeneric.cpp:137] wifiLowLevelInit(): esp_wifi_init 257
[17:18:19][W][wifi_esp32:057]: Setting WiFi mode failed!
[17:18:19][D][wifi:384]: Starting scan...
[17:18:19][E][WiFiGeneric.cpp:137] wifiLowLevelInit(): esp_wifi_init 257
[17:18:19][W][wifi_esp32:057]: Setting WiFi mode failed!