Include/Exclude device tracker on mobile app integration onboarding/setup

What I am proposing is to edit the behavior of the onboarding of a new mobile app integration. Currently if a person with associated user logs into the app and that app has never been connected to that user or HA instance before (therefore no token for that user_id or device exists), it assigns the device tracker to that person without prompting or even so much as a notice of “hey we did this thing”. So on the edit person screen you see all device trackers associated with said person. The JSON of the person file in the .storage folder shows this:

{
  "version": 2,
  "minor_version": 1,
  "key": "person",
  "data": {
    "items": [
      {
        "device_trackers": [
          "device_tracker.b_iphone"
        ],
        "id": "d82f########################46a6",
        "name": "B",
        "user_id": "d86b########################5943",
        "picture": "/api/image/serve/feae9048########################/512x512"
      },
...

what would be nice is on initial onboarding which configures the mobile app integration, it asks “Should this device be used for Person X tracking?”. A check box, a toggle, or a “yes” or “no” and it places the device tracker entity under either an include or exclude heading under the device trackers for the person. Kind of how the include or exclude of the recorder is formatted. then every time the frontend of the app refreshes or this “login” occurs, the backend can check if the device tracker exists under the person (regardless if it is included or excluded) and if it does, don’t change anything because it’s already been decided. If this isn’t the right place, then maybe a new heading in the mobile_app file under the .storage folder.

What this feature request does is prevent device trackers that are created for devices you login to using the mobile app, but do not physically move, from being used to determine the person’s location and home/away state. Example is a macOS laptop and an iPhone. One or the other may be used for tracking, but maybe the laptop shouldn’t be. But maybe you use the device tracker entity of the laptop in some automations like for lights. So you need the device tracker, but don’t want it to be tied to the person who logged into the app. Right now, periodically the mobile app will re-associate the device tracker to the person without notice. Then you have to go into the person editor and manually remove it.

Agreed. I always forget about this and inevitably it breaks my location tracking whenever i set up a device other then my phone after a bit. My phone is really the only device I personally want associated with my person entity, all others just break my automations.

This is a good suggestion. Another option is to make location tracking smarter. Like for example when calculating the location of a person from their device trackers, prioritize which device tracker to use like this:

  1. Is not_home
  2. Is in a zone other then home
  3. Is home

Break ties with last_updated timestamp. Since any device outside of your house and still reporting in is probably attached to you. Particularly if its not in any zone since then its probably a phone or at least something which doesn’t require wifi for internet.

1 Like

Yep, all valid points.

I know the device trackers under a person have some logic associated with it in terms of which ones are used to determine the overall person home/away status.

I’ve never had this part happen. Ever. What would cause this to happen?

As explained above if the token gets deleted or the mobile app integration for the device gets removed and set up again when the person with associated user logs in again, the device tracker is associated with the person. Sometimes this will happen even on relaunch of the app which is a refresh/login again.

This I understand and expected.

This I’ve frankly never seen. Only on the intial creation of the device tracker entities have I seen it added.

I have the same situation with one of our iPads, but I still don’t know why. Sometimes it’s fine for weeks, sometimes I have to delete the damn thing every day. It does not seem to happen with other devices.
Since we also have some automations controlling things like fan speeds, lights and shutters it’s really annoying. I always have to check if everything is working as expected which is the opposite of automation.
Of course setting up another user would be a workaround (which I also used for some time), but it is wrong for several reasons.