Prioritise several device_trackers for one person

Hello,

I want to track the presence of my wife and I. In most cases, the companion application on Android works well, but quite often the GPS on my wife’s smartphone detects her much further down the street and Home Assistant sees her as absent.

So I created a device_tracker for both of us that takes into account our connection to the home WiFi network. I put it first in the list of her Person entity and her smartphone second. I thought that if her smartphone says she’s away but the device_tracker corresponding to WiFi says she’s present, it should work because being first in the list it has priority. Except no, apparently it just takes into account the last device_tracker to be updated…

So how can I do what I want? I’ve seen that it’s certainly possible with groups, but I’d lose a vital piece of information, which is the zone where the person is located (for example: Work)…
I’d like it so that if a device_tracker says present, the person is considered to be present whatever the state of the other device_trackers, if they all say absent but one gives a GPS position that corresponds to a zone, that the name of that zone appears.

Is this possible?

1 Like

The order of the list on the Person settings menu doesn’t matter, but presence isn’t based solely on the most recent updated device. Stationary device trackers like those based on router integrations or Bluetooth have priority over GPS-based trackers when any stationary tracker is reporting home. GPS takes priority when all stationary trackers report away.

The best way to solve this issue is to implement a swiss cheese model by including more stationary type device trackers. If there is an integration for your router, use it. If you have an ESP32-based ESPHome device that you can add Bluetooth tracking to or Bluetooth on your HA machine, add it. If those simply aren’t an option, there are a number of network-based device tracker integrations like Arpscan Tracker or Ping that can help.

1 Like

This is exactly what I need !

Yes, I use Unifi hardware so this will be easy.
It’s just that I thought I could do without Unifi integration by basing myself on the WiFi declared by the companion application on Android. It seemed better to me knowing that, unlike Unifi integration, it’s instant and that using Unifi integration would add sixty or so devices to my Home Assistant…

Well, beyond that, it answers the problem very well, so there’s no reason to go to the trouble of reinventing the wheel.

So I’ve configured the Unifi integration and added the devices_tracker to the person entities. So far it seems to be working well.

Thanks for your help!

Good to know ! With my previous Home Automation software, I simply put a Bluetooth USB dongle and track devices with their mac address (I use this to track person along with GPS and WiFi, like here).
No way here to put directly my USB dongle on the Home Assistant host, need to use ESP32 devices ? (I have some Everything Presence One, maybe it can work).

Fo my case on my person, I have :slight_smile:

  • the compagnon APP so with GPS po
  • nmap tracker
  • unifi tracker

When I’m at home, the person is in state HOME. All is good.
When I switch of the wifi of my phone, the 2 static trackes nmap and unifi turn to NOT PRESENT. But the state of my person is always HOME…

I think the static tracker would be the priority tracker…
Is this normal ? I need to switch my person to NOT PRESENT to check automatisation.

when I leave home, all is working perfect.

Regards

Can I cry? There is not a single day in my life when my kids don’t leave their keys or phone at home. They have tile trackers with integration to the home assistant. I also have Unifi intregration and tracking to the person from there.

But if ANYTHING ever is forgotten at home, Home Assistant thinks there are people home. Not a single time it has locked the doors and armed my home alarm because someone is supposedly always home.

Why oh why I cannot even choose that it should trust the Unifi > tile?

Bayesian sensor + Composite tracker

2 Likes