Device tracker changes in 2027.5... what to do?

I have set up "composite" trackers for the devices associated with the Persons in my household using known_devices.yaml, which use automations triggered off GPS updates and network connections to provide a more reliable tracker than any of the individual sources. For example, if the phone is pingable from my LAN, it's at home even if the GPS disagrees.

I update the trackers using the device_tracker.see action.

Upon updating to 2026.5, I see this in the logs:

The device_tracker.see action is deprecated and will be removed in Home Assistant Core 2027.5

...and with a bit of digging, I found this:

Like this person, I'd like to know if there's a way to configure one's own TrackerEntity and keep it up to date. Perhaps a Template Device Tracker is needed?

Anyone close to the development care to chip in?

1 Like

Can you not achieve what you want with a template sensor with lat and long (and optionally gps_accuracy) attributes, and a state of whatever zone it should be in (or not_home)?

Even though it’s a sensor domain, I think it can be used in any place a device_tracker can be used?

I use the same set up as OP and it would be sad to loose it too.
The single devices will never be able to achieve the level of accuracy obtained by such a composite tracker.

I could make a sensor, but I am uncertain how it interact with the map and zones.

Forgive me for being dim, but what's the difference between this and say creating a ping and/or nmap device tracker for the phone or other device (coupled with giving it a fixed IP address on the LAN) then having these plus the mobile app associated with the person in question.

From my experience, if any one of these three is home, then I am home. What am I missing?

I have just replaced my device_tracker that I used device_tracker.see to update with a sensor's lat and lon attributes.
I have used an MQTT Device Tracker - used 1 automation to do the discovery to make the device and another automation to update it when the sensor's attributes change. Not sure if this is ideal, but works

There is no easy solution - I’m not sure what to do now, but we still have a year

Sensor works but it’s not ideal because you cannot link it to person and use that to track location of a user

Yes, this is terrible!

Without a valid alternative to define presence based on custom conditions I feel left out in the rain :face_with_diagonal_mouth:

In my case: I cannot reach devices on my guest network from Home assistant. My router reports these devices but is very old and very unreliable in detecting presence in a timely manner.

So I had to jump through several hoops to get presence working, with templates comparing timestamps, etc.
This all only works with a custom way of defining presence with the help of device_tracker.see.
Without it I guess I have to ditch presence or buy a new router which I both dislike.

It is very frustrating that this functionality is strip away and we are left without a valid alternative to define presence.

I'm probably going to update the upstream platform so that it can be added as a template platform. It's just going to take awhile because I'm not familiar with this type of change in HA. One of the core team members is going to help too.

11 Likes

That is great news​:partying_face:. The best way to add virtual/composed device trackers IMO :smiling_face_with_sunglasses:

  • Via MQTT is a little slow and more complex to avoid race conditions between state and attributes
  • a custom integration is not preferred

Thanks for looking into that! Really great news!

template:
- device_tracker:
  - name: foo
    in_zones: "{{ [...] }}"  # List of zone entity_ids
    latitude: "{{ ... }}"  # Latitude
    longitude: "{{ ... }}"  # Longitude

    # Location accuracy in meters, 1 = 1 meter accuracy.  Lower == better accuracy
    location_accuracy: "{{ ... }}"  

It's in the 2026.6 beta

8 Likes

@petro
Really appreciate all the efforts to add device tracker into the template platform​:folded_hands:
If I understood the configuration correctly, one use case that I use with ‘device_tracker.see’ is not supported:
Set state away without knowing (lon/lat) coordinates:

  • ‘in_zone’ only works for inside the zone(s)
  • Lon/Lat set to none results in unknown, not away

I need this when my stationary trackers detect away, but there was not yet a GPS update. With my iPhone this easily takes 10-30 minutes.

Please add an option to pass a generic away, without coordinates. E.g when set lon/lat to false.

Your template needs to return an empty list for in_zone:

in_zone: "{{[]}}"

This will set the state 'not_home' (away)

1 Like

@seanomat
Thanks will give that a try tonight :ok_hand:

edit:

YESS that works great!
One addition: When providing lon/lat values, the in_zones with an empty list prevails. So make that one None (in stead of empty list "{{ [] }}") in case lon/lat values are provided (not None). Very simple example with a Test Boolean away (toggles between away when on, or home when off):

template:
  - device_tracker:
      - name: test
        in_zones: "{{ None if is_state('input_boolean.away','off') else []}}"
        latitude: "{{ None if is_state('input_boolean.away','on') else state_attr('zone.home','latitude') }}"
        longitude: "{{ None if is_state('input_boolean.away','on') else state_attr('zone.home','longitude') }}"

Can you add that to the documentation? They appears to be upstream behavior

1 Like

@petro
I agree it would nice to add this example to the documentation to highlight this behavior.
Don’t know how to do that myself though.

The documentation now states: "The list of zones has a lower priority than latitude and longitude .", but wonder if that is right as for an empty list I noticed the opposite

update:
Some tests done. Zones have higher priority for the state!
If a zone is provided, the state will resemble the zone, but lon/lat will still become whatever is defined there:

  - device_tracker:
      - name: test
        in_zones: "{{ ['zone.home'] }}"
        latitude: 0
        longitude: 0

results in:

So the documentation should state that in_zones has higher priority for the state.
But the behavior that lon/lat are still provided, with in_zones defined, potentially creates ambiguous data in the device tracker where the coordinates can be way outside the zone. I don't mind, as the template easily can guard that.

Is there any chance that we could also set the source_type of the device_tracker-template?

If I remember correctly, when you assign multiple devices to a person, the source_type (router, GPS) influences the prioritization of the devices in determining the state of the person.

Problem with that is they are completely different classes under the hood. If we were to add this, it would be a separate set of configuration options and a separate selection in the UI. I originally built this, but was asked by core to remove it and gauge feedback. So it's something that could be added but it's not something that a user can dynamically set. You'd have to choose the device tracker type prior to creating the entity.

From a technical standpoint, the under the hood entities for GPS (TrackerEntity) use in_zones, latitude, and longitude. Where ROUTER (ScannerEntity) use is_connected, mac_address, hostname, and ip_address. I.e. their implementations are completely separate, but the user doesn't really know that.

I understand, that this should not get to complicated.

But if there are still two different types of device tracker and they serve different purposes then the template should reflect that.

Me personally, I have no I interest in setting the source dynamically. I'm just looking for a replacement for device_tracker.see which always created a router based device_tracker.
Otherwise I much prefer the new template device tracker over calling a service.

Maybe two different template device tracker (GPS and router) would be a solution?