Having a Hard Time setting up the iBeacon Tracker

Hey there,

I am becoming a little bit frustrated setting up the new iBeacon integration. Hopefully someone can help.

Setup

I use three ESP32s which I set up using ESPHome to work as Bluetooth proxies and BLE trackers. This is the important part of the config in ESPHome:

# Enable Bluetooth proxy for Home Assistant
bluetooth_proxy:
  active: true

# Configure BLE Tracking
esp32_ble_tracker:
  scan_parameters:
    active: false #(also tried true!)

HA is running on a Pi4 (Hass OS):

Home Assistant 2022.10.1
Supervisor 2022.09.1
Operating System 9.0
Frontend 20221006.0 - latest

The internal BT and Wifi of the Pi4 are deactivated because the connection was always very unstable.

As a beacon I use the BLE-Transmitter of the Android Companion App.

Problem

The iBeacon Tracker will only detect a change once when one of the follwing sutiation applies:

  1. The BLE-Transmitter is turned off and on again or a setting (like Transmitting Power) is changed
    → Will update the entity in most cases

OR

  1. One of the ESPs in range is being reset (power cycle or OTA update)
    → Works sometimes but not very often

This is extremely frustrating and I just don’t know what’s wrong. Does anyone have a solution for this?

Thanks in advance!

Try using transmit power high in the transmitter settings if the Android app.

Unfortunately this doesn’t change anything. The device is recognized once whne I change the setting but becomes unavailable again about three minutes later.

i have a few devices like that and they get picked up again a few minutes, I think its some kinks in the integration. Make sure the android app has permissions to run in the background and any and all battery optimization settings are turned off for the companion app

Yeah, this is all the case.

I hav activated the verbose logging on one of the ESPs and see this message pretty often:

[esp32_ble_tracker:772]: Unhandled type: advType: 0x08

Maybe that’s an issue?

Edit: Well, the message does also appear if the transmitter is not active. So it’s probably soemthing else.

try checking the companion app logs when the issue occurs, you should see messages about the advertisement when it starts and stops

There is only one message regarding this in the logs:

BeaconTransmitter: Advertisement start succeeded.
1 Like

what device do you have the app on?

on my amazon tablet this is what the graph looks like

image

the gaps seem to be about 15 minutes or so

now when I use the beacon monitor sensor from another device I don’t see any gaps so the transmitter seems to be fine

Yeah, this seems to be the same problem.

I am using a Xiaomi Mi Mix 3. I know this device does indeed send the beacon signals in correct intervals when activated in the companion app because I used this feature with room assistant before. So the issue must be related to the iBeacon Tracker integration.

1 Like

Another interesting fact:
If I go to the integrations page and reload the integration (three dots menu), the sensor updates and shows the correct distance to the correct ESP32. If I do this over and over again, I see that the beacon is received and forwarded just fine by the ESPs. It’s just the integration that simply won’t update the entities and after a while simply sets them to unavailable/not_home.

Edit: This worked for some time but now it does not have any other effect than resetting the time counter of the entity state.

looks like a PR is already in place for this

Yeah, this might be a partial solution but I think in the end it will be an issue of the iBeacon Tracker - not BT itself or ESPHome.

Mine has developed a fault. It seemed to be fine under 2022.10.1 the beacon would show as available & Home/Away. Now with but now under 2022.10.2 only shows as unavailable. I know the beacon is working as my phone app can pick it up. I’ve rebooted and reinstalled the proxy on the ESPHome. Nothing.

I switched to the other approach entirely. I activate the beacon monitor on my devices when they enter the home zone and check for the received UUIDs of the ESPs which I now configured to work as beacons.
The downside is that I had to handle everything on my own but at least ist works now.
I check for the closest beacon and if it is lower than a minimum distance for a beacon a sensor entity saves the room.
Actually it’s not much more than a sensor entity and a simple function node in Node Red.

15min is the default update time for sensors in companion app.

Those gaps are not related to sensor update frequency

The problem still persists. I tried it using the latest HA and app version. Distance and Source will only be updated when I disable and reenable the transmitter. Obviously the app does not send the beacon frequently (set to low latency and high power) or the entity does not update for some other reason.

I have to bring this up again. The BLE Tracker in combination with ESPs is totally broken for me.
The entities will only but always be updated when I change an iBeacon setting (like advertise mode, transmitting power…) in the companion app.
It will then immediately update but give me ANY ESP in range as the source. Not the closest one. This is 100% useless and actually makes me really angry by now! Room presence is not a thing at all for me now.

Hi Garvin, is your scope to use ESPHome BT proxy / BLE tracker for room presence ?

Yes. I wanted to use an ESP in each room in combination with the iBeacon Tracker component to create a room presence detection. But this won’t work at all.

Let me explain the situation.
I have four rooms on the same floor, each with an ESP32 running Bluetooth Proxy and BLE Tracker.
When I start the BLE-Transmitter sensor on my Android phone, one of the Trackers will find my phone immediately. The problems are:

  1. The device will be detected by a random tracker in range. I suppose all trackers find the device but the iBeacon Tracker just doesn’t care which one has the best RSSI and just picks the first one reporting the device.

  2. The device will not update until I change BLE-Transmitter settings on my phone. Disabling and reenabling the transmitter, changing advertise mode or transmitting power for example will trigger an update right away, but moving around does not trigger any change.