How can I use groups in automations?

I have defined familie in groups.yaml:

Familie:
  name: Familie
  entities:
    - person.gert_jan_f
    - person.patrick_d

Now I want to make a automation with a condition on family. Wich can be away or present.

For example:
Turn lights on when group.family is away

how can I manage this in automations?

To trigger when all group members leave:

trigger:
  - platform: state
    entity_id: group.familie
    to: not_home

The condition form follows a similar construction:

trigger:
  - YOUR TRIGGER...

condition:
  - condition: state
    entity_id: group.familie
    state: not_home
1 Like

Thnx it works!