WTH are groups broken?

After one of the latest updates, all of my group-related automations are broken and behave uncontrollable.

For example, I have an automation to turn off the lights when my wife and I leave home (i.e. the last of us). So I created a group in yaml like this:

 eltern:
  name: Eltern
  entities:
    - person.mona
    - person.rainer

And also an automation e.g. to turn the heating to eco mode:

- id: '############'
  alias: Heizung aus, wenn Mona+Rainer weg
  description: ''
  trigger:
  - platform: state
    entity_id: group.eltern
    from: home
    to: not_home
    enabled: true
  condition: []
  action:
  - service: climate.set_preset_mode
    data:
      preset_mode: eco
    target:
      entity_id:
      - climate.heizung_esszimmer
      - climate.heizung_badezimmer
      - climate.heizung_kuche
      - climate.heizung_wohnzimmer_2
  mode: single

Before, only when both of us left home, the groups state went to “not_home”. But now, it goes to “not_home” already when even only one of us leaves. That makes the automations fire and the one staying at home sits in the dark and cold as all lights are automatically turned off, heating is reduced to eco mode and the main door gets locked :face_with_symbols_over_mouth:

How am I supposed to set this up now?

You could just use the state of zone.home - it’s the number of people home.

When it’s zero there’s nobody home.

1 Like

But what if I want a trigger to fire if only my wife and I both left home (i.e. the last of us two), regardless of our kids still being home or not?

Set the all option to true.

Reference: Old-style Groups

1 Like

Are you certain both person entities are in the right state? HA has a bad habit of adding my laptop to my person entity every time I have to log in again on the mac app. Whenever it does I notice eventually because my person entity gets off. It starts using the location of my laptop randomly which is not on my person at all times and I have to remove that device tracker to fix it. Perhaps something similar happened to you with a laptop or tablet?

Otherwise not sure. That shouldn’t happen, sounds like a bug.

Is this a real use case? If so, kind of hilarious.

I thought home was equivalent to on for device trackers and person entities in old-style groups. Isn’t that the opposite of what they want? They want the group to be on (i.e. home) when any of the person entities are home and off (i.e. not_home) only when all of them are not home.

If that’s what they want then that’s how it works by default (all: false → if just one group member is home then the group’s state is home).

My impression is they want the group to report off only when all members leave (all: true → all group members must be home, or not home, for the group’s state to be home/not_home).

My groups look just like yours and work perfectly. I’m not aware of any changes to groups - I’m even running 2022.11.0b0

Set the all option to true.

Reference: Old-style Groups

Been there, done that.

Anyway, I want the state to stay “on” when only one of the sensors goes “off” and the others are still “on”.

This shows the only time my partner and I were out at the same time.

I’m in now, she’s out.

image

Set up is this :

  home_presence:
    name: Home Presence
    entities:
      - person.carole
      - person.neil

That’s exactly how a group works using the default value of all (false).

  • The group reports on if at least one of its members is on.
  • It reports off when all of its members are off.

Yes, I was sitting in the living room watching the states in HA developer tools just as my wife left home. person.her went to “not_home” while person.me stayed “home”. At this very moment the state of group.eltern went to “not_home”.

Well, not for me:

  • Our children mostly reside in their own rooms (they are 15 and 17 and only leave theis room for bathroom visits or family meals :wink:
  • My wife and me are using living room and kitchen most of the time.
  • e.g. on school holidays, wife an I still leave for work while the children stay at their rooms.
  • in such situations, I want the living room lights to turn off and the living room heating to got on eco mode.
1 Like

So, there’s a difference between setting “all” to “false” and not setting “all” at all?

Until now, I only tried setting “all: true” versus not having “all” set because it is flagged as “optional”.

:thinking: well, let’s give that a try …

Ah I see. Its not turning off the lights and heat in the house to get them out of the house and/or annoy them. Its because teenagers hole up in their rooms and you want to leave that zone on but save energy in the rest of the house. Yep that makes more sense haha

Well - seems, it’s relly “Why The Heck month” for me…

What I just tried:
In developer tools

  • I set the state of device_tracker.mysmartphone to “not_home”
  • the state of person.me followed accordingly
  • the state of group.eltern stayed “home”
  • I then set the state of device_tracker.wifessmartphone also to “not_home”
  • the state of person.wife followed accordingly

an then BAAM! - even before I could check, the lights went off, which means the state of group.eltern changed to “not_home” as well and the automation trigger had fired.

Thanks to all of you, especially to @123

The whole time I thought all: defaulted to “false” when not set at all :man_facepalming:

No; there’s no difference.

It does default to false when all is not explicitly specified.

The documentation explains the option’s default setting is false.

all boolean (optional; default: false).

Explicitly specifying all: false or omitting the all option produces the same behavior.

Whatever you did that made it work had nothing to do with explicitly specifying all: false. All of my groups omit specifying the all option and they behave like all: false.

I had the same issue when I have me and my wife members of 2 groups. All option kills the logical operation of the group, at list as per @rkl70’s intention (and my self). What worked for me (partially) was to split the groups (me and my wife as one group and the rest of my kids as a second group).
Now there is a new issue that really looks like a bug.
Although both members of the group are away (not home or in a defined place), the groups changes by its own to home state and than after about 15 minutes return to not_home. I have checked all the relevant entities (device_trackers, person etc.) and none were at home at this time. I have also checked my security cameras and the house was empty.
I think this calls for a bug report.