Help with Or / not nested condition

This tests good if no one is home, but fails if one person home. The intent is to have a false condition if the away / ‘not home’ person hasn’t been away for at least two minutes.

condition: or
conditions:
  - condition: not
    conditions:
      - condition: state
        entity_id: person.him
        state: home
        for:
          hours: 0
          minutes: 2
          seconds: 0
      - condition: state
        entity_id: person.her
        state: home
        for:
          hours: 0
          minutes: 2
          seconds: 0
enabled: true

Unless you have other conditions that you are not showing, the Or isn’t doing anything since it only has one condition nested below it… the Not.

If these are the only tracked person entities in your household, you may want to switch to a Numeric state condition based off the zone.home entity. The state of a zone is the number of tracked person entities currently in that zone.

2 Likes

I believe they were trying for this:

condition: or
conditions:
  - condition: not
    conditions:
      - condition: state
        entity_id: person.him
        state: home
        for:
          hours: 0
          minutes: 2
          seconds: 0
  - condition: not
    conditions:
      - condition: state
        entity_id: person.her
        state: home
        for:
          hours: 0
          minutes: 2
          seconds: 0
enabled: true

As suggested by Drew though, this is a lot simpler:

condition: numeric_state
entity_id: zone.home
below: 2

However it does not support a “for” time.

This is supposed to be me OR her have NOT been ‘home’ for at least 2 minutes. It looks good to me as I pasted it but the condition fails if I’m home. This is to keep ‘arrival’ from triggering when someone makes a U-turn after leaving home.