But, the group will want device_trackers to give you ‘home’ or ‘not_home’. I’m pretty sure it wont work with a ‘person’ component. It might…but probably wont.
If it does, you can just check if the group is ‘home’ or ‘not_home’.
# Returns the number of 'persons' that are 'home'
{{ states['person'] | selectattr('state', 'eq', 'home') | list | count }}
You can use that in a template sensor if you wanted.
binary_sensor:
- platform: template
sensors:
someone_home:
# Will be 'on' if any person is considered 'home'. 'off' otherwise.
value_template: "{{ states['person'] | selectattr('state', 'eq', 'home') | list | count > 0 }}"
Now just use this sensor in any of your automations.
Actually, just tested the groups with people and it seems to work.