mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
50 lines
1.3 KiB
YAML
50 lines
1.3 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:
|
|
- action: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.home_occupied
|
|
|
|
- action: input_boolean.turn_on
|
|
target:
|
|
entity_id:
|
|
- input_boolean.indoor_snapshots
|
|
- input_boolean.outdoor_snapshots
|
|
|
|
- action: 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:
|
|
- action: lock.lock
|
|
target:
|
|
entity_id: lock.patio_door
|