How to find new devices with esp32_ble_tracker when nothing appears in the logs

I recently wanted to add a new bluetooth device to an ESP32 and was stuck for a long time when trying to find the MAC address.

The Setting Up Devices documentation says that you just need to add esp32_ble_tracker: to your configuration and increase the log level and you’ll see the device details appear in the logs after installing the new config.

That worked for me a couple months ago, but after a recent ESPHome update, it was not working as described. The log showed that the tracker was scanning, but no results were appearing, even with VERY_VERBOSE logs. I tried tweaking all the options under esp32_ble_tracker: to no avail—still no devices were appearing in the logs. I then thought maybe I had a bad ESP32 board.

But I found a solution:

If you encounter this issue, you need to also add the following to your YAML to see the devices getting logged:

esp32_ble_tracker:

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

Then when you install the new config, the devices and MAC addresses will start appearing in the logs.

Find the one you want, copy the MAC address to complete your set up, and then remove the ble_scanner sensor from your config and re-install. You don’t want to leave the ble_scanner there since it will be updating constantly.

I’m just sharing this here since it took me ages to figure out and I think maybe the documentation is out-of-date.

20 Likes

thanks for sharing the solution, i also spent hours why it wasn’t working…so very glad to find your post

1 Like

Thankyou for sharing, this fixed my problem, and my Stamp C3s are busily reporting lots of traffic, whereas before it was silent for days…

PS: setting

logger:
   level: VERBOSE #or VERY_VERBOSE

also works

1 Like

I ran into this as well…

# This worked
text_sensor:
  - platform: ble_scanner
    name: "BLE Devices Scanner"

# This didn't make a difference for me
logger:
  level: VERBOSE #or VERY_VERBOSE
1 Like

Guys, its very easy to edit the docs and add this. I went ahead and submitted a PR for it, but please try to do this in the future.

1 Like

This thread helped me get the sensors identified and configured - the reference config at https://github.com/nagyrobi/home-assistant-configuration-examples/blob/aad4bec33fe6eea93558aa4d4ec3d4674cc58905/esphome/ble-sensors-ethernet.yaml was also super useful once I had the MAC addresses.

@flyize do you have the URL to that PR? I’d be happy to review if it’s still open! I looked to find it but couldn’t - this project has such an active PR queue! Which is great :slight_smile: