Allow disabling of automatic GPS device tracker being associated with user upon login via iOS/Mac App

Currently there is no way to stop the automatic creation and association of a GPS based device tracker with the user upon login to the iOS/Mac apps.

I use WiFi presence for presence tracking (via Unifi integration), and avoid GPS tracking as I’ve had mixed experience with it in the past.

As such, the automation association of the iOS platform’s GPS derived device_tracker entity with the user often causes a broken presence experience. For devices which are permanently home by default (e.g. an iMac, or iPad dashboard), this behavior means that my presence based automations stop working until I realise what has happened and manually remove the tracker from the user. This is quite painful in a family home of 7 people!

Occasionally there happens to be the need to re-auth a client, and doing so re-adds the mobile app device as a device_tracker to Home Assistant and associates it with the user who logged in, meaning I yet again have to go an unlink these.

Ideally there would be a way to opt-out of this automation linking of device_tracker to authenticating user to avoid this behavior.

I posted this request in the Home Assistant Discord and @zacwest pointed me here:

this cannot be turned off. you could request a change in the core repo, the logic is that whenever a mobile_app integration is created, it creates and associates a device_tracker to the user unconditionally.

I feel like this is a feature request rather than a bug, since it’s not a regression on existing behavior.

I totally agree with you - we use iPads at home (with the mobile app installed) but almost never carry them around and as soon as they register their device.tracker presence detection is broken.

Glad it’s not just me! I’m currently working on a pull request to add support for this.

Well, I had a try at this, but I don’t think the services UI for Home Assistant can support something like this yet.

Whilst I am able to add an “Options Flow” to the mobile app integration, it won’t work due to the way the mobile_app component works.

Screen Shot 2022-01-11 at 5.50.35 pm

Screen Shot 2022-01-11 at 5.47.14 pm

The issue here is that for every mobile device that gets added, a new config entry is created. Options Flows are options for a single config entry, therefore, a new app being added would mean a new config entry with its own options.

Here’s an example with WLED which has the same - one config entry for each device, see how you have to click into each to access the options flow “Configure” button.

2022-01-11 17.51.27

Whilst there is also a “System Options” place for cross-integration configuration, currently it’s limited to just two hardcoded preferences:

Screen Shot 2022-01-11 at 5.54.21 pm
Screen Shot 2022-01-11 at 5.54.17 pm

Screen Shot 2022-01-11 at 5.55.09 pm

Have raised a ticket in core for this Option to disable GPS device tracker being associated with user upon login via iOS/Mac App · Issue #63876 · home-assistant/core · GitHub as i’m starting to think this could be considered a regression/bug as it was changed in 0.104.0

I’ve had a think about this, and have managed to think of a workaround for this. It’s rather simple, instead of using person.whoever for automations/whatever, just use the device_tracker entities you expect to accurately track presence of a given person in your home.

Obviously this loses the benefit of being able to easily update the device_tracker entities in the user settings pages, but I think this is currently the best option.

My PR to my configuration shows how I replaced person with their device_tracker counterparts: Stop using person based presence tracking by nickw444 · Pull Request #122 · nickw444/home · GitHub. Fortunately I was using an all_people group, which meant many of my presence automations didn’t need any changes, as I could simply just change the underlying entities that the group referenced.