This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
/
automations.yaml
319 lines (319 loc) · 8.99 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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
- id: system_set_theme
alias: "[SYSTEM] Set Lovelace theme"
initial_state: true
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: sun.sun
to: above_horizon
- platform: state
entity_id: sun.sun
to: below_horizon
action:
- choose:
- conditions: "{{ is_state('sun.sun', 'below_horizon')}}"
sequence:
- service: frontend.set_theme
data:
name: "Google Dark Theme"
default:
- service: frontend.set_theme
data:
name: "Google Light Theme"
- id: system_renew_letsencrypt_certificate
alias: "[SYSTEM] Renew Let's Encrypt certificate"
trigger:
- platform: time
at: 00:00:00
action:
- service: hassio.addon_restart
data:
addon: core_letsencrypt
- id: system_take_weekly_snapshot
alias: "[SYSTEM] Take weekly snapshot"
trigger:
- platform: time
at: 02:00:00
condition:
- condition: time
weekday:
- sun
action:
- service: hassio.snapshot_full
data_template:
name: Backup_{{ now().strftime('%Y-%m-%d') }}
- id: blinds_close_at_dusk
alias: "[BLINDS] Close at dusk"
trigger:
- platform: numeric_state
entity_id: sun.sun
value_template: "{{ state_attr('sun.sun', 'elevation') }}"
below: -2.5
condition:
- condition: time
after: "16:30:00"
before: "23:00:00"
action:
- service: cover.close_cover
entity_id: cover.dining_room
- service: cover.close_cover
entity_id: cover.living_room
- id: blinds_open_at_dawn
alias: "[BLINDS] Open at dawn"
trigger:
- platform: sun
event: sunrise
condition:
- condition: time
before: "10:00:00"
action:
- service: cover.open_cover
entity_id: cover.dining_room
- service: cover.open_cover
entity_id: cover.living_room
- service: cover.open_cover
entity_id: cover.kitchen
- id: blinds_open_via_living_remote
alias: "[BLINDS] Open via Living remote"
trigger:
- device_id: 583ab48731694ab8b1056ae3c4325295
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_1
action:
- service: cover.open_cover
entity_id: cover.dining_room
- service: cover.open_cover
entity_id: cover.living_room
- service: cover.open_cover
entity_id: cover.kitchen
mode: single
- id: blinds_close_via_living_remote
alias: "[BLINDS] Close via Living remote"
trigger:
- device_id: 583ab48731694ab8b1056ae3c4325295
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_2
action:
- service: cover.close_cover
entity_id: cover.dining_room
- service: cover.close_cover
entity_id: cover.living_room
- service: cover.close_cover
entity_id: cover.kitchen
mode: single
- id: blinds_stop_via_living_remote
alias: "[BLINDS] Stop via Living remote"
trigger:
- device_id: 583ab48731694ab8b1056ae3c4325295
domain: deconz
platform: device
type: remote_button_long_release
subtype: button_1
- device_id: 583ab48731694ab8b1056ae3c4325295
domain: deconz
platform: device
type: remote_button_long_release
subtype: button_2
action:
- service: cover.stop_cover
entity_id: cover.dining_room
- service: cover.stop_cover
entity_id: cover.living_room
- service: cover.stop_cover
entity_id: cover.kitchen
mode: single
- id: lights_living_turn_on_at_dusk
alias: "[LIGHTS - Living] Turn on at dusk"
trigger:
- platform: numeric_state
entity_id: sun.sun
value_template: "{{ state_attr('sun.sun', 'elevation') }}"
below: -1.0
action:
- service: scene.turn_on
entity_id: scene.living_room_relax
- id: lights_living_turn_off_after_1am
alias: "[LIGHTS - Living] Turn off after 1AM"
trigger:
- platform: time
at: 01:00:00
action:
- service: light.turn_off
entity_id: light.living_room
- id: lights_living_set_relax_scene_via_remote
alias: "[LIGHTS - Living] Set Relax scene via remote"
trigger:
- device_id: 583ab48731694ab8b1056ae3c4325295
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_3
action:
- service: scene.turn_on
entity_id: scene.living_room_relax
mode: single
- id: lights_living_turn_off_via_remote
alias: "[LIGHTS - Living] Turn off via remote"
trigger:
- device_id: 583ab48731694ab8b1056ae3c4325295
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_4
action:
- service: light.turn_off
entity_id: light.living_room
mode: single
- id: lights_office_set_work_scene_via_remote
alias: "[LIGHTS - Office] Set Work scene via remote"
trigger:
- device_id: 7f235b29c5fe417c94497e1e3287a768
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_1
action:
- service: scene.turn_on
entity_id: scene.office_work
mode: single
- id: lights_office_set_relax_scene_via_remote
alias: "[LIGHTS - Office] Set Relax scene via remote"
trigger:
- device_id: 7f235b29c5fe417c94497e1e3287a768
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_2
action:
- service: scene.turn_on
entity_id: scene.office_relax
mode: single
- id: lights_office_set_green_scene_via_remote
alias: "[LIGHTS - Office] Set Green scene via remote"
trigger:
- device_id: 7f235b29c5fe417c94497e1e3287a768
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_3
action:
- service: scene.turn_on
entity_id: scene.office_green
mode: single
- id: lights_office_turn_off_via_remote
alias: "[LIGHTS - Office] Turn off via remote"
trigger:
- device_id: 7f235b29c5fe417c94497e1e3287a768
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_4
action:
- service: switch.turn_off
entity_id: switch.circadian_lighting_office
- service: light.turn_off
entity_id: light.office
mode: single
- id: lights_mancave_set_work_scene_via_remote
alias: "[LIGHTS - Mancave] Set Work scene via remote"
trigger:
- device_id: ea252024782f4b98bf6c09f8456b245d
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_1
action:
- service: scene.turn_on
entity_id: scene.mancave_work
mode: single
- id: lights_mancave_set_relax_scene_via_remote
alias: "[LIGHTS - Mancave] Set Relax scene via remote"
trigger:
- device_id: ea252024782f4b98bf6c09f8456b245d
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_2
action:
- service: scene.turn_on
entity_id: scene.mancave_relax
mode: single
- id: lights_mancave_set_game_scene_via_remote
alias: "[LIGHTS - Mancave] Set Game scene via remote"
trigger:
- device_id: ea252024782f4b98bf6c09f8456b245d
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_3
action:
- service: scene.turn_on
entity_id: scene.mancave_game
mode: single
- id: lights_mancave_turn_off_via_remote
alias: "[LIGHTS - Mancave] Turn off via remote"
trigger:
- device_id: ea252024782f4b98bf6c09f8456b245d
domain: deconz
platform: device
type: remote_button_short_release
subtype: button_4
action:
- service: switch.turn_off
entity_id: switch.circadian_lighting_mancave
- service: light.turn_off
entity_id: light.mancave
mode: single
- id: lights_mancave_turn_off_after_1am
alias: "[LIGHTS - Mancave] Turn off after 1AM"
trigger:
- platform: time
at: 01:00:00
action:
- service: switch.turn_off
entity_id: switch.circadian_lighting_mancave
- service: light.turn_off
entity_id: light.mancave
- id: lan_device_status
alias: "[LAN] Alert on critical device status"
trigger:
- platform: state
entity_id:
- device_tracker.modem
- device_tracker.heimdallr_ap1
- device_tracker.thor
- device_tracker.hel
- device_tracker.ring
- device_tracker.ringchime
to: offline
for:
minutes: 5
action:
- service: notify.philip
data_template:
title: Device {{ trigger.to_state.name }} is {{ trigger.to_state.state }}
- id: lan_device_detected
alias: "[LAN] Alert on detection of new devices"
trigger:
- platform: event
event_type: device_tracker_new_device
action:
- service: notify.philip
data_template:
title: New device detected
message:
"{{trigger.event.data.host_name}} ({{trigger.event.data.entity_id}})
MAC: {{trigger.event.data.mac}}"
- id: "1609087690776"
alias: "[LIGHTS - Christmas Tree] Turn on at 8:30 AM"
trigger:
- platform: time
at: 08:30:00
action:
- service: switch.turn_on
entity_id: switch.christmas_tree