-
Notifications
You must be signed in to change notification settings - Fork 183
/
vacation_mode.yaml
executable file
·51 lines (50 loc) · 1.52 KB
/
vacation_mode.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
49
50
51
---
#-
# _ _ _
# __ ____ _ ___ __ _| |_(_) ___ _ __ _ __ ___ ___ __| | ___
# \ \ / / _` |/ __/ _` | __| |/ _ \| '_ \ | '_ ` _ \ / _ \ / _` |/ _ \
# \ V / (_| | (_| (_| | |_| | (_) | | | | | | | | | | (_) | (_| | __/
# \_/ \__,_|\___\__,_|\__|_|\___/|_| |_|___|_| |_| |_|\___/ \__,_|\___|
# |_____|
#
#- from github.com/basnijholt/home-assistant-config
- alias: "Vacation mode: auto turn on"
initial_state: "on"
trigger:
platform: state
entity_id: group.persons
from: home
to: not_home
for: "24:00:00"
condition:
- condition: state
entity_id: input_boolean.guest_mode
state: "off"
action:
- service: input_boolean.turn_on
entity_id: input_boolean.vacation_mode
- service: notify.all_iphones
data:
title: "Vacation mode"
message: "No one at home for 24 hours, switching on vacation mode."
- alias: "Vacation mode: auto turn off"
initial_state: "on"
trigger:
platform: state
entity_id: group.persons
from: not_home
to: home
condition:
- condition: state
entity_id: input_boolean.vacation_mode
state: "on"
- condition: state
entity_id: input_boolean.guest_mode
state: "off"
action:
- service: input_boolean.turn_off
entity_id: input_boolean.vacation_mode
- service: notify.all_iphones
data:
title: "Vacation mode"
message: "Welcome back! Switching off the vacation mode."