forked from Clooos/Home-Assistant-Mobile-First
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.yaml
2608 lines (2482 loc) · 81.7 KB
/
configuration.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
default_config:
ffmpeg:
python_script:
media_extractor:
wake_on_lan:
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
homeassistant:
external_url: !secret ha_external_url
internal_url: http://192.168.0.9:8123
customize: !include customize.yaml
allowlist_external_dirs:
- /config/www
- /config/statistics
- /config/snapshots/
- /config/faces/
browser_mod:
disable:
- all
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
frontend:
themes: !include_dir_merge_named themes
extra_module_url:
- /hacsfiles/lovelace-card-mod/card-mod.js
zone:
- name: Home
latitude: !secret latitude
longitude: !secret longitude
radius: 200
icon: mdi:home
tts:
- platform: google_translate
service_name: google_say
logger:
default: warning
waste_collection_schedule:
sources:
- name: recycleapp_be
args:
postcode: !secret postcode
street: !secret street
house_number: !secret house_number
customize:
- type: Non-recyclable and non-hazardous waste
alias: Collecte déchets résiduelles
icon: mdi:trash-can-outline
- type: Organic waste
alias: Collecte déchets organiques
icon: mdi:trash-can-outline
- type: PMD
alias: Collecte poubelles PMC
icon: mdi:trash-can-outline
- type: Paper-cardboard
alias: Collecte papiers et cartons
icon: mdi:trash-can-outline
calendar_title: Collecte des déchets
slide:
username: !secret mail
password: !secret pw1
scan_interval: 5
group:
anyone_home:
name: Anyone is home
entities:
- person.quentin
- person.geraldine2
fan:
- platform: template
fans:
hotte_cuisine:
unique_id: hotte
friendly_name: "Hotte cuisine"
value_template: "{{ states('input_boolean.hotte_state') }}"
percentage_template: "{{ states('input_text.hotte_fan_speed') | int }}"
turn_on:
- service: fan.set_percentage
target:
entity_id: fan.hotte_cuisine
data:
percentage: 25
- service: remote.send_command
target:
entity_id: remote.broadlink_remote_remote
data:
device: hote_cuisine
command: "hote_on"
- service: input_boolean.turn_on
target:
entity_id: input_boolean.hotte_state
turn_off:
- service: remote.send_command
target:
entity_id: remote.broadlink_remote_remote
data:
device: hote_cuisine
command: "hote_off"
- service: input_boolean.turn_off
target:
entity_id: input_boolean.hotte_state
- service: fan.set_percentage
target:
entity_id: fan.hotte_cuisine
data:
percentage: 0
set_percentage:
- service: python_script.fan_speed_control
data_template:
fan_speed: "{{ percentage }}"
fan_speed_entity_id: "input_text.hotte_fan_speed"
fan_entity_id: "fan.hotte_cuisine"
fan_speed_count: 4
service_domain: "remote"
service: "send_command"
service_data_increase:
entity_id: remote.broadlink_remote_remote
device: hote_cuisine
command: hote_less
service_data_decrease:
entity_id: remote.broadlink_remote_remote
device: hote_cuisine
command: hote_more
speed_count: 4
media_player:
- platform: universal
name: Musique
children:
- media_player.youtube
- media_player.salon
state_template: "{{ states('media_player.salon_2') }}"
commands:
turn_off:
service: media_player.turn_off
data:
entity_id:
- media_player.salon_2
- media_player.youtube
turn_on:
service: media_player.turn_on
data:
entity_id: media_player.salon_2
volume_up:
service: media_player.volume_up
data:
entity_id: media_player.salon_2
volume_down:
service: media_player.volume_down
data:
entity_id: media_player.salon_2
select_source:
service: media_player.select_source
target:
entity_id: media_player.salon_2
data:
source: "{{ source }}"
volume_set:
service: media_player.volume_set
target:
entity_id: media_player.salon_2
data:
volume_level: "{{ volume_level }}"
attributes:
volume_level: media_player.salon_2|volume_level
source: media_player.salon_2|source
source_list: media_player.salon_2|source_list
sound_mode_list: media_player.salon_2|sound_mode_list
state: media_player.salon_2
light:
# My custom integration
- platform: philips_ambilight
name: Ambilight
host: 192.168.0.24
username: !secret philips_username
password: !secret philips_password
- platform: template
lights:
hotte_cuisine:
friendly_name: "Hotte cuisine"
value_template: "{{ is_state('input_boolean.lampe_hote_state', 'on') }}"
turn_on:
service: script.hote_light_toggle
turn_off:
service: script.hote_light_toggle
led_cuisine:
friendly_name: "LED Cuisine"
icon_template: mdi:led-strip-variant
value_template: "{{ is_state('light.led_cuisine_local', 'on') }}"
level_template: "{{ state_attr('light.led_cuisine_local', 'brightness') }}"
color_template: "{{ state_attr('light.led_cuisine_local', 'hs_color') }}"
effect_list_template: "{{ state_attr('light.led_cuisine_local', 'effect_list') }}"
effect_template: "{{ state_attr('light.led_cuisine_local', 'effect') }}"
#min_mireds_template: "385"
#max_mireds_template: "385"
turn_on:
- service: light.turn_on
target:
entity_id: light.led_cuisine_local
data:
brightness: 1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
- service: light.turn_on
target:
entity_id: light.led_cuisine_local
data:
brightness: 255
turn_off:
- condition: state
entity_id: light.led_cuisine_local
state: "on"
- service: light.turn_on
target:
entity_id: light.led_cuisine_local
data:
brightness: 1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- service: light.turn_on
target:
entity_id: light.led_cuisine_local
data:
brightness: 0
- service: light.turn_off
target:
entity_id: light.led_cuisine_local
set_color:
- if:
- condition: template
value_template: "{{ brightness is defined }}"
then:
- service: light.turn_on
data:
hs_color: "[{{h}}, {{s}}]"
brightness: "{{ brightness }}"
target:
entity_id: light.led_cuisine_local
else:
- service: light.turn_on
data:
hs_color: "[{{h}}, {{s}}]"
target:
entity_id: light.led_cuisine_local
set_temperature:
- if:
- condition: template
value_template: "{{ brightness is defined }}"
then:
- service: light.turn_on
data:
hs_color:
- 0
- 0
brightness: "{{ brightness }}"
target:
entity_id: light.led_cuisine_local
else:
- service: light.turn_on
data:
hs_color:
- 0
- 0
target:
entity_id: light.led_cuisine_local
set_level:
- service: light.turn_on
data_template:
brightness: "{{ brightness }}"
target:
entity_id: light.led_cuisine_local
set_effect:
- service: light.turn_on
data_template:
effect: "{{ effect }}"
target:
entity_id: light.led_cuisine_local
led_salle_de_douche:
friendly_name: "LED Salle de douche"
icon_template: mdi:led-strip-variant
value_template: "{{ is_state('light.led_salle_de_douche_local', 'on') }}"
level_template: "{{ state_attr('light.led_salle_de_douche_local', 'brightness') }}"
color_template: "{{ state_attr('light.led_salle_de_douchee_local', 'hs_color') }}"
effect_list_template: "{{ state_attr('light.led_salle_de_douche_local', 'effect_list') }}"
effect_template: "{{ state_attr('light.led_salle_de_douche_local', 'effect') }}"
#min_mireds_template: "385"
#max_mireds_template: "385"
turn_on:
- service: light.turn_on
target:
entity_id: light.led_salle_de_douche_local
data:
brightness: 1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
- service: light.turn_on
target:
entity_id: light.led_salle_de_douche_local
data:
brightness: 255
turn_off:
- condition: state
entity_id: light.led_salle_de_douche_local
state: "on"
- service: light.turn_on
target:
entity_id: light.led_salle_de_douche_local
data:
brightness: 1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- service: light.turn_on
target:
entity_id: light.led_salle_de_douche_local
data:
brightness: 0
- service: light.turn_off
target:
entity_id: light.led_salle_de_douche_local
set_color:
- if:
- condition: template
value_template: "{{ brightness is defined }}"
then:
- service: light.turn_on
data:
hs_color: "[{{h}}, {{s}}]"
brightness: "{{ brightness }}"
target:
entity_id: light.led_salle_de_douche_local
else:
- service: light.turn_on
data:
hs_color: "[{{h}}, {{s}}]"
target:
entity_id: light.led_salle_de_douche_local
set_temperature:
- if:
- condition: template
value_template: "{{ brightness is defined }}"
then:
- service: light.turn_on
data:
hs_color:
- 0
- 0
brightness: "{{ brightness }}"
target:
entity_id: light.led_salle_de_douche_local
else:
- service: light.turn_on
data:
hs_color:
- 0
- 0
target:
entity_id: light.led_salle_de_douche_local
set_level:
- service: light.turn_on
data_template:
brightness: "{{ brightness }}"
target:
entity_id: light.led_salle_de_douche_local
set_effect:
- service: light.turn_on
data_template:
effect: "{{ effect }}"
target:
entity_id: light.led_salle_de_douche_local
- platform: group
name: Salon
entities:
- light.ambilight
- light.spots_haut_tv
- light.spots_canape_salle_a_manger
- light.bas_tv
- light.led_canape
- light.haut_etagere
- platform: group
name: Pièce principale
entities:
- light.ambilight
- light.lampadaire
- light.bas_tv
- light.table_salle_a_manger_1
- light.table_salle_a_manger_2
- light.table_salle_a_manger_3
- light.bar_cuisine_1
- light.bar_cuisine_2
- light.led_canape
- light.led_salle_a_manger
- light.led_cuisine
- light.haut_etagere
- platform: group
name: Rez-de-chaussée
entities:
- light.ambilight
- light.lampadaire
- light.bas_tv
- light.table_salle_a_manger_1
- light.table_salle_a_manger_2
- light.table_salle_a_manger_3
- light.bar_cuisine_1
- light.bar_cuisine_2
- light.spots_cuisine
- light.led_canape
- light.led_salle_a_manger
- light.led_cuisine
- light.spots_haut_tv
- light.spots_canape_salle_a_manger
- light.haut_etagere
- platform: group
name: Toutes les lampes
entities:
- light.ambilight
- light.lampadaire
- light.colorikea
- light.hue_white_candle_1 #Chambre chevet gauche
- light.hue_white_candle_2 #Chambre chevet droite
- light.led_lit
- light.hue_filament_bulb_1
- light.spots_dressing
- light.spots_haut_tv
- light.spots_canape_salle_a_manger
- light.table_salle_a_manger_1
- light.table_salle_a_manger_2
- light.table_salle_a_manger_3
- light.bar_cuisine_1
- light.bar_cuisine_2
- light.spots_cuisine
- light.bas_tv
- light.led_canape
- light.led_salle_a_manger
- light.led_cuisine
- light.salle_de_bain
- light.haut_etagere
- platform: group
name: Chambre chevet
entities:
- light.hue_white_candle_1 #Chambre chevet gauche
- light.hue_white_candle_2 #Chambre chevet droite
- platform: group
name: Chambre
entities:
- light.hue_white_candle_1 #Chambre chevet gauche
- light.hue_white_candle_2 #Chambre chevet droite
- light.led_lit
- light.hue_filament_bulb_1
- platform: group
name: Table salle à manger
entities:
- light.table_salle_a_manger_1
- light.table_salle_a_manger_2
- light.table_salle_a_manger_3
- platform: group
name: Salle à manger
entities:
- light.table_salle_a_manger_1
- light.table_salle_a_manger_2
- light.table_salle_a_manger_3
- light.lampadaire
- light.led_salle_a_manger
- platform: group
name: Bar cuisine
entities:
- light.bar_cuisine_1
- light.bar_cuisine_2
- platform: group
name: Cuisine
entities:
- light.bar_cuisine_1
- light.bar_cuisine_2
- light.spots_cuisine
- light.led_cuisine
- platform: group
name: Salle de bain
entities:
- light.salle_de_bain_hue_group
- light.led_salle_de_douche
- platform: group
name: Détente groupe
entities:
- light.lampadaire
- light.ambilight
- light.led_canape
- light.bas_tv
- light.bar_cuisine_1
- light.bar_cuisine_2
- light.led_salle_a_manger
- light.led_cuisine
- light.haut_etagere
switch:
- platform: template
switches:
rf_plug_1:
friendly_name: "RF Plug 1"
# value_template: '{{ is_state("switch.rf_plug_1", "on") }}'
turn_on:
service: remote.send_command
target:
entity_id: remote.broadlink_remote_remote
data:
device: rf_plug_1
command: "on"
turn_off:
service: remote.send_command
target:
entity_id: remote.broadlink_remote_remote
data:
device: rf_plug_1
command: "off"
- platform: wake_on_lan
name: PC
mac: !secret mac_pc
host: 192.168.0.3
broadcast_address: 192.168.0.255
broadcast_port: 9
turn_off:
- service: androidtv.adb_command
data:
command: HOME
entity_id: media_player.android_tv
- service: shell_command.turn_off_computer
# - service: hassio.addon_stdin
# data:
# addon: core_rpc_shutdown
# input: shutdown-pc
- platform: template
switches:
light:
friendly_name: "Lampes"
value_template: '{{ is_state("light.piece_principale", "on") }}'
turn_on:
service: script.ambiance_detente
turn_off:
service: script.ambiance_off
icon_template: >-
{% if is_state("light.piece_principale", "on") %}
mdi:lightbulb-outline
{% else %}
mdi:lightbulb
{% endif %}
- platform: template
switches:
musique_salle_de_douche:
friendly_name: "Musique - Salle de bain"
value_template: '{{ is_state("input_boolean.bathroom_music", "on") }}'
turn_on:
service: script.salle_de_bain_musique
turn_off:
service: script.salle_de_bain_musique_stop
icon_template: >-
{% if is_state("input_boolean.bathroom_music", "on") %}
mdi:music-circle
{% else %}
mdi:music-circle-outline
{% endif %}
- platform: template
switches:
deezer:
friendly_name: "Musique"
value_template: '{{ is_state_attr("media_player.salon_2", "source", "HEOS Music") }}' #and is_state("media_player.salon", "playing")
turn_on:
service: script.1594220687562
turn_off:
service: script.1594229195146
icon_template: >-
{% if is_state_attr("media_player.salon_2", "source", "HEOS Music") and is_state_attr("media_player.salon", "source", "Flow") %}
mdi:music-box
{% else %}
mdi:music-box
{% endif %}
- platform: template
switches:
television:
friendly_name: "Télévision"
value_template: '{{ not ((is_state("media_player.android_tv", "off") or is_state("media_player.android_tv", "unknown") or is_state("media_player.android_tv", "unavailable"))) }}'
turn_on:
service: media_player.turn_on
data:
entity_id: media_player.android_tv
turn_off:
service: media_player.turn_off
data:
entity_id: media_player.android_tv
icon_template: >-
{% if is_state("media_player.android_tv", "off") and is_state("media_player.android_tv2", "off") or is_state("media_player.android_tv", "unknown") and is_state("media_player.android_tv2", "unknown") %}
mdi:television
{% else %}
mdi:television
{% endif %}
- platform: template
switches:
ambiance_auto:
friendly_name: "Ambiance automatique"
value_template: '{{ not is_state("input_select.ambiances", "Custom") }}'
turn_off:
- service: input_select.select_option
target:
entity_id:
- input_select.ambiances
data:
option: "Custom"
turn_on:
- service: automation.trigger
target:
entity_id:
- automation.ambiances_selection_automatique
icon_template: >-
{% if not is_state("input_select.ambiances", "Custom") %}
mdi:auto-fix
{% else %}
mdi:auto-fix
{% endif %}
- platform: template
switches:
aspire_la_cuisine:
friendly_name: "Aspire la cuisine"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 18 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_la_cuisine
- platform: template
switches:
aspire_la_chambre:
friendly_name: "Aspire la chambre"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 3 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_la_chambre
- platform: template
switches:
aspire_la_salle_de_bain:
friendly_name: "Aspire la salle de bain"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 19 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_la_salle_de_bain
- platform: template
switches:
aspire_le_couloir:
friendly_name: "Aspire le couloir"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 17 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_le_couloir
- platform: template
switches:
aspire_le_bureau:
friendly_name: "Aspire le bureau"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 1 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_le_bureau
- platform: template
switches:
aspire_le_salon:
friendly_name: "Aspire le salon"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 4 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_le_salon
- platform: template
switches:
aspire_la_salle_a_manger:
friendly_name: "Aspire la salle à manger"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 16 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_la_salle_a_manger
- platform: template
switches:
aspire_la_buanderie:
friendly_name: "Aspire la buanderie"
turn_on:
- service: vacuum.send_command
data:
command: app_segment_clean
params: 2 #ok
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.aspire_la_buanderie
- platform: template
switches:
turn_off_all_devices:
friendly_name: "Éteins tous les appareils"
value_template: '{{ is_state("light.toutes_les_lampes", "on") or is_state("switch.television", "on") or is_state("switch.pc", "on") or is_state("switch.megaboom_3", "on") or is_state("light.ambilight", "on")}}'
turn_on:
turn_off:
service: script.eteint_tous_les_appareils
- platform: template
switches:
demarre_aspirateur:
friendly_name: "Démarre l'aspirateur"
turn_on:
- service: vacuum.start
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
- service: vacuum.set_fan_speed
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
fan_speed: Turbo
turn_off:
- service: switch.turn_off
data:
entity_id: switch.demarre_aspirateur
- platform: template
switches:
recharge_aspirateur:
friendly_name: "Recharge l'aspirateur"
turn_on:
- service: vacuum.pause
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
- delay: 00:00:02
- service: vacuum.return_to_base
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.recharge_aspirateur
- platform: template
switches:
pause_aspirateur:
friendly_name: "Mets l'aspirateur en pause"
turn_on:
- service: vacuum.pause
data:
entity_id: vacuum.xiaomi_vacuum_cleaner
turn_off:
- service: switch.turn_off
data:
entity_id: switch.recharge_aspirateur
- platform: template
switches:
main_room_devices:
friendly_name: "Tous les appareils de la pièce principale"
value_template: '{{ is_state("light.piece_principale", "on") }}'
turn_on:
service: light.turn_on
data:
entity_id: light.piece_principale
turn_off:
service: script.eteins_la_piece_principale
icon_template: >-
{% if is_state("light.piece_principale", "on") %}
mdi:light-bulb
{% else %}
mdi:light-bulb
{% endif %}
- platform: template
switches:
ventilateur:
friendly_name: "Ventilateur"
value_template: '{{ is_state("light.ventilateur_salon", "on") }}'
turn_on:
service: light.turn_on
data:
entity_id: light.ventilateur_salon
turn_off:
service: light.turn_off
data:
entity_id: light.ventilateur_salon
icon_template: >-
{% if is_state("light.ventilateur_salon", "on") %}
mdi:fan
{% else %}
mdi:fan-off
{% endif %}
- platform: template
switches:
bonne_nuit:
friendly_name: "Bonne Nuit"
value_template: '{{ is_state("input_boolean.mode_nuit", "on") }}'
turn_on:
service: script.bonne_nuit
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.mode_nuit
icon_template: >-
{% if is_state("input_boolean.mode_nuit", "on") %}
mdi:bed-outline
{% else %}
mdi:bed
{% endif %}
- platform: template
switches:
fake_heater:
friendly_name: "Fake heater"
value_template: "off"
turn_on:
turn_off:
icon_template: >-
{% if is_state("light.ventilateur", "on") %}
mdi:fan
{% else %}
mdi:fan-off
{% endif %}
# - platform: template
# switches:
# ambilight_hue:
# friendly_name: "Ambilight+Hue"
# value_template: "{{ is_state('binary_sensor.ambilight_hue', 'on') }}"
# turn_on:
# service: switch.turn_on
# data:
# entity_id: switch.ambihue
# turn_off:
# service: switch.turn_off
# data:
# entity_id: switch.ambihue
# icon_template: >-
# {% if is_state('binary_sensor.ambilight_hue', 'on') %}
# mdi:television-ambient-light
# {% else %}
# mdi:television-ambient-light
# {% endif %}
- platform: command_line
switches:
ambihue:
friendly_name: "Ambilight+Hue Video"
command_on: !secret ambihue_command_on
command_off: !secret ambihue_command_off
- platform: command_line
switches:
megaboom_3_cmd:
command_on: sudo systemctl restart bluetooth ; gatttool -i hci0 -b ec:81:93:2d:47:cc --char-write-req -a 0x0003 -n 0006784ADDA101
command_off: sudo systemctl restart bluetooth ; gatttool -i hci0 -b ec:81:93:2d:47:cc --char-write-req -a 0x0003 -n 0006784ADDA102
- platform: template
switches:
megaboom_3:
friendly_name: "MEGABOOM 3"
value_template: >-
{% if is_state('device_tracker.megaboom3', 'home') %}
on
{% elif is_state('device_tracker.megaboom3', 'not_home') %}
off
{% else %}
unknown
{% endif %}
turn_on:
service: script.megaboom_3_turn_on
turn_off:
service: script.megaboom_3_turn_off
icon_template: >-
{% if is_state('device_tracker.megaboom3', 'home') %}
mdi:speaker-wireless
{% else %}
mdi:speaker-wireless
{% endif %}
# SENSORS ##################################################################
template:
- trigger:
- platform: state
entity_id:
- input_boolean.mode_nuit
from: "on"
to: "off"
- platform: time
at: "12:00:00"
binary_sensor:
- name: "Morning state"
state: "{{ ('00:00' <= states('sensor.time') < '11:59') and (is_state('input_boolean.mode_nuit','off')) }}"
- trigger:
- platform: state
entity_id:
- input_number.electricite_jour_semaine
- input_number.electricite_nuit_semaine
sensor:
- name: Électricité total - Semaine
state: "{{ (states('input_number.electricite_jour_semaine')|float) + (states('input_number.electricite_nuit_semaine')|float)}}"
unit_of_measurement: kWh
device_class: energy
state_class: measurement
- trigger:
- platform: state
entity_id:
- sensor.electricite_total_semaine
sensor:
- name: Électricité consommée - Moyenne journalière
state: "{{ ((states('sensor.envoy_122227015952_lifetime_energy_production')|float + states('sensor.consommation_electricite')|float) / ((as_timestamp(now()) - as_timestamp('2022-09-09T00:00:00+00:00')) / 86400))|round(2) }}"
unit_of_measurement: kWh/Jour
device_class: energy
state_class: measurement