-
Notifications
You must be signed in to change notification settings - Fork 1
/
automations.yaml
1444 lines (1424 loc) · 42.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
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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#################################
# Boutons #
#################################
# Toggle le led strip et la prise lors de l'appui du bouton cuisine
- alias: Bouton Cuisine
id: switch.cuisine
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
click_type: single
entity_id: binary_sensor.switch_158d0001e18d90
condition: []
action:
- service: light.toggle
entity_id: light.yeelight_strip1_7811dc66e549
- service: switch.toggle
entity_id: switch.plug_158d0001de56c2
- service: input_boolean.turn_off
entity_id: input_boolean.mode_nuit
# Ambiance Salon
# Toggle les lampes d'ambiance lors de l'appui du bouton salon
- alias: Bouton Salon
id: switch.salon
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
click_type: single
entity_id: binary_sensor.switch_158d0001e62208
condition: []
action:
- service: light.toggle
entity_id: group.light_salon
- service: switch.toggle
entity_id: switch.plug_158d0001a5d465
## Change la couleur des lampes d'ambiance (double clic)
- alias: Bouton Salon double
id: switch.salon.double
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
click_type: double
entity_id: binary_sensor.switch_158d0001e62208
condition: []
action:
service: input_select.select_next
data:
entity_id: input_select.salon_color
## Change uniquement le lampadaire
- alias: Bouton Salon long
id: switch.salon.long
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.switch_158d000xxxxxc2
click_type: long_click_press
condition: []
action:
service: switch.toggle
entity_id: switch.plug_158d0001a5d465
# Toggle le mode douche lors de l'appui du bouton sdb
- alias: Switch mode douche
id: switch.douche
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
click_type: single
entity_id: binary_sensor.switch_158d0002134b92
condition: []
action:
service: input_boolean.toggle
data:
entity_id: input_boolean.mode_douche
# Chambre Doudou
# Toggle la lampe principale lors de l'apuui du bouton
- alias: Bouton Doudou
id: switch.doudou
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
click_type: single
entity_id: binary_sensor.switch_158d0001e18d16
condition: []
action:
- service: switch.toggle
entity_id: switch.chambredoud
## Toggle le lightstrip (double clic)
- alias: Bouton doudou double
id: switch.doudou.double
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
click_type: double
entity_id: binary_sensor.switch_158d0001e18d16
condition: []
action:
- service: light.toggle
entity_id: light.yeelight_strip2_04cf8c7acfe8
# Désactivation auto mode douche apres 30 minutes
- alias: Auto fin douche
id: auto.douche.off
trigger:
platform: state
entity_id: input_boolean.mode_douche
from: 'off'
to: 'on'
for:
minutes: 45
condition: []
action:
service: input_boolean.turn_off
data:
entity_id: input_boolean.mode_douche
#################################
# Double click sonoffs #
#################################
# Toggle le lampadaire au doucle clic salon
- alias: Double clic sonoff salon
id: sonoff.double.salon
trigger:
- platform: mqtt
topic: sonoff/salon/stat/BUTTON1T
- platform: mqtt
topic: sonoff/salon/stat/BUTTON2T
condition:
condition: template
value_template: "{{ trigger.payload_json['TRIG'] == 'DOUBLE' }}"
action:
- service: switch.toggle
entity_id: switch.plug_158d0001a5d465
# Toggle le lampadaire au doucle clic salon
#- alias: Double clic sonoff salon - B2
# id: sonoff.double.salon.2
# trigger:
# platform: mqtt
# topic: sonoff/salon/stat/BUTTON2T
# condition:
# condition: template
# value_template: "{{ trigger.payload_json['TRIG'] == 'DOUBLE' }}"
# action:
# - service: switch.toggle
# entity_id: switch.plug_158d0001a5d465
# Toggle la lampe de chevet au doucle clic chambre
- alias: Double clic sonoff chambre Alex
id: sonoff.double.chambre.alex
trigger:
platform: mqtt
topic: sonoff/chambre/alex/stat/BUTTON1T
condition:
condition: template
value_template: "{{ trigger.payload_json['TRIG'] == 'DOUBLE' }}"
action:
- service: light.toggle
entity_id: light.yeelight_bedside_7811dc904840
# Toggle le ledstrip au doucle clic Doudou
- alias: Double clic sonoff chambre Doudou
id: sonoff.double.chambre.doudou
trigger:
platform: mqtt
topic: sonoff/chambre/doudou/stat/BUTTON1T
condition:
condition: template
value_template: "{{ trigger.payload_json['TRIG'] == 'DOUBLE' }}"
action:
- service: light.toggle
entity_id: light.yeelight_strip2_04cf8c7acfe8
# Toggle le plan de travail au doucle clic cuisine
- alias: Double clic sonoff cuisine 1
id: sonoff.double.cuicine.1
trigger:
- platform: mqtt
topic: sonoff/cuisine/stat/BUTTON1T
- platform: mqtt
topic: sonoff/cuisine/stat/BUTTON2T
condition:
condition: template
value_template: "{{ trigger.payload_json['TRIG'] == 'DOUBLE' }}"
action:
- service: automation.trigger
entity_id: automation.bouton_cuisine
#################################
# wow effect (cube) #
#################################
# rotate change la couleur du salon
- alias: Cube Rotate
id: cube.rotate
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027984bb_2
action_type: rotate
condition: []
action:
service: input_select.select_next
data:
entity_id: input_select.salon_color
# move allume ou eteint la cuisine
- alias: Cube Move
id: cube.move
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027984bb_2
action_type: move
condition: []
action:
- service: light.toggle
entity_id: light.yeelight_strip1_7811dc66e549
- service: switch.toggle
entity_id: switch.plug_158d0001de56c2
# shake allume la télé et les lumieres du salon douces, et eteint les autres lumieres (plus tard media center) / Et mode jour
- alias: Cube Shake
id: cube.shake
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027984bb_2
action_type: shake_air
condition: []
action:
- service: light.turn_off
entity_id: light.yeelight_strip1_7811dc66e549
- service: switch.turn_off
entity_id: switch.plug_158d0001de56c2, switch.plug_158d0001a5d465, group.light_cuisine, switch.lustresalon, switch.appliquesalon
- service: switch.turn_on
entity_id: switch.tv
- service: input_boolean.turn_off
entity_id: input_boolean.mode_nuit
- service: light.turn_on
data:
entity_id: group.light_salon
color_name: 'hotpink'
brightness: '180'
# free fall déclenche le mode nuit
- alias: Cube free fall
id: cube.freefall
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027984bb_2
action_type: free_fall
condition: []
action:
- service: input_boolean.turn_on
entity_id: input_boolean.mode_nuit
# - service: light.turn_off
# entity_id: light.yeelight_strip1_7811dc66e549, group.light_salon
# - service: switch.turn_off
# entity_id: switch.plug_158d0001de56c2, switch.plug_158d0001a5d465, group.light_cuisine, switch.lustresalon, switch.appliquesalon
# - service: media_player.turn_off
# data:
# entity_id: media_player.lg_tv_remote
# flip90 toggle les lampes du salon
- alias: Cube flip90
id: cube.flip90
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027984bb_2
action_type: flip90
condition: []
action:
- service: light.toggle
entity_id: group.light_salon
- service: switch.toggle
entity_id: switch.plug_158d0001a5d465, switch.lustresalon, switch.appliquesalon
# flip180 inverse toutes les lumieres
- alias: Cube flip180
id: cube.flip180
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027984bb_2
action_type: flip180
condition: []
action:
- service: light.toggle
entity_id: group.light_salon, light.yeelight_strip1_7811dc66e549
- service: switch.toggle
entity_id: switch.plug_158d0001de56c2, switch.plug_158d0001a5d465, group.light_cuisine, switch.lustresalon, switch.appliquesalon
# tap_twice toggle le lampadaire et eteint le reste
- alias: Cube tap twice
id: cube.taptwice
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027984bb_2
action_type: tap_twice
condition: []
action:
- service: light.turn_off
entity_id: light.yeelight_strip1_7811dc66e549, group.light_salon
- service: switch.toggle
entity_id: switch.plug_158d0001a5d465
- service: switch.turn_off
entity_id: switch.plug_158d0001de56c2, group.light_cuisine
#################################
# Trackers #
#################################
# Passe en mode absent si tel non visible depuis 5 minutes
- alias: Passage mode absent auto apres 5 min
id: auto.absent
trigger:
platform: state
entity_id: group.tracked_devices
from: home
to: not_home
for:
minutes: 5
condition: []
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.mode_present
- service: notify.telegram
data:
title: '*Téléphone hors zone*'
message: 'Mode absent déclenché car téléphone hors zone depuis 5 minutes'
data:
keyboard:
- '/HomeMode, /SnoozeNotifs'
# Propose de passer l'aspi si absent depuis 30 minutes et qu'il n'est pas encore passé
- alias: Demande si aspi doit passer après depart
id: auto.aspi.absent
trigger:
platform: state
entity_id: input_boolean.mode_present
from: 'on'
to: 'off'
for:
minutes: 30
condition:
- condition: numeric_state
entity_id: sensor.cleaned_today
below: 0.1
- condition: state
entity_id: vacuum.xiaomi_vacuum_cleaner
state: 'docked'
action:
service: notify.telegram
data_template:
title: '*Démarrage aspirateur?*'
message: 'Le robot aspirateur n est pas encore passé aujourd hui'
data:
keyboard:
- '/LaunchAspi'
# Passe en mode présent si tel devient visible
- alias: Passage mode présent auto (BT phone)
id: auto.present
trigger:
platform: state
entity_id: group.tracked_devices
from: not_home
to: home
condition: []
action:
service: input_boolean.turn_on
data:
entity_id: input_boolean.mode_present
#change les couleurs lorsque le selecteur salon est changé
- alias: Change ambiance salon
trigger:
platform: state
entity_id: input_select.salon_color
condition: []
action:
- service: light.turn_on
data_template:
entity_id: group.light_salon
color_name: '{{ states(''input_select.salon_color'') }}'
brightness: '{{ states(''input_number.salon_brightness'') | int }}'
- alias: Change luminosité salon
trigger:
platform: state
entity_id: input_number.salon_brightness
condition: []
action:
- service: light.turn_on
data_template:
entity_id: group.light_salon
brightness: '{{ states(''input_number.salon_brightness'') | int }}'
#################################
# Automatisations #
#################################
# Exécute les actions du mode absent lorsqu'il s'enclenche (script away_mode)
- alias: Enclenchement mode absent
id: activate.awaymode
trigger:
platform: state
entity_id: input_boolean.mode_present
from: 'on'
to: 'off'
condition: []
action:
- service: script.turn_on
data:
entity_id: script.away_mode
- service: input_boolean.turn_off
data:
entity_id: input_boolean.heating
# Exécute les actions du mode waf lorsqu'il s'enclenche
- alias: Enclenchement mode waf
id: activate.wafmode
trigger:
platform: state
entity_id: input_boolean.mode_waf
from: 'off'
to: 'on'
condition: []
action:
service: script.turn_on
data:
entity_id: script.waf_mode
# Exécute les actions du mode waf lorsqu'il s'eteint
- alias: Arret mode waf
id: deactivate.wafmode
trigger:
platform: state
entity_id: input_boolean.mode_waf
from: 'on'
to: 'off'
condition: []
action:
service: script.turn_on
data:
entity_id: script.waf_mode_off
- alias: Reactive notifs telegram
id: activate.telegram
trigger:
platform: state
entity_id: input_boolean.snooze_notifs
from: 'on'
to: 'off'
condition: []
action:
- service: script.turn_off
entity_id: script.snooze_xh
- service: automation.turn_on
entity_id: automation.notification_si_absent_et_mouvement
- service: notify.telegram
data_template:
title: '*Notifications réactivées*'
message: 'Les notifications d intrusions sont réactivées'
data:
keyboard:
- '/SnoozeNotifs'
# Suspend les notifs pour 1h puis 4h
- alias: Suspend notifs telegram
id: snooze.telegram
trigger:
platform: state
entity_id: input_boolean.snooze_notifs
from: 'off'
to: 'on'
condition: []
action:
- service: script.turn_on
entity_id: script.snooze_xh
data:
variables:
automation: 'automation.notification_si_absent_et_mouvement'
- service: notify.telegram
data_template:
title: '*Notifications suspendues*'
message: 'Les notifications d intrusions sont suspendues pour {{ states.sensor.already_snoozed_notifs.state |int *2 +1 }} heure(s)'
data:
keyboard:
- '/LaunchNotifs'
# Exécute les actions du mode présent lorsqu'il s'enclenche (script home_mode)
- alias: Enclenchement mode présent
id: activate.homemode
trigger:
platform: state
entity_id: input_boolean.mode_present
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.mode_nuit
state: 'off'
action:
- service: script.turn_on
data:
entity_id: script.home_mode
# Présent = Chauffage /Cams Off
- alias: Activation Chauffage si présent
id: activate.homemode.heating
trigger:
platform: state
entity_id: input_boolean.mode_present
from: 'off'
to: 'on'
condition: []
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.heating
- service: switch.turn_on
data:
entity_id: switch.synology_home_mode
# Ne pas chauffer chez doudou si elle est chez Diana
- alias: Mode absent doudou
id: override.doudou.heating
trigger:
platform: state
entity_id: climate.chambre_doudou
from: 'heat'
to: 'auto'
for:
minutes: 3
condition:
- condition: state
entity_id: calendar.calendar_doudou
state: 'off'
action:
service: climate.set_temperature
data:
entity_id: climate.chambre_doudou
hvac_mode: heat
temperature: 16
# Si une valve passe en auto toute seul et que le chauffage est desactivé, on les éteint toutes
- alias: Mode manuel forcé
id: override.auto.heating
trigger:
platform: state
entity_id: climate.chambre_doudou, climate.salon, climate.cuisine, climate.chambre_alex, climate.salle_de_bains
from: 'heat'
to: 'auto'
for:
minutes: 5
condition:
- condition: state
entity_id: input_boolean.heating
state: 'off'
action:
service: script.turn_on
data:
entity_id: script.heating_off
# Exécute les actions du mode heating
- alias: Chauffage mode auto
id: activate.heating
trigger:
platform: state
entity_id: input_boolean.heating
from: 'off'
to: 'on'
condition: []
action:
service: script.turn_on
data:
entity_id: script.heating_on
# Exécute les actions du mode HOME OFFICE
- alias: Chauffage home office
id: activate.home_office_heating
trigger:
platform: state
entity_id: input_boolean.home_office
from: 'off'
to: 'on'
condition: []
action:
service: script.turn_on
data:
entity_id: script.heating_home_office
# Exécute les actions de sortie du mode HOME OFFICE
- alias: Fin Chauffage home office
id: deactivate.home_office_heating
trigger:
platform: state
entity_id: input_boolean.home_office
from: 'on'
to: 'off'
condition: []
action:
service: script.turn_on
data:
entity_id: script.heating_on
# Exécute les actions du mode heating off
- alias: Chauffage mode eco
id: deactivate.heating
trigger:
platform: state
entity_id: input_boolean.heating
from: 'on'
to: 'off'
condition: []
action:
service: script.turn_on
data:
entity_id: script.heating_off
# Exécute les actions du mode douche lorsqu'il s'enclenche
- alias: Enclenchement mode douche
id: activate.showermode
trigger:
platform: state
entity_id: input_boolean.mode_douche
from: 'off'
to: 'on'
condition: []
action:
- service: automation.turn_off
data:
entity_id: automation.allumage_sdb_auto, automation.extinction_sdb_auto
- service: switch.turn_on
data:
entity_id: switch.sdb
- service: climate.set_temperature
data:
entity_id: climate.salle_de_bains
temperature: 25
hvac_mode: heat
# - service: light.turn_off
# data:
# entity_id: light.yeelight_color2_7c49eb157a7e
# - service: light.turn_on
# data:
# entity_id: light.yeelight_color2_7c49eb157a7e
# color_name: 'palegoldenrod'
# brightness: '250'
# Exécute les actions du mode douche lorsqu'il sort
- alias: Sortie mode douche
id: deactivate.showermode
trigger:
platform: state
entity_id: input_boolean.mode_douche
from: 'on'
to: 'off'
condition: []
action:
- service: automation.turn_on
data:
entity_id: automation.allumage_sdb_auto, automation.extinction_sdb_auto
- service: switch.turn_off
data:
entity_id: switch.sdb
- service: climate.set_hvac_mode
data:
entity_id: climate.salle_de_bains
hvac_mode: auto
# - service: light.turn_off
# data:
# entity_id: light.yeelight_color2_7c49eb157a7e
# Exécute les actions du mode nuit lorsqu'il s'enclenche (extinction salon/cuisine)
- alias: Mode nuit
id: activate.nightmode
trigger:
platform: state
entity_id: input_boolean.mode_nuit
from: 'off'
to: 'on'
condition: []
action:
- service: light.turn_off
entity_id: light.yeelight_strip1_7811dc66e549, group.light_salon
- service: switch.turn_off
entity_id: switch.plug_158d0001de56c2, switch.plug_158d0001a5d465, group.light_cuisine, switch.lustresalon, switch.appliquesalon
- service: media_player.turn_off
data:
entity_id: media_player.lg_tv_remote
- service: input_number.set_value
data:
entity_id: input_number.global_brightness
value: '50'
# Allume le chiotte si ouverture ou mouvement
- alias: Allumage chiotte auto
id: auto.chiotte.on
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d0001d6675f, binary_sensor.door_window_sensor_158d0001ab1b67
from: 'off'
to: 'on'
condition: []
action:
service: switch.turn_on
data:
entity_id: switch.chiottelum, switch.chiotteventil
# Eteint les chiottes après 5 min
- alias: Extinction chiotte auto
id: auto.chiotte.off
trigger:
platform: state
entity_id: switch.chiottelum, switch.chiotteventil
from: 'off'
to: 'on'
for:
minutes: 5
condition: []
action:
service: switch.turn_off
data:
entity_id: switch.chiottelum, switch.chiotteventil
#################################
# Telegram bot #
#################################
# commande /Help
- alias: Telegram commandes
id: telegrambot.help
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/Help'
- platform: event
event_type: telegram_command
event_data:
command: '/help'
- platform: event
event_type: telegram_command
event_data:
command: '/?'
condition: []
action:
service: notify.telegram
data_template:
title: '*Commandes implémentées*'
message: |
Résumé: /Status
Alarme: /StopAlarm /LaunchAlarm
Lumières: /LightsOff
Présence: /HomeMode /AwayMode
Caméras: /Cams /NoCams /Live
Notifications: /SnoozeNotifs /LaunchNotifs
Aspi: /LaunchAspi
Chauffage: /Heat /NoHeat
Garage: /OpenGarage /CloseGarage
# commande /Status
- alias: Telegram etat
id: telegrambot.status
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/Status'
- platform: event
event_type: telegram_command
event_data:
command: '/status'
- platform: event
event_type: telegram_command
event_data:
command: '/s'
- platform: event
event_type: telegram_command
event_data:
command: '/!'
condition: []
action:
service: notify.telegram
data_template:
title: '*Statut de la maison*'
message: |
Mode présent: {% if is_state("input_boolean.mode_present", "on") -%} Activé {%- else -%} Désactivé {%- endif %}
Mode de chauffage: {% if is_state("input_boolean.heating", "on") -%} Auto {%- else -%} Absent {%- endif %}
Mode nuit: {% if is_state("input_boolean.mode_nuit", "on") -%} Activé {%- else -%} Désactivé {%- endif %}
Dernier mouvement: {{ states("sensor.last_motion") }}
Cameras : {% if is_state("switch.synology_home_mode", "on") -%} Desactivées {%- else -%} Activées {%- endif %}
Notifications: {% if is_state("input_boolean.snooze_notifs", "on") -%} Desactivées {%- else -%} Activées {%- endif %} (Desactivées {{ states("sensor.already_snoozed_notifs") }} fois ce jour)
Aspi: Passé pendant {{ states("sensor.cleaned_today") }} h
Conditions: {{ states("sensor.average_temperature") }} °C, {{ states("sensor.average_humidity") }} % hum
Portes ouvertes: {{ states("sensor.opened_doors") }}
Fenetres ouvertes: {{ states("sensor.opened_windows") }}
Lumières allumées: {{ states("sensor.active_lights") }}
Porte garage: {{ states("sensor.garage_summary") }}
- alias: Telegram active aspi
id: telegrambot.aspi.start
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/LaunchAspi'
- platform: event
event_type: telegram_command
event_data:
command: '/aspi'
- platform: event
event_type: telegram_command
event_data:
command: '/clean'
condition: []
action:
service: vacuum.start
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
#command snpashot (/live)
- alias: Telegram photo dafang
id: telegrambot.live.photo
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/Live'
- platform: event
event_type: telegram_command
event_data:
command: '/SnapShot'
- platform: event
event_type: telegram_command
event_data:
command: '/live'
condition: []
action:
service: script.turn_on
data:
entity_id: script.camera_snap_message
# commande /LaunchAlarm
- alias: Telegram active alarme
id: telegrambot.alarm.start
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/LaunchAlarm'
- platform: event
event_type: telegram_command
event_data:
command: '/alarm'
condition: []
action:
service: script.turn_on
data:
entity_id: script.alarm_on
# commande /StopAlarm
- alias: Telegram stoppe alarme
id: telegrambot.alarm.stop
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/StopAlarm'
- platform: event
event_type: telegram_command
event_data:
command: '/alarmoff'
condition: []
action:
service: script.turn_on
data:
entity_id: script.alarm_off
# commande /LightsOff
- alias: Telegram etient lumieres
id: telegrambot.lights.off
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/LightsOff'
condition: []
action:
- service: light.turn_off
data:
entity_id: group.light_devices, group.light_bulbs
- service: switch.turn_off
data:
entity_id: switch.plug_158d0001de56c2, switch.chambre, switch.cuisine1, switch.cuisine2, switch.plug_158d0001a5d465, switch.chambredoud, switch.chiottelum, switch.chiotteventil, switch.plug_158d0001a5d465, switch.terasse, switch.lustresalon, switch.appliquesalon, switch.sdb
# entity_id: switch.synology_home_mode, switch.plug_158d0001de56c2, switch.chambre, switch.cuisine1, switch.cuisine2, switch.plug_158d0001a5d465, switch.chambredoud, switch.chiottelum, switch.chiotteventil, switch.plug_158d0001a5d465, switch.terasse, switch.lustresalon, switch.appliquesalon, switch.sdb
# commande /OpenGarage
- alias: Telegram ouvre garage
id: telegrambot.garage.open
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/OpenGarage'
- platform: event
event_type: telegram_command
event_data:
command: '/open'
condition: []
action:
service: mqtt.publish
data:
payload: "open"
topic: "garadget/Garage/command"
# commande /CloseGarage
- alias: Telegram ferme garage
id: telegrambot.garage.close
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/CloseGarage'
- platform: event
event_type: telegram_command
event_data:
command: '/close'
condition: []
action:
service: mqtt.publish
data:
payload: "close"
topic: "garadget/Garage/command"
# commande /HomeMode
- alias: Telegram mode présent
id: telegrambot.homemode.activate
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/HomeMode'
- platform: event
event_type: telegram_command
event_data:
command: '/home'
- platform: event
event_type: telegram_command
event_data:
command: '/h'
condition: []
action:
service: input_boolean.turn_on
data:
entity_id: input_boolean.mode_present
# commande /AwayMode
- alias: Telegram mode absent
id: telegrambot.awaymode.activate
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/AwayMode'
- platform: event
event_type: telegram_command
event_data:
command: '/away'
- platform: event
event_type: telegram_command
event_data:
command: '/a'
condition: []
action:
service: input_boolean.turn_off
data:
entity_id: input_boolean.mode_present
# commande /HeatAuto
- alias: Telegram chauffage auto
id: telegrambot.heating.activate
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/Heat'
- platform: event
event_type: telegram_command
event_data:
command: '/heat'
- platform: event
event_type: telegram_command
event_data:
command: '/HeatAuto'
condition: []
action:
service: input_boolean.turn_on
data:
entity_id: input_boolean.heating
# commande /HeatEco
- alias: Telegram chauffage eco
id: telegrambot.heating.deactivate
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/HeatEco'
- platform: event
event_type: telegram_command
event_data:
command: '/noheat'
- platform: event
event_type: telegram_command
event_data:
command: '/NoHeat'
condition: []
action:
service: input_boolean.turn_off
data:
entity_id: input_boolean.heating
# commande /LaunchNotifs
- alias: Telegram activate notifs
id: telegrambot.notification.activate
trigger: