-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathhouse_occupied.yaml
More file actions
48 lines (48 loc) · 1.3 KB
/
Copy pathhouse_occupied.yaml
File metadata and controls
48 lines (48 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Automation to detect if the house is now occupied
#
# This automation will detect if the house is occupied
# based on a few triggers and conditions
# and if it's occupied, it will update the
# input_boolean.house_occupied to be on
#
automation:
- id: "house_occupied"
alias: "House occupied"
initial_state: "on"
triggers:
#
# Triggered if any of the custom Person sensors
# change to ON
#
- trigger: state
entity_id:
- sensor.john_person
- sensor.cristina_person
- sensor.nonna_person
- sensor.tayta_person
- sensor.jido_person
- sensor.katia_person
- sensor.joe_person
- sensor.sylvia_person
- sensor.alex_person
- sensor.nonno_person
to: "home"
conditions:
#
# House is currently NOT occupied
#
- condition: state
entity_id: input_boolean.house_occupied
state: "off"
#
# Ensure that the person has unlock privilege
#
- condition: template
value_template: >
{{ state_attr(trigger.entity_id, 'unlock_privilege') == "on" }}
actions:
#
# Set the house occupied to on
#
- action: input_boolean.turn_on
entity_id: input_boolean.house_occupied