-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
551 lines (551 loc) · 13.9 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
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
- id: sunset
alias: "\U0001F4A1Sunset"
description: Turns on various lights at sunset.
trigger:
- platform: sun
event: sunset
condition: []
action:
- repeat:
count: '5'
sequence:
- service: homeassistant.turn_on
target:
entity_id:
- light.hall_tube_light
- switch.rice_lights_r_socket_1
- switch.rice_lights_l
- switch.laser
- light.first_floor_stairway
- light.first_floor_light
- light.first_floor_corner
- light.second_floor_stairway
- light.second_floor_light
- light.second_floor_corner
data: {}
- service: notify.sony_tv
data:
message: "Turning on front yard lights \U0001F4A1"
title: "Good Evening \U0001F307"
data:
transparency: 20%
position: top-right
fontsize: medium
- service: notify.mobile_app_cph2613
data:
message: Turning on the front yard lights.
title: "Good Evening \U0001F307"
data:
tag: sunset
notification_icon: mdi:weather-sunset
color: '#f5c905'
icon_url: https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/google/313/sunset_1f307.png
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- repeat:
count: '5'
sequence:
- service: homeassistant.turn_on
target:
entity_id:
- light.hall_tube_light
- switch.rice_lights_r_socket_1
- switch.rice_lights_l
- light.front_yard_lights_group
data: {}
- if:
- condition: template
value_template: '{{ not ((is_state(''light.first_floor_light'', ''on'') or is_state(''light.first_floor_stairway'',
''on'')) or (is_state(''light.second_floor_light'', ''on'') or is_state(''light.second_floor_stairway'',
''on''))) }}'
then:
- service: notify.mobile_app_cph2613
data:
message: clear_notification
data:
tag: sunset
- service: notify.mobile_app_cph2613
data:
title: Not all lights are turned on
message: "\U0001F504 Retrying...."
data:
tag: sunset
- repeat:
count: '5'
sequence:
- service: homeassistant.turn_on
target:
entity_id:
- light.front_yard_lights_group
data: {}
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- if:
- condition: template
value_template: '{{ not ((is_state(''light.first_floor_light'', ''on'') or is_state(''light.first_floor_stairway'',
''on'')) or (is_state(''light.second_floor_light'', ''on'') or is_state(''light.second_floor_stairway'',
''on''))) }}'
then:
- service: notify.mobile_app_cph2613
data:
message: clear_notification
data:
tag: sunset
- service: notify.mobile_app_cph2613
data:
title: ⚠️ Retry Failed ⚠️
message: Supervision Needed!
data:
notification_icon: mdi:alert
persistent: true
actions:
- action: URI
title: Open Lights
uri: /lovelace-admin/front-yard
- action: URI
title: Open Tuya
uri: app://com.tuya.smart
icon_url: https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/325/warning_26a0-fe0f.png
mode: single
- id: power_outage_lights_restore_downstairs
alias: "\U0001F4A1Restore Lights after a power outage"
description: turns off lights when the power is back on and if it not between 6
PM to 10 PM
trigger:
- platform: state
entity_id: binary_sensor.downstairs_power_failed
to: 'on'
for:
hours: 0
minutes: 0
seconds: 0
from: 'off'
id: downstairs
- platform: state
entity_id: binary_sensor.upstairs_power_failed
to: 'on'
for:
hours: 0
minutes: 0
seconds: 0
from: 'off'
id: upstairs
- platform: state
entity_id: media_player.friday
from: unavailable
to: 'off'
id: downstairs
condition:
- condition: time
after: '22:00:00'
before: '17:30:00'
action:
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: homeassistant.turn_off
data: {}
target:
entity_id:
- light.hall_tube_light
- light.rgb_1
- light.rgb_2
- light.first_floor_stairway
- light.second_floor_corner
- light.first_floor_corner
- light.second_floor_stairway
mode: single
- id: tankfull_notification
alias: "\U0001F4A7Tank Full - Notification"
description: Sends a notification on the TV when the tank is full
trigger:
- platform: state
to: 'on'
entity_id: switch.sonoff_1000f38ea4
from: 'off'
condition: []
action:
- service: notify.sony_tv
data:
title: "\U0001F4A7 Tank Full"
message: Turning off Motor
data:
fontsize: small
duration: 5
color: blue
transparency: 50%
interrupt: 1
- service: notify.mobile_app_cph2613
data:
message: Turning off Motor
title: "\U0001F4A7 Tank Full"
data:
notification_icon: mdi:water-pump
color: blue
icon_url: https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/google/313/droplet_1f4a7.png
- service: tts.google_translate_say
data:
entity_id: media_player.family_room_mini
message: ట్యాంక్ నిండింది
language: te
- service: tts.google_translate_say
data:
entity_id: media_player.akashavani
message: ట్యాంక్ నిండింది
language: te
mode: restart
max: 10
- id: tankfull_motoroff
alias: "\U0001F4A7If tank is full, don't turn on motor"
description: Tuns of both motors when tank is full.
trigger:
- platform: state
entity_id:
- switch.downstairs_motor_switch_1
to: 'on'
- platform: state
entity_id:
- switch.upstairs_motor
to: 'on'
condition:
- condition: state
entity_id: switch.sonoff_1000f38ea4
state: 'on'
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.downstairs_motor_switch_1
- switch.upstairs_motor
- service: tts.google_translate_say
data:
entity_id: media_player.family_room_mini
message: ట్యాంక్ నిండుగ ఉంది
language: te
- service: tts.google_translate_say
data:
entity_id: media_player.akashavani
message: ట్యాంక్ నిండుగ ఉంది
language: te
mode: single
- id: frontyard_off
alias: "\U0001F4A1Front Yard lights - Turn off at 9:30 PM"
description: Turns off the front yard lights at 9:30 PM and turns on the rice lights
trigger:
- platform: time
at: '21:00:00'
condition: []
action:
- service: notify.sony_tv
data:
message: Turning off front yard lights.
title: "Good Night \U0001F4A4"
data:
transparency: 20%
position: top-right
fontsize: medium
enabled: false
- service: homeassistant.turn_off
target:
entity_id:
- light.front_yard_lights_group
- light.hall_tube_light
- switch.rice_lights_l
- switch.rice_lights_r_socket_1
data: {}
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.rice_string_1_socket_1
- switch.rice_string_2_socket_1
- service: notify.mobile_app_cph2613
data:
message: Turning off front yard lights.
title: "Good Night \U0001F4A4"
icon_url: https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/google/313/sleeping-face_1f634.png
mode: single
- id: frontyard_ricelights
alias: "\U0001F4A1Front Yard Rice Lights - Turn off at Sunrise"
description: ''
trigger:
- platform: sun
event: sunrise
offset: -01:00:00
condition: []
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.rice_string_2_socket_1
- switch.rice_string_1_socket_1
mode: single
- id: daytime_frontyard_off
alias: "\U0001F4A1Turn off Front yard lights during the day"
description: Does not turn on front yard lights during the day time.
trigger:
- platform: state
entity_id: light.front_yard_lights_group
to: 'on'
condition:
- condition: time
before: '16:00:00'
after: 05:00:00
action:
- service: light.turn_off
data: {}
target:
entity_id:
- light.front_yard_lights_group
mode: single
- id: fill_the_tank
alias: "\U0001F4A7Fill the tank"
description: ''
trigger:
- platform: state
entity_id: switch.upstairs_motor
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: switch.sonoff_1000f38ea4
state: 'off'
- condition: time
after: 05:00:00
before: 09:00:00
action:
- service: switch.turn_on
target:
entity_id: switch.downstairs_motor_switch_1
mode: single
- id: '1634446057008'
alias: ⚙️Front Door Motion Notification on TV
description: ''
trigger:
- platform: state
entity_id: binary_sensor.front_yard_camera_person_occupancy
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: binary_sensor.steps_person_occupancy
state: 'on'
action:
- service: camera.snapshot
data:
filename: /config/www/cam_captures/frontyard.jpg
target:
entity_id: image.front_yard_camera_person
- service: notify.sony_tv
data:
title: Person Detected
message: at Front Door
data:
fontsize: small
duration: 8
color: black
transparency: 50%
image:
path: /config/www/cam_captures/frontyard.jpg
mode: single
- id: '1636974013216'
alias: ⚙️Lovelace Reload
description: ''
trigger:
- platform: event
event_type: lovelace_updated
event_data:
url_path: lovelace-wallmount
id: wallmount
- platform: event
event_type: lovelace_updated
event_data:
url_path:
id: lovelace
condition: []
action:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- choose:
- conditions:
- condition: trigger
id: wallmount
sequence:
- service: browser_mod.refresh
data: {}
target:
device_id: 534f77b165463f8e653c72beaa4d9399
default: []
mode: queued
- id: '1638974963835'
alias: ⚙️Homeassistant Start/Stop
description: Runs various automations based on homeassistant starting or stopping.
trigger:
- platform: homeassistant
event: shutdown
id: shutdown
- platform: homeassistant
event: start
id: start
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: shutdown
sequence:
- service: switch.turn_on
target:
entity_id: switch.lenovo_tab_m10_hd_maintenance_mode
data: {}
- conditions:
- condition: trigger
id: start
sequence:
- service: switch.turn_off
target:
entity_id: switch.lenovo_tab_m10_hd_maintenance_mode
data: {}
default: []
mode: single
- id: '1643198275646'
alias: ⚙️Turn off Downstairs Geyser
description: ''
trigger:
- platform: numeric_state
entity_id: switch.downstairs_geyser
below: '5'
for:
hours: 0
minutes: 1
seconds: 0
attribute: power
condition:
- condition: state
entity_id: switch.downstairs_geyser
state: 'on'
for:
hours: 0
minutes: 2
seconds: 0
action:
- service: notify.mobile_app_cph2613
data:
message: clear_notification
data:
tag: hot_water
- service: switch.turn_off
target:
entity_id: switch.downstairs_geyser
data: {}
- service: notify.mobile_app_cph2613
data:
title: Hot Water Ready!
message: ' '
data:
tag: hot_water
notification_icon: mdi:water-boiler
color: '#ad0320'
- service: media_player.play_media
data:
media_content_id: /local/hot_water_ready.mp4
media_content_type: video
target:
entity_id: media_player.priyadarshini
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: homeassistant.turn_off
data: {}
target:
entity_id: media_player.priyadarshini
mode: single
- id: '1654855874344'
alias: ⚙️Convert Lovelace configuration to yaml
description: ''
trigger:
- platform: event
event_type: lovelace_updated
event_data: {}
condition: []
action:
- service: shell_command.lovelace_default_convert
data: {}
- service: shell_command.lovelace_wallmount_convert
data: {}
mode: single
- id: '1659929141343'
alias: "\U0001F4A7Turn Motor Off when tank full"
description: Turns both motors off if the tank becomes full
trigger:
- platform: state
entity_id:
- switch.sonoff_1000f38ea4
to: 'on'
condition:
- condition: or
conditions:
- condition: state
entity_id: switch.downstairs_motor_switch_1
state: 'on'
- condition: state
entity_id: switch.upstairs_motor
state: 'on'
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.downstairs_motor_switch_1
- switch.upstairs_motor
mode: single
- id: '1667015304798'
alias: "\U0001F9FA First Floor Wash Cycle"
description: ''
trigger:
- platform: numeric_state
entity_id:
- sensor.washing_machine_power
for:
hours: 0
minutes: 4
seconds: 0
below: '1'
condition:
- condition: state
entity_id: switch.washing_machine
state: 'on'
for:
hours: 0
minutes: 5
seconds: 0
action:
- service: notify.mobile_app_cph2613
data:
title: 1️⃣ Floor Wash Cycle Complete
message: Washing Machine Turned Off
data:
notification_icon: mdi:washing-machine
icon_url: https://www.flaticon.com/free-icon/washing-machine_3003984
- service: switch.turn_off
target:
entity_id:
- switch.washing_machine
data: {}
mode: single
max: 10