-
Notifications
You must be signed in to change notification settings - Fork 185
/
security.yaml
106 lines (103 loc) · 2.77 KB
/
security.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
#-
# _ _
# ___ ___ ___ _ _ _ __(_) |_ _ _
# / __|/ _ \/ __| | | | '__| | __| | | |
# \__ \ __/ (__| |_| | | | | |_| |_| |
# |___/\___|\___|\__,_|_| |_|\__|\__, |
# |___/
#
#- from github.com/basnijholt/home-assistant-config
- alias: "Security: motion detected but we are not home"
trigger:
platform: state
entity_id: binary_sensor.motion_detected
from: "off"
to: "on"
condition:
- condition: state
entity_id: group.persons
state: not_home
- condition: state
entity_id: vacuum.xiaomi_vacuum_cleaner
state: "docked"
action:
- service: notify.all_iphones
data:
message: "Security: motion is detected, but we are not home."
data:
push:
category: sound_alarm
- wait_for_trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: SOUND_ALARM
timeout: "01:00:00"
continue_on_timeout: false
- service: light.turn_on
entity_id: all
data:
flash: long
color_name: red
- alias: "Security: door has been open for more than 5 minutes"
trigger:
platform: state
entity_id: binary_sensor.openclose_front_door
from: "off"
to: "on"
for: "00:05:00"
condition:
condition: state
entity_id: input_boolean.guest_mode
state: "off"
action:
service: notify.all_iphones
data:
title: "Security"
message: "The door has been open for more than 5 minutes."
- alias: "Security: no one is home but high power usage"
trigger:
- platform: state
entity_id: binary_sensor.no_one_home
to: "on"
- platform: time_pattern
minutes: "/10"
condition:
- condition: state
entity_id: binary_sensor.no_one_home
state: "on"
- condition: numeric_state
entity_id: sensor.power_consumption
above: 0.7
action:
service: notify.all_iphones
data:
title: "Security"
message: >
No one is home and we are using a lot of energy
({{ states('sensor.power_consumption') }} kW now)! ⚡️
- alias: "Security: office door has opened"
trigger:
platform: state
entity_id: binary_sensor.openclose_guest_room
to: "on"
condition:
condition: state
entity_id: input_boolean.office_door_open_warning
state: "on"
action:
- service: notify.bas
data:
title: Security
message: Office door opened!
- service: notify.mobile_app_basnijholt_iphone
data:
title: Security
message: Office door opened!
- service: light.turn_on
data:
entity_id: light.philips_go
flash: short
- service: input_boolean.turn_off
entity_id: input_boolean.office_door_open_warning