Device tracker group "on" instead of "home"

I’ve had the problem when upgrading to 2024.6. The behaviour of the group object has changed in this release.

I was using a group with device trackers to determine if anyone is home:

device_track:
  name: Person_home
  entities:
    - device_tracker.iphone_xxx
    - device_tracker.iphone_xxx_app
    - device_tracker.iphone_yyy
    - device_tracker.iphone_yyy_app

This now results on the group changing to “on” or “off”.

I use the same device trackers on persons in my setup:

person:
  - name: xxx
    id: !secret person_id_xxx
    user_id: !secret user_id_xxx
    device_trackers:
     - device_tracker.iphone_xxx_app
     - device_tracker.iphone_xxx

  - name: yyy
    id: !secret person_id_yyy
    user_id: !secret user_id_yyy
    device_trackers:
      - device_tracker.iphone_yyy_app
      - device_tracker.iphone_yyy

I’ve changed the group to use the persons instead the seperate device trackers and now have the old behaviour back!

device_track:
  name: Person_home
  entities:
    - person.xxx
    - person.yyy

Hope this helps!

This is not a valid device class, see my post below for the fix.
List of valid device classes can be found here: https://www.home-assistant.io/integrations/sensor/#device-class

groups with only device_trackers should get the group state home /not_home according to the documentation (see right above this Group - Home Assistant)

If you can confirm this not to happen in

(which you didnt post so we can not check) , and you have followed the correct settings for yaml configuration, you should open an issue

Thanks. I will confirm. I will also post the code below…it’s been working fine for a long time, but it’s very possible I did something wrong.

#### Somebody Home #####################################
somebody_home:
  name: Somebody is home
  entities:
    - device_tracker.sm_g998u
    - device_tracker.sm_g965u
    - device_tracker.kim_s_phone_ha_app
    - device_tracker.camryn_hornbrook
# OPNSense Device Trackers #
    - device_tracker.wilsons_phone_opnsense
    - device_tracker.jimmys_phone_opnsense
    - device_tracker.kims_phone_opnsense
    - device_tracker.moms_phone_opnsense
    - device_tracker.jami_s_phone
  all: false

Here’s a screenshot of the current state of “Somebody is Home”:

Can folks confirm this code is correct before I open an issue?

just to be sure, please post a screenshot from the dev tools state, like this:

and

not that it will matter, but the all: false is default, so no need to add that

group:

  phone_trackers:
    name: Phone trackers
    entities:
      - device_tracker.marijn
      - device_tracker.wijke

also, check the more-info, which would show like this:

showing the group members with their state too

Changing my tracker to a ping (to get it to go not_home)

Here you go. Thanks for helping me out!

I have removed the “all: false” parameter.

If you think I should open an issue, I will do that next.

I believe it’s the zones that throw it off… (Kim)

those are not home/not_home, so then the group will default to on/off

you should give it a try with a few ping device_trackers, which you know for sure will only be home/not_home

3 Likes

Thanks. I won’t file another issue. Tracking this one.

@Mariusthvdb mentioned using only home/not_home in my trackers. I will give that a shot when I get back to this today. The only issue is, the zones are used to trigger other automations in Home Assistant (audio alerts at the house, security system states, etc.) so I’m not sure I want to break all of that just to save the inconvenience of resetting groups manually every time HASS restarts (which is usually only for an update where I’m sitting at the computer anyway).

It’s inconvenient to have to reload groups to fix the issue, but it’s a once-per-restart thing. I tried automating it…but that didn’t work or I didn’t know how to do it.

Thanks for the help all, I’ll track the issue.

you might not need groups at all.
Depending on your specific requirements, binary_sensors could be useful to trigger automations, or maybe even a template sensor.

I did away with all groups completely, presence is superbly tracked.

If you add some of the trackers to the person entities, you can use those.

Even improve on the core trackers, by using custom Composite tracker (which does Not make the person entity lose lat/long when Home…)

anyways, options galore, so re-composing your config might be helpful/possible

1 Like

Thanks, there’s a lot to dive into here…I appreciate your help/recommendations!

I am going to dig into these options.

fwiw, I have tested all day, and saw trackers go in and out of zones etc.

all I see is home/not_home on the group, which now consists of a mobile_app tracker, a ping tracker and a custom Composite, to have all flavors…

no issue can be forced

and whta happens when you restart HA when you have trackers in various states? like 1 tracker home the other in a zone, then you restart HA…whats the state of the group in those cases?

like I said above, I can see nothing out of the ordinary, this single group always has a state of home/not_home, no matter which states the members have

only thing I see during startup is a shot period of unknown

Any update on this issue? If have the same problem. For years the group had a status of home/not_home, but now it is on/off.

should be fixed n 2024.7.x in the meantime after a HA restart just reload the group and itll be fine until then

Is this now working again in 2024.7.0?

1 Like

Seems to work for me now again with 2024.7.2 - I normally don’t upgrade until the .2 version is out each month.

1 Like

I’m still having this issue.

  • Core2024.7.3
  • Supervisor2024.06.2
    I’ve restarted groups, full restart of HA and restarted groups after that.

Still shows what should be a state of “home” as “on.”