Automation - Arm Alarm when everyone is away?

Whats the best way to setup automation to arm an alarm to away when all people are away? I know you could trigger off one person with conditions of everyone else gone, but that kind of sucks. Is there a way to just conditionally say if x,y,z are away do this?

Use a group of the person entities. Then the group entity will be home when anybody is home, and not_home when nobody is home.

Then the automation trigger is simple:

trigger:
- platform: state
  entity_id: group.my_family
  to: 'not_home'
1 Like

wow, simple solution!

Thanks!

Hi All

Thanks for the group tip! I just tried it and it seems to work. I was wondering if I could do something a little more complex here? So I was thinking of having some logic similar to below…

To help with context we are a family of 4 with 2 adults and 2 kids… so…

when all 4 family members home then set alarm disarmed.
When adults not at home but kids are then set alarm to home mode (this basically keeps the cameras a bit more active)
When all 4 people are away then arm alarm completely.

I figure it requires two groups, one for adults and one for kids, something like when both groups = home then disarm etc…

Has anyone done this before?

Yes 

Yes

1 Like

Thanks, yeah I have this working now. Thanks for replying

I’m new to Home Assistant, but fairly technically inclined. I’d love to do the same thing, but don’t see any way to create a person group under Helpers. Can someone help me with this?

Can’t be done in the UI, see

How do you group the person entities? I’ve followed a bit last answer which points directly to the official Group documentation.
It states:

We don’t recommend using these old-style groups anymore. They are still supported, but we recommend using the groups as described above.

Still Ithey don’t explain how to group ‘person’ entities following the new approach. Is it even possible? What if HA evolves and this is not supported anymore? I’d rather not have the group before getting into troubles with any random HA update.

With an old style group.

These days though you can also use the state of zone.home, see the docs:

The state of a zone is a number, which represents the number of persons that are currently in a zone.

trigger:
- platform: numeric_state
  entity_id: zone.home
  below: 1

and

trigger:
- platform: numeric_state
  entity_id: zone.home
  above: 0
1 Like