ESP32s Bluetooth Proxy not working (?)

Seems to have compiled and flashed, but still not seeing any devices being discovered.

Is this code correct?

substitutions:

  name: esp32-bluetooth-proxy-202a44

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

esp32_ble_tracker:

  scan_parameters:

    interval: 1100ms

    window: 1100ms

    active: true

bluetooth_proxy:

  active: true

I had no luck with the bluetooth proxy, and I wound up installing openmqttgateway on the same device that you have, and instantly found tons of stuff available via BT.

2 Likes

same problems. I’m a newbie but I’d be glad to take advice. :slight_smile:

To see these device details add the below to your yaml

text_sensor:
  - platform: ble_scanner
    name: "BLE Devices Scanner" 
1 Like

Thanks, did that for test, but it seems that this sensor causes module to reset every minute or so… strange. When i removed it module stopped resetting. Maybe too much data…? IT did show connected BLE’s though.

I have finally got mine working - removed all my BLE devices I had intergraded prior > turned off all other Bluetooth integrations > device started showing up!

The text sensor and the verbose logs only show (address, rssi and name)

turned on

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

in configuration.yaml and can confirm advertised device data is reaching home assistant

2022-10-23 18:53:21.210 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] gl-s10-bt-proxy-1: xx:xx:xx:xx:xx:xx AdvertisementData(local_name='ATC_4BAHSN', service_data={'0000181a-0000-1000-8000-00805f9b34fb': b'\xa4\xc18K\xbd\x1f\x00\xe8@2\nfA'}) connectable: False match: set() rssi: -80

hm…
you got me here for a while…

i inserted above lines in ESPHome, but got a bunch of errors. ESPHome won’t accept individual logs to be set higher than general, only lower, and also option" default: logger" is not known to ESPHome’s compiler.

Well, after reading again i see that you inserted these lines in Home Assistant, not ESPHome… now it works, yes. However, it’s not seen which proxy device received and sent BLE module to HA, i can only see that it does come into HA. Also, it’s interesting that some modules have “False match” and some “True match”… whatever this means.

But, do you know where to look these logs other than in Studio Code Server (file home-assistant.log)? I can’t find it in HA’s interface…

Yeah sorry, configuration.yaml in ha!

Only other place would be in ha settings under logs (HA core) then look at the full logs there.

It seems this intergration needs to mature a bit.(which is understandable) In regards to user visibility of the source transmission of data (ie proxy delivering the data) which would ensure we are not all thinking that things are not working, when indeed they are!

I tried to create the bluetooth gateway today via the ESPhome website.
I see the device in my home assistant but it doesn’t detect any bluetooth devices.

Home assistant is on 2022.12
ESP32 wemos d1 mini with fresh install from the esphome website.

My openmqtt gateway detects the bluetooth devices immediately. The mqtt gateway is not active during the tests but I can’t see devices.

How can in troubleshoot this ?

Config file

substitutions:

  name: "esp32-bluetooth-proxy-1"

  device_description: "Bluetooth proxy"

packages:

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

esphome:

  name: ${name}

  comment: ${device_description}

  name_add_mac_suffix: false

esp32:

  board: wemos_d1_mini32

  framework:

    type: esp-idf

    version: latest

# Enable logging

logger:

  level: DEBUG

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

How do you know that it doesn’t detect nothing? Through esp’s log output? Default log won’t say anything about BT, you must set log to verbose, only then you’ll see if any BT devices are proxying to HA.

I don’t see devices in HA so yes I’m not sure if the gateway works and that it is maybe the connection to HA.
Will test verbose.

Tested the verbose setting and it looks the gateway works but not the integration to HA

[09:27:27][V][esp32_ble_tracker:781]: Unhandled type: advType: 0x1b
[09:27:27][V][bluetooth_proxy:020]: Proxying packet from [LG] webOS TV OLED65CX6LA - 58:88:27:56:DE:65. RSSI: -93 dB
[09:27:27][V][bluetooth_proxy:020]: Proxying packet from Raspberry Pi 3 Model B Plus R - 43:45:C0:00:1F:AC. RSSI: -94 dB
[09:27:27][V][bluetooth_proxy:020]: Proxying packet from ATC_D9F1B4 - A4:C1:38:D9:F1:B4. RSSI: -70 dB
[09:27:27][V][bluetooth_proxy:020]: Proxying packet from Raspberry Pi 3 Model B Plus R - 43:45:C0:00:1F:AC. RSSI: -91 dB
[09:27:28][V][bluetooth_proxy:020]: Proxying packet from Raspberry Pi 3 Model B Plus R - 43:45:C0:00:1F:AC. RSSI: -91 dB
[09:27:28][V][esp32_ble_tracker:781]: Unhandled type: advType: 0x1b
[09:27:28][V][bluetooth_proxy:020]: Proxying packet from [LG] webOS TV OLED65CX6LA - 58:88:27:56:DE:65. RSSI: -95 dB
[09:27:28][V][bluetooth_proxy:020]: Proxying packet from ClearGrass Temp & RH - 58:2D:34:10:B5:E3. RSSI: -73 dB

Then you must install/find appropriate integration. An example: xiaomi thermo/hygrometer: you need BTHome integration. etc… and if you have custom FW (ATC, PVVX) you need to configure “bthome” in fw’s configuration, otherwise it won’t be selfdiscoverable.
I guess that ESP module is proxying all it can find, but not all is perhaps discoverable by HA (at least automatically). At least now you know that proxy is working.

Tried to add the bthome integration but it says “no devices found on the network”. It doesn’t installas far as I see.

I use the Xiaomi device that I added long before HA had a Bluetooth proxy. I don’t know what I need to change in the custom firmware to make it discoverable by my new proxies?

It finally looks to have found my cleargrass sensor but it doesn’t detect the flashed LYWSD03MMC sensors. so one step closer but not there yet

For LYWSD03MMC with custom fw: I’m not sure if atc firmware has this option, i know that latest pvvx fw has it: goto Telink flasher, then find your xiaomi, connect to it and select advertising type “bthome”.
If atc doesn’t have this option then change fw to pvvx (it’s just somewhat modified atc). If you have an old pvvx fw it also doesn’t have this option, then update your fw.

1 Like

jumping from one problem to another.
Flashed the pvvx but the sensor doesn’t want to open the config. In very rare situations it succeeds but disconnects shortly after. When connecting the display flashes very fast and for a long time and now and then crashes. Get a large number on the screen en lo where the humidity percentage normally is.
When I try to reflash it i get the error “update: error: NotSupportedError: GATT Error:unknown”

Just found the problem. When connecting to the pvvx flashed devices, the battery % drops from 43% to 0% making the connection disconnect, unstable and even does the device to crash.

After some new batteries, I can connect to the device and chante the advertising to bthome and yes as soon as I disconnect the programmer, the devices pops up in home assistant.

So many thanks for helping me out. Your suggestion was the solution.