-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
537 lines (537 loc) · 13 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
- alias: Vanessa est partie
id: vanessa_left
hide_entity: true
trigger:
platform: state
entity_id: device_tracker.vanessa
to: not_home
for:
minutes: 5
action:
service: ifttt.trigger
data:
event: vanessa_leaves
- alias: Appartement Vide
id: empty_flat
hide_entity: true
trigger:
- entity_id: group.all_devices
platform: state
to: not_home
action:
- data:
entity_id: media_player.bureau,media_player.cuisine,media_player.salon
service: media_player.media_pause
- data:
entity_id: alarm_control_panel.ha_alarm
service: alarm_control_panel.alarm_arm_away
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- data:
entity_id: group.all_lights
service: homeassistant.turn_off
- data:
entity_id: switch.ganondorf_schedule
service: switch.turn_on
- data:
entity_id: input_boolean.lumiere_entree_auto
service: input_boolean.turn_on
- alias: Appartement occupé
id: full_house
hide_entity: true
trigger:
- entity_id: group.all_devices
platform: state
to: home
action:
- data:
entity_id: switch.ganondorf_schedule
service: switch.turn_off
- data:
entity_id: alarm_control_panel.ha_alarm
service: alarm_control_panel.alarm_disarm
- data:
entity_id: input_boolean.lumiere_entree_auto
service: input_boolean.turn_off
- alias: Restart alarm if away
hide_entity: true
id: boot_away
trigger:
- event: start
platform: homeassistant
condition:
- condition: state
entity_id: group.all_devices
state: not_home
action:
- data:
entity_id: alarm_control_panel.ha_alarm
service: alarm_control_panel.alarm_arm_away
- data:
entity_id: input_boolean.lumiere_entree_auto
service: input_boolean.turn_on
- alias: 'Rapport Activite Elsys #work'
id: erp_elsys
hide_entity: true
trigger:
platform: time
at: '14:30:00'
condition:
condition: zone
entity_id: device_tracker.hugo_iphone
zone: zone.work
action:
service: notify.pushbullet
data:
message: Rapport Activité Elsys
title: ERP
data:
url: https://portail.advans-group.com/ActivityReport
- id: low_battery_iphone
alias: Batterie iPhone faible
trigger:
- below: '30'
entity_id: sensor.battery_iphone
platform: numeric_state
- entity_id: device_tracker.hugo_iphone
event: enter
platform: zone
zone: zone.work
- entity_id: device_tracker.hugo_iphone
event: enter
platform: zone
zone: zone.home
condition:
- condition: and
conditions:
- condition: or
conditions:
- condition: zone
entity_id: device_tracker.hugo_iphone
zone: zone.work
- condition: zone
entity_id: device_tracker.hugo_iphone
zone: zone.home
- below: 30
condition: numeric_state
entity_id: sensor.battery_iphone
action:
- data:
message: Batterie iPhone < 30%, penser a recharger
title: Batterie iPhone
service: notify.pushbullet
hide_entity: true
- id: bed_time
alias: Au Dodo
trigger:
- entity_id: light.salon
platform: state
to: 'off'
condition:
- after: '22:00:00'
before: 06:00:00
condition: time
action:
- alias: Fermeture Volet
data:
entity_id: cover.tous_les_volets
service: cover.close_cover
- alias: Extinction TV
data:
entity_id: remote.harmony_hub
service: remote.turn_off
- data:
entity_id: input_boolean.babyphone_chambre
service: input_boolean.turn_on
- id: on_arbre_lumière
alias: Synchro Lumière Salon (ON)
trigger:
- entity_id: light.meuble_tv
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch
state: 'off'
action:
- alias: Allumer Arbre Lumière
data:
entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch
service: switch.turn_on
- data:
entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch_2
service: switch.turn_on
- id: off_arbre_lumière
alias: Synchro Lumière Salon (OFF)
trigger:
- entity_id: light.meuble_tv
from: 'on'
platform: state
to: 'off'
condition:
- condition: state
entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch
state: 'on'
action:
- delay: 00:00:10
- alias: extinction Arbre lumière
data:
entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch
service: switch.turn_off
- data:
entity_id: switch.fibaro_system_fgwpef_wall_plug_gen5_switch_2
service: switch.turn_off
- action:
- data:
data:
attachment:
content-type: jpeg
push:
badge: 0
category: camera
entity_id: camera.salon
message: Quelqu'un d'inconnu a été vu
service: notify.iosapp
alias: '[ALARME] [iOS] Notification pour déclencher alarme manuellement'
condition:
- condition: state
entity_id: alarm_control_panel.ha_alarm
state: '''armed_away'''
id: alarm_unknown
trigger:
- entity_id: binary_sensor.salon_someone_unknown
platform: state
to: 'on'
- action:
- data:
message: Test
service: notify.iosapp
alias: '[ALARME] [iOS] Alarme déclenché manuellement'
condition: []
id: alarm_manual_trigger
trigger:
- event_data:
actionName: FIRE_ALARM
event_type: ios.notification_action_fired
platform: event
- action:
- data:
entity_id: alarm_control_panel.ha_alarm
service: alarm_control_panel.alarm_disarm
alias: '[ALARME] [iOS] Désactiver alarme manuellement'
condition: []
id: alarm_manual_disable
trigger:
- event_data:
actionName: CANCEL_ALARM
event_type: ios.notification_action_fired
platform: event
- action:
- data:
entity_id: group.current_weather_day
visible: 'False'
service: group.set_visibility
- data:
entity_id: group.current_weather_night
visible: 'True'
service: group.set_visibility
alias: Météo Nuit
hide_entity: false
condition:
condition: or
conditions:
- before: sunrise
before_offset: -03:00:00
condition: sun
- after: sunset
after_offset: -03:00:00
condition: sun
id: '1504704434001'
trigger:
- event: sunset
offset: -03:00:00
platform: sun
- event: start
platform: homeassistant
- action:
- data:
entity_id: group.current_weather_day
visible: 'True'
service: group.set_visibility
- data:
entity_id: group.current_weather_night
visible: 'False'
service: group.set_visibility
alias: Météo Jour
hide_entity: false
condition:
condition: and
conditions:
- before: sunset
before_offset: -03:00:00
condition: sun
- after: sunrise
after_offset: -03:00:00
condition: sun
id: meteo_jour
trigger:
- event: sunrise
offset: -03:00:00
platform: sun
- event: start
platform: homeassistant
- action:
- service: sensor.update_speedtest
- delay: 00:01:00
- data: {}
service: sensor.update_fastdotcom
- data:
entity_id: group.all_automations
service: homeassistant.turn_on
- service: google_assistant.request_sync
trigger:
- event: start
platform: homeassistant
alias: Boot
id: boot
- id: '1504888310936'
alias: Ouverture volet en journée (Salon)
trigger:
- entity_id: light.salon
from: 'off'
platform: state
to: 'on'
- event: sunrise
platform: sun
condition:
- condition: and
conditions:
- after: sunrise
condition: sun
- before: sunset
condition: sun
- condition: state
entity_id: light.salon
state: 'on'
action:
- before: '18:00:00'
condition: time
- data:
entity_id: cover.volet_salon
service: cover.open_cover
- id: '1506437908730'
alias: Lumière du jour suffisante dans salon
trigger:
- platform: template
value_template: '{{ states.sensor.multisensor_entree_luminance.state | float >
20 }}'
condition:
- condition: state
entity_id: light.salon
state: 'on'
action:
- alias: Extinction lumière automatique
data:
entity_id: light.salon
service: light.turn_off
- action:
- alias: Lumière Bienvenue
data:
brightness: 254
entity_id: light.spot_entree
rgb_color:
- 255
- 195
- 98
service: light.turn_on
- delay: 00:00:30
- condition: state
entity_id: group.all_devices
state: not_home
- data:
entity_id: light.spot_entree
service: light.turn_off
alias: Lumière entrée - Bienvenue
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.lumiere_entree_auto
state: 'on'
- condition: template
value_template: '{{ states(''sensor.multisensor_entree_luminance'') | float
< 10 }}'
id: '1507645975510'
trigger:
- entity_id: binary_sensor.multisensor_entree_sensor
from: 'off'
platform: state
to: 'on'
- id: '1539717181505'
alias: MAJ Flux quand Lumière Salon ON
trigger:
- entity_id: light.salon
from: 'off'
platform: state
to: 'on'
condition: []
action:
- service: switch.flux_update
- data: {}
service: switch.flux_meuble_tv_update
- id: '1541522703626'
alias: Interrupteur cuisine ON
trigger:
- entity_id: switch.interrupteur_lumiere_cuisine
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: light.cuisine
service: light.turn_on
- id: '1541522765235'
alias: 'Interrupteur Cuisine Off '
trigger:
- entity_id: switch.interrupteur_lumiere_cuisine
platform: state
to: 'off'
condition: []
action:
- data:
entity_id: light.cuisine
service: light.turn_off
- alias: "Chromecast => stop ampli"
id: 'chromecast_stop_amp'
hide_entity: true
initial_state: 'on'
trigger:
platform: state
entity_id: media_player.salon_chromecast
to: 'off'
for:
minutes: 1
condition:
condition: template
value_template: '{{ is_state("sensor.harmony_salon", "Regarder Chromecast") }}'
action:
service: remote.turn_off
data:
entity_id: remote.harmony_hub
- action:
- data:
entity_id: binary_sensor.ffmpeg_noise
service: ffmpeg.start
alias: Babyphone On
condition: []
trigger:
- entity_id: input_boolean.babyphone
from: 'off'
platform: state
to: 'on'
initial_state: 'on'
id: 'babyphone_start'
- action:
- data:
entity_id: binary_sensor.ffmpeg_noise
service: ffmpeg.stop
alias: Babyphone off
condition: []
trigger:
- entity_id: input_boolean.babyphone
from: 'on'
platform: state
to: 'off'
initial_state: 'on'
id: 'babyphone_stop'
- alias: Restart babyphone
trigger:
- platform: state
entity_id: binary_sensor.ping_binary_sensor
to: 'on'
for:
minutes: 2
condition:
- condition: state
entity_id: binary_sensor.ffmpeg_noise
state: 'unavailable'
action:
- data:
entity_id: binary_sensor.ffmpeg_noise
service: ffmpeg.restart
id: 'babyphone_restart'
- initial_state: 'on'
alias: 'Allume Climatisation'
id: 'ac_on'
trigger:
- platform: template
value_template: >
{{ states.sensor.temp_moy_salon.state >= states.input_number.clim_consigne_max.state }}
- platform: state
entity_id: group.all_devices
to: 'home'
condition:
condition: and
conditions:
- condition: state
entity_id: group.all_devices
state: home
- condition: state
entity_id: climate.salon
state: 'off'
- condition: template
value_template: >
{{ states.sensor.temp_moy_salon.state >= states.input_number.clim_consigne_max.state }}
action:
service: climate.turn_on
entity_id: climate.salon
- initial_state: 'on'
id: 'ac_on2'
alias: 'Allume Climatisation (hors fournaise)'
trigger:
- platform: numeric_state
entity_id: sensor.temp_moy_salon
above: 30
condition:
condition: state
entity_id: climate.salon
state: 'off'
action:
service: climate.turn_on
entity_id: climate.salon
- initial_state: 'on'
id: 'ac_off'
alias: 'Arrête Climatisation'
trigger:
- platform: template
value_template: >
{{ states.sensor.temp_moy_salon.state <= states.input_number.clim_consigne_min.state }}
action:
service: climate.turn_off
entity_id: climate.salon
- initial_state: 'on'
id: 'consigne_min_max'
alias: 'check Consigne min < max'
trigger:
- platform: template
value_template: >
{{ states.input_number.clim_consigne_min.state >= states.input_number.clim_consigne_max.state }}
action:
- service: input_number.set_value
data:
entity_id: input_number.clim_consigne_max
value: 25
- service: input_number.set_value
data:
entity_id: input_number.clim_consigne_min
value: 23
- alias: 'Start HomeKit'
id: start_homekit
trigger:
- platform: homeassistant
event: start
action:
- delay: 00:05 # Waits 5 minutes
- service: homekit.start