-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
executable file
·499 lines (469 loc) · 11.1 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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
- id: '019364cf-1d4d-426b-8847-c12f8891fa41'
alias: Occasion
trigger:
- platform: state
entity_id: sensor.occasion
- platform: homeassistant
event: start
action:
- service: script.group_visibility
data:
entity_id: group.work_sensor
cond: sensor.occasion
visible_state: 'work_morning'
- service: script.group_visibility
data:
entity_id: group.test_sensor
cond: sensor.occasion
visible_state: 'test'
- service: script.group_visibility
data:
entity_id: group.weekend_sensor
cond: sensor.occasion
visible_state: 'weekend'
- service: script.group_visibility
data:
entity_id: group.weekday_sensor
cond: sensor.occasion
visible_state: 'weekday'
#Automation of toweldryer in laundry on weekdays
- id: '1535404518414'
alias: ToweldryerTimerOnOffAtWorkdays
trigger:
- platform: time
at: 06:00:00
condition:
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_on
entity_id: switch.Laundry_walloutlet
- delay: 03:00:00
- service: switch.turn_off
entity_id: switch.Laundry_walloutlet
#Automation of toweldryer in laundry on saturday and sunday
- id: 'bd6650eb-d19a-4fd2-8a15-b6bb45a20d61'
alias: ToweldryerTimerOnOffAtSatSundays
trigger:
- platform: time
at: '08:00:00'
condition:
condition: and
conditions:
- condition: state
entity_id: group.all_devices
state: 'home'
- condition: time
weekday:
- sat
- sun
action:
- service: switch.turn_on
entity_id: switch.Laundry_walloutlet
- delay: 03:00:00
- service: switch.turn_off
entity_id: switch.Laundry_walloutlet
#Automation of toweldryer in laundry on thursday evening
- id: 'a76df0e5-5835-43d3-9bbe-55010b89c186'
alias: ToweldryerTimerOnOffAtThursdayEvening
trigger:
platform: time
at: '20:30:00'
condition:
condition: time
weekday:
- thu
action:
- service: switch.turn_on
entity_id: switch.Laundry_walloutlet
- delay: 03:00:00
- service: switch.turn_off
entity_id: switch.Laundry_walloutlet
# Btest automation user for development and test of automations
# - id: '1535324953523'
# alias: Btest
# trigger:
# platform: time
# hours: 00
# minutes: 25
# seconds: 0
# - platform: state
# entity_id: switch.bt
# from: 'OFF'
# to: 'ON'
# condition:
# condition: and
# conditions:
# - condition: state
# entity_id: group.all_devices
# state: 'home'
# - condition: time
# weekday:
# - fri
# action:
# # - condition: time
# # after: '21:55:00'
# - service: switch.turn_off
# entity_id: switch.bt
# Turn off outside ridgeS floodlight every morning
- id: 'e42e184f-31e2-48ad-a183-6e855aa2df25'
alias: RidgeOffEveryMorning
trigger:
platform: time
at: '08:30:00'
condition: []
action:
- service: switch.turn_off
entity_id: switch.Outside_ridgeS
# Turn on outside.ridgeS floodlight on arrving home after sunset and before
# sunrise
- id: '1535424702192'
alias: RidgeOnArivingNight
initial_state: false
trigger:
- platform: state
entity_id: device_tracker.sensasehlstedtse, device_tracker.astrasehlstedtse
from: 'not_home'
to: 'home'
condition:
condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
- service: switch.turn_on
entity_id: switch.Outside_ridgeS
- delay: 00:05:00
- service: switch.turn_off
entity_id: switch.Outside_ridgeS
# Outside lights except ridge floodlightand porchne, event on for 2 hours
- id: '1535427194477'
alias: OutsideWellandWallsOn
trigger:
- platform: sun
event: sunset
offset: "00:00:00"
condition: []
action:
- delay: '00:{{ (range(0, 30)|random|int) }}:00'
- service: switch.turn_on
entity_id:
- switch.outside_well
- switch.outside_walls_corners
- switch.outside_porchnw
- switch.bt
# - switch.outside_porchne
# - service: light.turn_on
# data:
# entity_id: light.outside_wallne_door
# Turn of outside well and wall lights 22:30
- id: '5c9a84e6-addd-498f-9a9d-76a8d615f92d'
alias: OutsideWellandWallsOff
trigger:
platform: time
at: '23:15:00'
condition: []
action:
- delay: '00:{{ (range(1, 30)|random|int) }}:00'
- service: switch.turn_off
entity_id:
- switch.outside_well
- switch.outside_walls_corners
- switch.outside_porchnw
- switch.bt
- switch.outside_porchne
- switch.outside_walls_corners
# - service: light.turn_off
# data:
# entity_id:
# - light.outside_wallne_door
- id: 'b5ffdef9-270a-40ed-b373-f38283a96aa9'
alias: Movement_on
initial_state: false
trigger:
- platform: state
entity_id: switch.ms
from: 'off'
to: 'on'
action:
service: switch.turn_on
entity_id: switch.bt
- id: 'ef2f26cc-391f-472a-aa1a-1831cb94bbe1'
alias: Movement_off
initial_state: false
trigger:
- platform: state
entity_id: switch.ms
from: 'on'
to: 'off'
action:
service: switch.turn_off
entity_id: switch.bt
# - id: '685b69a3-680f-49e4-9151-dbcdd6e030b3'
# alias: Cabheater_workdays
# trigger:
# - platform: time
# at: '05:30:00'
# condition:
# condition: time
# weekday :
# - mon
# - tue
# - wed
# - thu
# - fri
# action:
# - service: switch.turn_on
# entity_id: switch.cab_heater
# - delay: 03:00:00
# - service: switch.turn_off
# entity_id: switch.cab_heater
#
# - id: '11B3D23A-FC32-4EE6-99B1-A1F7758E6D95'
# alias: Cabheater_weekend
# trigger:
# - platform: time
# at: '07:03:00'
# condition:
# condition: time
# weekday :
# - sat
# - sun
# action:
# - service: switch.turn_on
# entity_id: switch.cab_heater
# - delay: 03:00:00
# - service: switch.turn_off
# entity_id: switch.cab_heater
- id: 'A135AE6D-F158-4AAD-9069-D6FE9D782D99'
alias: OutsideWellAndCornersOn
trigger:
- platform: time
at: '06:30:00'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_on
entity_id:
- switch.outside_walls_corners
- switch.outside_well
- switch.bt
- id: 'DA795AAB-77BB-4864-812B-7347643796BC'
alias: OutsideWellAndCornersOff
trigger:
- platform: sun
event: sunrise
offset: "00:10:00"
condition:
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_off
entity_id:
- switch.outside_walls_corners
- switch.outside_well
- switch.bt
- id: '57d79fbd-dcfd-4802-ab02-dce413bf6c2c'
alias: ChristmastreeMorningOn
trigger:
- platform: time
at: '06:30:00'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_on
entity_id:
- switch.ct
- id: '3f4b300f-b34b-40f5-b039-191b04d487c6'
alias: ChristmastreeMorningOff
trigger:
- platform: sun
event: sunrise
offset: "00:10:00"
condition:
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_off
entity_id:
- switch.ct
- id: 'da65b813-166e-449b-ad02-8157bcd29869'
alias: ChristmastreeEveningOn
trigger:
- platform: sun
event: sunset
offset: "00:00:00"
condition:
condition: state
entity_id: input_boolean.binput1
state: 'on'
action:
- service: switch.turn_on
entity_id:
- switch.ct
- switch.twinkly
# Turn of christmastree 22:30
- id: 'ec9ca141-dfeb-4863-bc05-31a0394d3a1c'
alias: ChristmastreeEveningOff
trigger:
- platform: time
at: '22:30:00'
condition: []
action:
- service: switch.turn_off
entity_id:
- switch.ct
- switch.twinkly
#
- id: 'edf25fea-9af9-4c2a-855e-6ab23da30000'
alias: cth on
trigger:
- platform: state
entity_id: switch.livingroom_wall_remote_1
from: 'off'
to: 'on'
action:
- service: switch.turn_on
entity_id: switch.twinkly
- id: '40680205-2693-482f-9b8a-9da9bfa7a375'
alias: cth off
trigger:
- platform: state
entity_id: switch.livingroom_wall_remote_1
from: 'on'
to: 'off'
action:
- service: switch.turn_off
entity_id: switch.twinkly
# Doorbell pushed turn on outside_ridges for a couple of minutes
- id: '752ce20f-2ad3-4692-9a5e-a4780505448c'
alias: Doorbell_pushed
# initial_state: false
trigger:
- platform: state
entity_id: switch.doorbell
to: 'on'
action:
- service: switch.turn_on
entity_id: switch.outside_ridges
- service: switch.turn_off
entity_id: switch.doorbell
- delay: 00:05:00
- service: switch.turn_off
entity_id:
- switch.outside_ridges
- service: switch.turn_off
entity_id: switch.doorbell
# Activate Doorbell_pushed automation
- id: '36f699c7-d69d-4986-8236-4c929c28e2bc'
alias: Sun_is_set
trigger:
- platform: sun
event: sunset
offset: "-00:10:00"
action:
- service: switch.turn_off
entity_id: switch.doorbell
- service: automation.turn_on
entity_id: automation.Doorbell_pushed
# - service: persistent_notification.create
# data:
# title: 'pb'
# message: 'Solen är nere.'
# Deactivate Doorbell_pushed automation
- id: '56a53f8c-a071-442e-809a-c534e92e6367'
alias: Sun_is_rise
trigger:
- platform: sun
event: sunrise
offset: "00:00:00"
action:
- service: automation.turn_off
entity_id: automation.Doorbell_pushed
# - service: persistent_notification.create
# data:
# title: 'pb'
# message: 'Solen är uppe.'
- id: '10c28036-7b45-4a30-856b-b72282951857'
alias: "Jawa's monitors and amplifier turn on"
trigger:
- platform: mqtt
topic: home-assistant/office/sw1
payload: 1
action:
- service: switch.turn_on
entity_id: switch.office_a
- id: '765f7d6a-bc2e-44f5-91c2-b2e63b0dc62f'
alias: "Jawa's monitors and amplifier turn off"
trigger:
- platform: mqtt
topic: home-assistant/office/sw1
payload: 0
action:
- service: switch.turn_off
entity_id: switch.office_a
- id: 'testur1'
alias: mqtt_test_on
trigger:
- platform: mqtt
topic: 'home-assistant/office/sw2'
payload: 1
action:
- service: switch.turn_on
entity_id: switch.cellar_insidecorner
- service: persistent_notification.create
data:
title: 'mqttpb'
message: 'on'
- id: 'testur2'
alias: mqtt_test_off
trigger:
- platform: mqtt
topic: 'home-assistant/office/sw2'
payload: 0
action:
- service: switch.turn_off
entity_id: switch.cellar_insidecorner
- service: persistent_notification.create
data:
title: 'mqttpb'
message: 'off'