I see, I misunderstood your intention, sorry for that!
I hope I’m right now, but that shouldn’t be that hard to achieve.
That’s right, it doesn’t. There you would need the already mentioned automation. But in regard to moving, they’re explicitly made for “moving around”.
Sidenote: ESPresense is using these beacons to calculate, where in a room the beacon is, and it’s surprisingly exact. Might be an interesting read for a rainy day.
As I said, now I think I understand, and yes, that should be doable.
So let’s go - finally!
I’m assuming you have an ordinary BT beacon in your car, eg. something like Tile. I don’t know, if an AirTag or GoogleWhateverTag works as well, as I don’t know, if they send out the correct BT signals, but I guess they’d do as well.
First go to the settings of the companion apps, that you want to use as trackers. Enable the “Beacon Monitor” under Settings > Manage Sensors > Bluetooth Sensors
. You can leave the standard settings for now, but take care, there is one button that generally enables the monitor, and a little downwards inside the settings is another button to enable the monitor.
You now should have a new entity, called something like sensor.your_phone_name_beacon_monitor
. This sensor is holding the nearby beacons as an attribute with an UUID and a proximity, how far away the beacon is. You now need to find out the UUID of your beacon in the car (refer to the chips bag I mentioned earlier ).
The rest is fairly trivial, you need an automation that triggers on attribute changes of that sensor. Something like this:
{% if state_attr('sensor.your_phone_name_beacon_monitor', 'xxx_xxx_xx') != None %}
The attribute with the UUID is only set, if the beacon is within range. So it’s just a check for “is here/is not here”.
If you set it up like this, you don’t need to check for any connections or things like that. If the attribute with the correct UUID is available, you set the phones location in a device_tracker
(as shown above from @Didgeridrew
with the device_tracker.see
service).
So, is this, what you where after, or am I still wrong?
EDIT: I forgot to mention, why I’d go this way, and not with the connection. By tracking the UUID you don’t poll the device and it doesn’t need to be connected in any way. It’s just a beacon that you turn on by putting in a battery. I’m using this way as one part of my presence detection.
But that’s me, it’s your choice and the version above should work as well as this one! Your choice!
EDIT2: Btw. you can use an old phone with installed companion app as a beacon as well! In the same settings segment is the “BLE Transmitter”. This makes your phone a beacon, and you wouldn’t even need to search for the UUID, as it would be set in this setting…