The tracker for this device (a car) stops sending updates when turned off, which is okay since the device/car isn’t moving. However proximity thinks that the tracked device is moving away, partly because the final update was 2m larger than the penultimate one (the large “away from” starts at 15:24:31):
15:23:29: 6085m
15:24:31: 6087m
In this case setting the distance tolerance to >2m would probably fix things, but I don’t think that’s the correct approach generally. In my view, distances should always be as accurate as the underlying device tracker.
I suspect that proximity is only calculated on location updates, but imo that’s not the correct approach - there are other examples of when it becomes “out of sync” with reality because of this. This behaviour also occurs when a phone loses connection, say when entering a building (where you’re most likely to be stationary for most of the time). If your final update gives you a vector, then you’ll have a direction of travel until you regain reception. Not ideal and very common.
Instead it seems proximity should be time-sample based rather than update based. This would also suppress “false” directions when for example we go around a roundabout or some such as it would smooth out temporary changes in direction/stationary phases. At the moment even the most regular journeys (eg a straight “there and back” renders lots of false directions which plays havoc with automations.
Similarly, the tolerance could then be expressed in terms of this sampling frequency.
Very hacky but seems to do what I need it to (yet to test outside of the lab). Some notes:
The input device tracker has to be the one attached to the input proximity sensor. Technically we don’t need the condition really, I just didn’t like the idea of updating the location outside of the specific situation I wanted to. It can probably be omitted if you don’t mind constant updates.
Since you can’t see a person nor phone acting as a device tracker (both of which suck), you’ll need to attach a proxy device tracker to a person you’ve added to proximity. I don’t know the side effects of having two such devices but I assume/hope the person will just take the latest (although the person docs suggests things aren’t as simple and I suspect this will bite me).
Proximity doesn’t update if you copy the exact same data, so I needed to guarantee dirtying things by using a random battery value. Obviously this will break things that use that attribute.
Thoughts welcome.
EDIT: This trigger doesn’t seem to work as intended and fires very frequently. Will update with another solution.