iBeacon to MQTT Wireless Receiver (Is there a better way?)

I bought a few of these keychain iBeacons, and one of these AprilBeacon iBeacon Wireless Receivers and configured it to connect to Mosquitto. The JSON data, as described in the wiki, has all of the UUIDs semicolon-separated in a single key named “raw_beacons_data”

The way I parsed the data was to create a sensor like this, and used the MAC address and UUID as a unique identifier.

platform: mqtt
state_topic: “/beacons”
name: “My iBeacon”
value_template: ‘{% if “987AF32E05765A4BCFCE174E4BACA814092E77F6B7E5” in value_json.raw_beacons_data %} home {% else %} not_home {% endif %}’

I could then add this in a group to see the state as “home” or “not_home” and act accordingly in automations.

sensor.my_ibeacon

So, my question is… is there better way of accomplishing the parsing of the JSON data to look for, and act upon a unique UUID? Is using a “sensor” appropriate? I would think that a MQTT Device Tracker would be more appropriate, but I couldn’t see a way to parse the data.

I’m just curious how anyone else has done this, or would go about doing it.

Thanks!

1 Like

Have you looked into the Owntracks component?

I recently got myself an Aprilbeacon and ended up using owntracks on my phone to report to the mqtt broker, which allowed me to use the Owntracks component in Home assistant. That should support mobile ibeacons as well.

Pretty slick once I worked around the zero accuracy issue (#2830).

(https://home-assistant.io/components/device_tracker.owntracks/)

Yes, that’s what I started with. I found that putting the iBeacon to MQTT gateway and using stationary iBeacons in my garage worked much more reliably than Owntracks. And, it saves battery life on my phone too.