-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathautomations.yaml
301 lines (282 loc) · 7.32 KB
/
automations.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
#---------------- SMASH.PY ------------------
# Generated: 2023-Dec-04 11:23:52
#--------------------------------------------
#--- automation/notify_on_failed_login.yaml ---
- id: notify_on_failed_login
alias: Notify on Failed Login
trigger:
- platform: state
entity_id: sensor.fail2ban_nginx_http_auth
- platform: state
entity_id: sensor.fail2ban_hass_iptables
- platform: state
entity_id: sensor.fail2ban_organizr_auth
condition:
condition: or
conditions:
- condition: template
value_template: '{{ states.sensor.fail2ban_hass_iptables.state != "None" }}'
- condition: template
value_template: '{{ states.sensor.fail2ban_organizr_auth.state != "None" }}'
- condition: template
value_template: '{{ states.sensor.fail2ban_nginx_http_auth.state != "None" }}'
action:
- service: script.notify_kevin_engine
data:
call_failed_login: 1
#--- automation/notify_leak_detected.yaml ---
- id: notify_on_leak_detected
alias: Notify on Leak Detected
trigger:
- platform: state
entity_id: binary_sensor.leak_sump
from: 'off'
to: 'on'
action:
- service: notify.notify
data_template:
message: >
ALERT! {{ now().strftime("%h %d, %Y at %H:%M:%S") }} Leak Detected with {{trigger.to_state.attributes.friendly_name}}
#--- automation/lights_inside_off.yaml ---
# Turn inside lights off around midnight (before exterior)
- id: lights_inside_off
alias: Lights Inside Off
trigger:
- platform: time
at: '00:12:09'
action:
- service: light.turn_off
entity_id: light.interior_lights
#--- automation/notify_on_restart.yaml ---
- id: notify_on_restart
alias: Notify on Restart
trigger:
- platform: homeassistant
event: start
action:
- service: script.notify_kevin_engine
data:
call_on_restart: 1
#--- automation/lights_outside_off.yaml ---
# Turn on outside lights off at 12:40 am
- id: lights_outdoor_off
alias: Lights Outdoor Off
trigger:
- platform: time
at: '00:40:07'
action:
- service: light.turn_off
entity_id: light.porch
- service: switch.turn_off
entity_id: switch.driveway
#--- automation/notify_on_fire_co.yaml ---
- id: notify_on_fire_co
alias: Notify on Fire/CO
trigger:
- platform: state
entity_id: sensor.smoke_alarm_foyer
to: "Fire"
- platform: state
entity_id: sensor.smoke_alarm_foyer
to: "CO"
- platform: state
entity_id: sensor.smoke_alarm_family_room
to: "Fire"
- platform: state
entity_id: sensor.smoke_alarm_family_room
to: "CO"
- platform: state
entity_id: sensor.smoke_alarm_office
to: "Fire"
- platform: state
entity_id: sensor.smoke_alarm_office
to: "CO"
- platform: state
entity_id: sensor.smoke_alarm_basement
to: "Fire"
- platform: state
entity_id: sensor.smoke_alarm_basement
to: "CO"
action:
- service: notify.notify
data_template:
message: >
ALERT! {{ now().strftime("%h %d, %Y at %H:%M:S") }} {{trigger.to_state.state}} detected by {{trigger.to_state.attributes.friendly_name}}
#--- automation/daytime_clear.yaml ---
# Turn on inside lights off if it clears up during the day
- id: lights_clear
alias: Lights Clear
trigger:
- platform: state
entity_id: sensor.weather_condition
to: "sunny"
for: "00:15:00"
- platform: state
entity_id: sensor.weather_condition
to: "partly-cloudy"
for: "00:15:00"
condition:
condition: and
conditions:
- condition: time
after: '10:00:00'
before: '18:00:00'
- condition: state
entity_id: sun.sun
state: 'above_horizon'
action:
- service: light.turn_off
entity_id:
- light.family_room_couch_left
- light.family_room_couch_right
- light.living_room_couch
- light.kitchen_island
- light.kitchen_table
#--- automation/daytime.yaml ---
- id: workday_routine
alias: Workday Routine
trigger:
- platform: time
at: '10:30:00'
condition:
condition: and
conditions:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
action:
- service: light.turn_off
entity_id:
- light.living_room_couch
- light.family_room_couch_left
- light.family_room_couch_right
- light.kitchen_island
- light.kitchen_table
#--- automation/cloudy.yaml ---
# Turn on inside light if it's cloudy midday
- id: lights_cloudy
alias: Lights Cloudy
trigger:
- platform: state
entity_id: sensor.weather_condition
to: "lightning"
- platform: state
entity_id: sensor.weather_condition
to: "rainy"
- platform: state
entity_id: sensor.weather_condition
to: "cloudy"
- platform: state
entity_id: sensor.weather_condition
to: "fog"
condition:
condition: and
conditions:
- condition: time
after: '10:00:00'
before: '18:00:00'
weekday:
- tue
- thu
- sat
- sun
- condition: state
entity_id: sun.sun
state: 'above_horizon'
action:
- service: light.turn_on
entity_id:
- light.family_room_couch_left
- light.family_room_couch_right
#--- automation/sunset.yaml ---
# Turn on outside lights 15 minutes after sunset
- id: lights_sunset
alias: Lights Sunset
trigger:
- platform: sun
event: sunset
offset: '+00:15:00'
action:
- service: light.turn_on
entity_id: light.porch
- service: switch.turn_on
entity_id: switch.driveway
#--- automation/wakeup.yaml ---
- id: wakeup_routine
alias: Wakeup Routine
trigger:
- platform: time
at: '07:00:30'
action:
- service: light.turn_on
entity_id:
- light.family_room_couch_left
- light.family_room_couch_right
#--- automation/daytime_bedroom.yaml ---
- id: bedroom_daytime
alias: Bedroom Daytime
trigger:
- platform: time
at: '09:30:00'
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: light.turn_off
entity_id:
- light.master_bedroom_door
- light.master_bedroom_window
#--- automation/evening.yaml ---
- id: evening_routine
alias: Evening Routine
trigger:
- platform: sun
event: sunset
offset: '-01:30:00'
action:
- service: light.turn_on
entity_id:
- light.living_room_couch
- light.living_room_piano
- light.family_room_couch_left
- light.family_room_couch_right
- light.kitchen_lights
- light.foyer
#--- automation/night.yaml ---
- id: night_routine
alias: Night Routine
trigger:
- platform: time
at: '21:03:13'
action:
- service: light.turn_off
entity_id:
- light.kitchen_island
- light.kitchen_table
- light.foyer
#--- automation/wakeup_weekends.yaml ---
- id: wakeup_routine_weekends
alias: Wakeup Routine Weekends
trigger:
- platform: time
at: '07:00:30'
condition:
- condition: time
weekday:
- sat
- sun
action:
- service: light.turn_on
entity_id:
- light.living_room_couch