-
Notifications
You must be signed in to change notification settings - Fork 0
/
house_occupied.yaml
48 lines (48 loc) · 1.28 KB
/
house_occupied.yaml
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
#
id: "house_occupied"
alias: "House occupied"
initial_state: "on"
trigger:
# Triggered if John, Cristina, or Guest mode
# get turned on
- platform: state
entity_id:
- input_boolean.john_home
- input_boolean.cristina_home
- input_boolean.joe_home
- input_boolean.guest_mode
to: "on"
# Hassio reloads/starts
- platform: event
event_type: automation_reloaded
- platform: homeassistant
event: start
condition:
# House is current unoccupied
- condition: state
entity_id: input_boolean.house_occupied
state: "off"
# Somebody is marked as home
- condition: or
conditions:
- condition: state
entity_id: input_boolean.john_home
state: "on"
- condition: state
entity_id: input_boolean.cristina_home
state: "on"
- condition: state
entity_id: input_boolean.joe_home
state: "on"
- condition: state
entity_id: input_boolean.guest_mode
state: "on"
action:
- service: input_boolean.turn_on
entity_id: input_boolean.house_occupied