How to deal with GPS outliers?

Hello!

How shall I deal with GPS outliers with regard to tracking? Some positions are obviously not correct, even if the device (watch, phone) is at home and connected to WiFi. Some are 1-2 km away on the map and therefore are problematic with automations.

Thanks for sharing your thoughts!

Many GPS Sensors provide an accuracy property as well as long and lat.

You could discard those with low accuracy.

1 Like

I do get accuracy values as an attribute of the device_tracker entity.

Would you mind sharing how this can be done?

I see an outlier e.g. at 2:30 a.m. But where and how can I see/check the accuracy attribute at that time? I am interested in this, because I want to see the accuracy value especially if the GPS position is “off”. Or am I on a wrong track?

Thank you! :blush:

Hello


I have a sensor here for GPS and another for my house router seeing it’s on WIFI. You could also add a Bluetooth one, too. Top should be the primary so use the GPS there, but if that changes it checks the next ones and if it sees it there, it doesn’t change states.
Open your Home Assistant instance and show a list of your people.

Both router-based & gps-based tracker may have “outliers”.
GPS-based ones MAY have a “gps_accuracy” attribute (“may” = depends on an integration). Can be analysed if present.
A “person” entity can use different trackers & there are some rules described in Docs.
If you are not satisfied with a default way - consider using a custom Composite integration, or create own “device_tracker” entity (in automation with “device_tracker.see”) accounting possible factors.

1 Like

The position of devices under person does not matter, but I remember the docs about different kinds of trackers having different priorities:

However, I’m not sure how this influences “outliers”.

Thanks for mentioning this. I’ll try this and see if it helps, e.g.:

Else, I might follow your other proposal (device_tracker.see).

I think it’s a good strategy to deal with the outliers at source… as early as possible.

This GPS accuracy device tracker is one example.

You can do a similar thing with a template sensor that has an action. I do that, and round the long and lat to reduce database writes whilst retaining good enough positioning.

1 Like

Would you mind sharing some code snippets?