Zone.home state for first to arrive home

So basically I have a fingerprint scanner at my door to unlock the door and run automations. I want it to run some automations only if no one is home but checking zone.home state won’t work as it returns 1 because I am already considered home. I need to filter “besides me” lol

The zone attribute persons holds a list of the person entities within that zone, you can use the reject filter to remove your person from the list and then count.

condition: template
value_template: |
  {{ state_attr('zone.home', 'persons') | reject('eq','person.YOU') | list | count > 0 }}
2 Likes