iBeacon and Android companion app for proximity tracking

Well, its working for my primary objective… But only thanks to quite a few conditions in an automation.

It was for the garage to close when the ESPrensense would detect my phone’s ibeacon. And for that initial ‘contact’ it does, in fact, work perfectly.

But it’s still quite inconstant, probably because of some EMUI interference:

If I try a Lenovo’s tablet, for instance, there’s no problems, at all, with the connection.

Is anyone else having issues on Anxroid? My phone gets discovered fine but, although my UUID and min/max are set, my device keeps showing unavailable and then a new entity is created. So now i have 6 unavailable devices for my 1 phone.



When it gets to 10, they will all be merged and it should start tracking the merged one. Its due to your phone using random hex addresses when advertising.

I just figured that out today or atleast the setting for random IP mac setting being turned on. I switched it from Random to the only other choice of Phone. I saw what your referring to in the docs but I didn’t see anything about how long. Do you have any idea how long the period is for the 10 devices with same UUID and min/max?

I have a similar question, what steps are required to make home assistant iBeacon integration detect my phone?

  1. Bluetooth running fine
  2. IBeacon integration installed, but does not report anything.
  3. HA companion app, sensor BLE transmitter enabled
  4. Updated values Major = 1000, Minor = 2000 (for what it’s worth?)

I assumed HA would detect this beacon now, right?

The additional sensor “Beacon monitoring” is for the phone/app to track other beacons, not be the beacon itself.

ESPPresence does work and detect the beacon from the companion app, but I would like to switchover to these native intergrations.

1 Like

It seems to be depending on the phone you are using. I’m currently facing a similar issue Link

What kind of phone are you using? I have 2 S22 Ultra devices and both are not detected.

My setup created 10 devices for my phone in around 2 hours. I just left it, and went back and 10 had become 1 automatically. That said, it still isn’t the most reliable system, for me and a few others. Take a look here: ESPHome with bluetooth proxy and iBeacon integration · Issue #79781 · home-assistant/core · GitHub. Don’t know if it is the bluetooth proxy or ibeacon integration that is to blame.

It makes sense that it depends on the phone type/brand. I would guess that some phones change their uuid more slowly, so it takes longer for the iBeacon Tracker integration to collect ten different uuids from the same MAC/phone.

I wonder also if some phones might be “recycling” uuids? If so, those reused uuids would not be considered unique by the integration, and therefore not added to the count.

Is there a chance that this process could be logged somehow?
I mean, my phones are transmitting signals since roughly a week, so it should be enough time to send 10 UIDs or am I wrong?

If we could see that the phone is reaching the tracker and maybe we could even see which ID is used/recycled, somebody might be able to adapt the code accordingly.

Thanks.

I was going to say you could use an app like LightBlue to watch for the phone’s MAC, which you can do, but I just checked, and it doesn’t show the UUID(s).

There’s probably a way to write a little sketch for an ESP32 to scan for a specific MAC (your phone’s fixed MAC) and then to log the UUID(s) associated with that MAC over time, but that requires some coding skill and maybe a bit of an overkill for this question.

Maybe you could do some research into your specific phone to see what the manufacturer says about this issue?

I realized that if I reboot my phone and open Ha app, it generates a new beacon. If you do It multiple times after the 10th time your device will Be finally recognized as unique. It shorten the process.

I’m using ESPHome bluetooth_proxy. As I can see in iBeacon Tracker integration has new entity of my phone with HA Campanion App each time after phone get Away from tracker.
The entity contains:
UUID
Major
Minor
4 digits of MAC
Because Android phone randomize bluetooth MAC we have each time new entity, which is not very convenient. Any ideas?

After 10 times it will just keep one iBeacon and you can stable using it.

Hello again,
I tried to implement the solution using cheap beacons (the ones mentioned in my first post, unfortunately it seems that their power isn’t strong enougth to be received by my phone.
I have another idea, but I don’t know if it will work…
Can I use a ESP32 with beacon emulation and position it two floors above, outside my appartement near the window.

The questions I have is:

  • Do you think the range will be sufficient?

  • Can I enhance the range of the ESP32 with an antenna?

Thanks in advance for any help. The final goal is to trigger the door to open when my phone is seen in a specific area of the street in front of the building door (yellow area → Radius of 1m?)

I have that setup currently.
Our window is probably 4-5 m from the door.

The ESP has a range of much more than that. It has triggered at 20+ m sometimes.
Typically it triggers between 8-15. And sometimes it doesn’t trigger at all in time but only when I have got up to our apartment.
My plan is to expand the beacons and place a few outside and perhaps that can help triangulate us as we get home.

But there is a bug with the beacon monitor Beacon monitor remembers values from when it was disabled · Issue #3010 · home-assistant/android · GitHub that really limits the use of it.
A radius of 1 m is very optimistic. You can probably set it to detect when range is less than x m, but since the accuracy is not perfect then I doubt you can get it that good.

1 Like

I don’t understand this.
My phone is using random UUID, right.
But the HA companion app send a static/solid iBeacon id. That remains the same, even after reboots.

I also use ESPrecense and see both random UUID and the steady iBeacon from the app. The beacon I’m tracking for 6+ months and keeps the same. However, the same phone, same app, same iBeacon is not picked up by the iBeacon tracker. Why is that?

1 Like

Same here. Within the last months, the integration collected just a couple of unknown devices and directly claimed that those ‘are no longer supported’ and I could delete those entries.
I’m asking myself, why are they unknown and why found in the first place if they are not supported anymore. Just my phone is not found and this is sad.

I simply think that this feature is not yet ready or simply designed for iOS devices. So I decided to stop trying to get it to work and wait for an update.

I banged my head with this for weeks and then I found Espresense. It’s way better and it just works. It’s designed to work with HA so there’s no complicated setup and best of all it 100% tracks my Android and the multiple IPhones in my house. I highly reccomend it and you can find guides right here in the forums.

I bought the BT stick just for this purpose and I guess I’ll wait for the one fits all solution - otherwise I’ll run out of USB ports :wink:

Just as an update: It is still not working for me, so I guess I need to unplug the BT stick from the system to save some energy :wink: