mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
alias: 'Home not occupied'
|
|
id: automation_home_not_occupied
|
|
mode: single
|
|
max_exceeded: silent
|
|
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.clint_home
|
|
- input_boolean.emmett_home
|
|
- input_boolean.bridget_home
|
|
- input_boolean.kristy_home
|
|
- input_boolean.marshall_home
|
|
- input_boolean.tess_home
|
|
- input_boolean.ebin_home
|
|
- input_boolean.guest_mode
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.home_occupied
|
|
state: 'on'
|
|
# We're all away
|
|
- condition: numeric_state
|
|
entity_id: group.person_household
|
|
below: 1
|
|
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_household', 'entity_id'))|list)|groupby('state'))['on']|count }}"
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.home_occupied
|
|
- service: automation.turn_on
|
|
data:
|
|
entity_id: automation.garage_open_nobody_home
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.patio_door_contact
|
|
state: 'off'
|
|
sequence:
|
|
- service: lock.lock
|
|
target:
|
|
entity_id: lock.patio_door |