Hi everyone
I have BLE tracker gateway (not ESPHome) that sends all detected devices to MQTT in JSON format.
This is an example that I am currently working with:
The long string UUID of my HA beacon that the phone sends (or any beacon for that matter).
How can I match it to a device that is tracked (each one of my 3 phones in the house)?
Just have no idea how to work with this sort of data. BLE tracker device sends all the devices it detected at that moment. So could be either one or many.
The long string is the actual data sent by the BLE device. It’s not relevant for you.
The short string “7…” is the MAC address is the device. This is the string to match to your devices.
One way you could achieve your goal is maybe to use the device_tracker.see service
You could, in an atomation, do the matching between an existing device and the MAC received on MQTTT and call the service.
you are not correct
the mac address sent here is the mac of the tracker device. The long string includes uuid of my device plus other info
I can just try matching the known uuid to see if its in the string. But first need to extract it somehow from the info received in mqtt
ah, yes, sorry. Should have paid more attention
Phone MAC is dynamic, so useless
The long string is iBeacon string.
Here I am asking more about how to get the json info from mqtt to sensor. So that I just get a sensor with one or multiple “long” strings that I can then match to the HA companion beacons
ah, yes, sorry. Should have paid more attention
Phone MAC is dynamic, so useless
The long string is iBeacon string.
Here I am asking more about how to get the json info from mqtt to sensor. So that I just get a sensor with one or multiple “long” strings that I can then match to the HA companion beacons
Like sensor is called “detected devices” and a list of all device strings that the device sent to mqtt
I am doing all this because companion app sends uuid in the wrong format for ESPHome to parse it correctly. Plus I already have this tracker =)
state will be “time”, as what you see in the first post is what I have to work with
Attributes would be “devices”, but I do not know how to make them to be separate from each other if they are sent in an array. Sometimes tracker may pickup just one device but if other devices are nearby, it will send them all at once in an array
The end goal is to use this info to match the UUID of the Home Assistant companion app and mark device as “home” when detected.
This will create an attribute per device
The “device_count” is an excuse to not have to deal with the final comma of the list of devices (not valid json)