forked from matt8707/hass-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui-lovelace.yaml
executable file
·1082 lines (966 loc) · 65 KB
/
ui-lovelace.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
##########################################################################
# #
# * SETTINGS * #
# #
##########################################################################
anchors:
⚓₁: &title
entity: sensor.placeholder
tap_action:
action: none
hold_action:
action: none
type: state-label
⚓₂: &title-style
color: '#bcbebf'
font-family: SF Text
font-size: 2.4vw
font-weight: 500
max-width: 1px
cursor: default
button_card_templates: !include button_card_templates.yaml
##########################################################################
# #
# * LOVELACE * #
# #
##########################################################################
title: Hemma
views:
- panel: true
path: default_view
cards:
- type: picture-elements
image: /local/background.png
elements:
# markdown fix
- type: custom:hui-element
card_type: markdown
style: {opacity: 0}
content: preload
#################################################
# #
# COVID-19 #
# #
#################################################
- type: custom:hui-markdown-card
class: coronavirus
style:
{top: 93.65%, left: 70.2%}
content: >
{% if is_state('sensor.covid_19_folkhalsomyndigheten', 'Tillgänglig') %}
{% set data = state_attr('sensor.covid_19_folkhalsomyndigheten', 'embedCode') %}
{% set total = data | regex_findall_index('Totalt[^,]*?(\d+)[^,]*?(\d+)[^,]*?(\d+)') | list %}
{% set break = ' <font color="#2f3436">|</font> ' %}
<font color='#6a7377'>
<ha-icon icon="mdi:virus"></ha-icon> <b>Coronavirus</b>{{ break -}}
<ha-icon icon="mdi:chart-bar"></ha-icon> <b>{{ ((total[0] | int / 10327589) * 100) | round(2) }}%</b> av Sverige{{ break -}}
<ha-icon icon="mdi:emoticon-sad"></ha-icon> <b>{{ total[0] }}</b> fall{{ break -}}
<ha-icon icon="mdi:grave-stone"></ha-icon> <b>{{ total[2] }}</b> avlidna{{ break -}}
<ha-icon icon="mdi:map-marker-radius"></ha-icon> <b>{{ data | regex_findall_index('Skåne[^,]*?(\d+)') }}</b> fall i Skåne
</font>
{% endif %}
##########################################################################
# #
# * SIDEBAR * #
# #
##########################################################################
- type: image
image: local/sidebar.png
tap_action:
action: none
hold_action:
action: none
style:
{top: 49.24%, left: 10.6%, width: 21.5%, pointer-events: none, border-right: '1.5px solid rgba(58,69,73,0.2)'}
#################################################
# #
# MARKDOWN #
# #
#################################################
- type: custom:hui-markdown-card
class: sidebar
style:
{top: 9%, left: 11.1%}
content: >
<span>{{ states('sensor.time') }}</span>
<font color='#6a7377'><b>{{ states('sensor.sidebar_day') }}</b><br>
<b>{{ states('sensor.sidebar_date') }}</b> </font><br>
<b>{{ states('sensor.sidebar_greeting') }}</b>
<b>{{ states('sensor.sidebar_active') }}</b>
<font color='#6a7377'>
<b>{{ states('sensor.sidebar_vacuum') }}</b>
{{ states('sensor.sidebar_weather') }}
{{ states('sensor.sidebar_skanetrafiken') }}
{{ states('sensor.tvatta_countdown') }}
{{ states('sensor.mathem_countdown') }}
{% if is_state('switch.computer_imac', 'on') and
states('sensor.imac_ip') == states('sensor.public_ip')
or states('sensor.myip') == states('sensor.public_ip') %}
{{'\u26A0\uFE0F'}} Kontrollera VPN-anslutning. {% endif %}
{% if is_state('binary_sensor.plex_availability', 'off') %}
{{'\u26A0\uFE0F'}} Plex är nere...{% endif %}
{% if is_state('binary_sensor.nas_internet_access', 'off') %}
{{'\u26A0\uFE0F'}} Kontrollera NAS internetåtkomst{% endif %}
</font>
#################################################
# #
# KRISINFORMATION #
# #
#################################################
- type: conditional
conditions:
- entity: input_boolean.krisinformation_visibility
state: 'on'
elements:
- type: custom:stack-in-card
class: krisinformation
style:
{top: 18%, left: 10.7%, height: 1px, max-height: 4vw, width: 17.5vw}
cards:
- type: custom:hui-element
card_type: markdown
style: "ha-card {padding: 0.6vw;}"
content: >
{% set entity_id = 'sensor.krisinformation_sverige' %}
{% if not is_state_attr(entity_id, 'messages', []) %}
{{'\u26A0\uFE0F'}} <b>Krisinformation</b><br>
{{ as_timestamp(state_attr(entity_id,
'messages')[0]["Published"]) | timestamp_custom('%Y-%m-%d') }}. {{ state_attr(entity_id,
'messages')[0]["Message"] | truncate(280, True, '...', 0) }}
{% endif %}
- type: custom:button-card
show_label: true
label: OK
tap_action:
action: call-service
service: input_boolean.turn_off
service_data:
entity_id: input_boolean.krisinformation_visibility
styles:
label:
[font-size: 1.5vw, background: '#FFFFFF15', border-radius: 0.6vw, font-weight: 500,
letter-spacing: 0.09vw, opacity: 0.65, padding: 0.7vw 1vw 0.8vw 1vw, font-family: SF Display]
card:
[width: 4.5vw, height: 6vw, margin-top: -0.5vw, padding-bottom: 1vw,
margin-left: 138%, --mdc-ripple-press-opacity: 0]
#################################################
# #
# LAUNDRY TIMER #
# #
#################################################
- type: conditional
conditions:
- entity: input_boolean.laundry_timer_visibility
state: 'on'
elements:
- type: custom:button-card
entity: timer.laundry
show_icon: false
show_name: false
show_state: true
tap_action:
services: |
[[[ hass.callService('timer', 'cancel', {entity_id: 'timer.laundry'});
hass.callService('timer', 'start', {entity_id: 'timer.laundry'}); ]]]
hold_action:
services: |
[[[ hass.callService('timer', 'cancel', {entity_id: 'timer.laundry'});
hass.callService('input_boolean', 'turn_off', {entity_id: 'input_boolean.laundry_timer_visibility'}); ]]]
styles:
card:
[background: '#202a2f30', border-radius: 0.7vw, box-shadow: none, border: '0.2vw solid #292c2e']
state:
[font-size: 2.7vw, font-family: SF Mono, opacity: 0.65, padding: 0.55vw 1.2vw 0.5vw 1.2vw]
style:
top: 77%
left: 10.7%
font-size: 1.6vw
#################################################
# #
# VACUUM BUTTON #
# #
#################################################
- type: icon
icon: custom:roborock-vacuum
title: Dammsugare
style:
top: 87.41%
left: 4.8%
color: rgb(255, 255, 255)
opacity: 0.1
padding: 0.8vw
--mdc-icon-size: 4vw
tap_action: !include popup/sidebar_vacuum.yaml
#################################################
# #
# INFO BUTTON #
# #
#################################################
- type: icon
icon: mdi:information-outline
title: Information
style:
top: 87.41%
left: 10.7%
color: rgb(255, 255, 255)
opacity: 0.1
padding: 0.8vw
--mdc-icon-size: 4vw
tap_action: !include popup/sidebar_information.yaml
#################################################
# #
# UPDATES BUTTON #
# #
#################################################
- type: icon
icon: mdi:arrow-up-bold-circle-outline
title: Uppdateringar
style:
top: 87.41%
left: 16.55%
color: rgb(255, 255, 255)
opacity: 0.1
padding: 0.8vw
--mdc-icon-size: 4vw
tap_action: !include popup/sidebar_update.yaml
##########################################################################
# #
# * VARDAGSRUM * #
# #
##########################################################################
- prefix: Vardagsrum
<<: *title
style:
top: 9.15%
left: 25.4%
<<: *title-style
#################################################
# #
# BELYSNING #
# #
#################################################
- type: custom:button-card
entity: light.belysning
style:
top: 20.35%
left: 30.31%
width: 10%
custom_fields:
icon_hue: &icon_hue >
[[[ const state = entity.state === 'on' ? 'animate' : null;
return `<svg viewBox="0 0 50 50"><style>@keyframes animate{0%{transform: scale(0.85);}20%{transform: scale(1.1);}40%{transform: scale(0.95);}60%{transform: scale(1.03);}80%{transform: scale(0.97);}100%{transform: scale(1);}}.animate{animation: animate 0.8s; transform-origin: center;}</style>
<path fill="#9da0a2" d="M27.4 47.3h-4.9s-.7.1-.7.8.4.9.7.9h4.9c.3 0 .7-.1.7-.9s-.7-.8-.7-.8zm3.3-2.9H19.3s-.8 0-.8.8.6.9.8.9h11.5c.2 0 .8-.1.8-.9-.1-.8-.9-.8-.9-.8zm0-3H19.3s-.8 0-.8.8.6.9.8.9h11.5c.2 0 .8-.1.8-.9-.1-.8-.9-.8-.9-.8zm0-2.9H19.3s-.8 0-.8.8.6.9.8.9h11.5c.2 0 .8-.1.8-.9s-.9-.8-.9-.8zm5.2-23.2c-3.3-5.3-7-5.6-10.9-5.6-3.8 0-8.4.4-10.9 5.6-.1.1-.1.3.1.7.4.8 3.3 7.2 3.2 18.8 0 1.1-.1 1.6 0 1.7 0 .1 0 .7 1.1.7h13c1 0 1-.5 1.1-.7v-1.7c-.1-11.6 2.8-18 3.2-18.8.1-.4.1-.5.1-.7"/>
<path class="${state}" fill="var(--button-card-light-color-no-temperature)" d="M14.1 15.3c3.4-.3 7-.4 10.9-.4 3.8 0 7.5.2 10.9.4.4-.4.7-.8.9-1.1C39 8.5 38.9 6.5 38.9 6c-.2-4.4-8.4-5-12.1-5h0-3.4c-3.7 0-12 .5-12.1 5 0 .5-.1 2.5 2.1 8.2 0 .3.3.8.7 1.1z"/></svg>`; ]]]
styles: &icon_hue_styles
custom_fields:
icon_hue:
[top: 11%, left: 4.5%, width: 3.05vw, position: absolute]
template: light
#################################################
# #
# SKRIVBORD #
# #
#################################################
- type: custom:button-card
entity: light.skrivbord
name: Skrivbord
style:
top: 20.35%
left: 41.31%
width: 10%
custom_fields:
icon_shade: >
[[[ const state = entity.state === 'on' ? 'animate' : null;
return `<svg viewBox="0 0 50 50"><style>@keyframes animate{0%{transform: scale(0.85);}20%{transform: scale(1.1);}40%{transform: scale(0.95);}60%{transform: scale(1.03);}80%{transform: scale(0.97);}100%{transform: scale(1);}}.animate{animation: animate 0.8s; transform-origin: center;}</style>
<path fill="#9da0a2" d="M26.4 25.6c.6-.3 1.1-.7 1.1-1.3L25 17.9l-2.5 6.4c0 .7.6 1.1 1.1 1.3v20.8h-5.5v2.7h13.7v-2.7h-5.5V25.6z"/>
<path class="${state}" fill="var(--button-card-light-color-no-temperature)" d="M24.6.9l-9.4.5c-.6.1-1.9 0-2.5 2.1s-2.4 9.1-4 16.9c-.2.7-.5 2-.5 2.3s-.4 1.6.9 1.6c.8.1 7.4.3 15.9.3 8.6 0 15.1-.3 15.9-.3 1.3-.1.9-1.3.9-1.6s-.3-1.6-.5-2.3c-1.6-7.8-3.4-14.8-4-16.9s-1.9-2-2.5-2.1c-1.6-.2-6.9-.4-9.4-.5"/> </svg>`;]]]
styles:
custom_fields:
icon_shade:
[top: 11%, left: 4.6%, width: 3.05vw, position: absolute]
template: light
#################################################
# #
# TV #
# #
#################################################
- type: custom:button-card
entity: media_player.sony_bravia
triggers_update:
['media_player.sony_bravia', 'input_boolean.sony_bravia']
style:
top: 37.9%
left: 30.31%
width: 10%
tap_action: &tv_tap_action
services: |
[[[ if (entity.state === 'off') {
hass.callService('input_boolean', 'turn_on', {entity_id: entity.entity_id.replace(entity.entity_id.split('.')[0], 'input_boolean')});
hass.callService('media_player', 'turn_on', {entity_id: entity.entity_id}); }
if (entity.state === 'on') {
hass.callService('input_boolean', 'turn_on', {entity_id: entity.entity_id.replace(entity.entity_id.split('.')[0], 'input_boolean')});
hass.callService('media_player', 'turn_off', {entity_id: entity.entity_id});
hass.callService('media_player', 'turn_off', {entity_id: entity.entity_id.replace('sony_bravia', 'vardagsrum').replace('samsung_tv_remote', 'sovrum')}); } ]]]
hold_action: !include popup/vardagsrum_tv.yaml
custom_fields:
icon_tv: &icon_tv >
[[[ const boolean = states[entity.entity_id.replace(entity.entity_id.split('.')[0], 'input_boolean')].state;
const style = '<style>@keyframes animate_on{from{transform: scaleY(0);}to{transform: scaleY(1);}}.animate_on{animation: animate_on 1s; transform-origin: -100% 46%; animation-fill-mode: forwards;}@keyframes animate_off{from{transform: scaleY(1);}to{transform: scaleY(0);}}.animate_off{animation: animate_off 1s; transform-origin: -100% 46%; animation-fill-mode: forwards;}</style>';
const path = '<path d="M46 9.2v27.5H4.1V9.2H46m2.4-2.4H1.6v32.3h46.7c.1 0 .1-32.3.1-32.3zM11.9 43.2h26.3c.6 0 1.1-.4 1.1-1v-.3c0-.6-.4-1.1-1-1.1H11.9c-.6 0-1.1.4-1.1 1v.3a1.11 1.11 0 0 0 1.1 1.1z"/>';
const gradient = '<linearGradient id="A" gradientUnits="userSpaceOnUse" x1="5.401" y1="34.714" x2="43.817" y2="11.74"><stop offset="0" stop-color="#64acb7"/><stop offset="1" stop-color="#7fdbe9"/></linearGradient>';
if (entity.state === 'off' && boolean === 'off') { return `<svg viewBox="0 0 50 50"> ${style} ${gradient} <path class="animate_off" d="M2.9,8h44.3v29.9H2.9V8z" fill="url(#A)"/> ${path} </svg>`; }
if (entity.state === 'on' && boolean === 'off') { return `<svg viewBox="0 0 50 50"> ${style} ${gradient} <path d="M2.9,8h44.3v29.9H2.9V8z" fill="#20262890"/><path class="animate_on" d="M2.9,8h44.3v29.9H2.9V8z" fill="url(#A)"/> ${path} </svg>`; }
if (entity.state === 'on' && boolean === 'on') { return `<svg viewBox="0 0 50 50"> ${gradient} <path d="M2.9,8h44.3v29.9H2.9V8z" fill="url(#A)"/> ${path} </svg>`; }
else if (entity.state === 'off' && boolean === 'on') { return `<svg viewBox="0 0 50 50"> ${path} </svg>`; } ]]]
styles: &icon_tv_styles
custom_fields:
icon_tv:
[fill: "[[[ return entity.state === 'on' ? '#616161' : '#9da0a2'; ]]]",
top: 7%, left: 10.7%, width: 3.5vw, position: absolute]
template: ['base', 'loader']
#################################################
# #
# PLAYSTATION #
# #
#################################################
- type: custom:button-card
entity: switch.playstation_4
triggers_update:
['switch.playstation_4', 'input_boolean.playstation_4']
style:
top: 37.9%
left: 41.31%
width: 10%
tap_action:
action: toggle
hold_action: !include popup/vardagsrum_playstation.yaml
custom_fields:
icon_ps4: >
[[[ if (entity.state === 'on') { return '<svg viewBox="0 0 50 50"> <style>@keyframes animate{50%{transform: translateY(0);}100%{transform: translateY(-45%);}}.animate{animation: animate 2s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;}</style>
<g style="clip-path: url(#mask);"><g class="animate"><path fill="#00aa9e" d="M49.2 38.9l-75.6-25.1v7.4l75.6 25.2z"/><path fill="#f3c202" d="M49.2 46.4l-75.6-25.2v7.5l75.6 25.1z"/><path fill="#326db3" d="M49.2 53.8l-75.6-25.1V51l75.6 25.1zm0-22.3L-26.4 6.4v7.4l75.6 25.1z"/></g></g>
<defs><clipPath id="mask"><path d="M47.5 33.2c-.5-2.2-3.9-3.5-9.1-3.9-3.8-.3-7.5.6-11.1 1.9l-.6.2v-5.7l-5.7.8-4.6 1.6L6 31.9h-.1c-1.9.7-3.8 2.2-3.7 4.2.1 2.1 4.7 2.6 8.2 3.2 3.3.6 6.2.2 8.9-.7l7.3 4.8L33 41l10.7-4h.1c2.8-1 4-2.5 3.7-3.8zm-31.3 2l-3.6 1.3c-2.2.8-4.1-1.1-2.1-1.9l1.7-.6 7.2-2.7v2.8l-3.2 1.1zm22.5-1.1l-1.9.7-10.2 3.7V36l6.5-2.4 3.8-1.3c4-.9 5.6.5 1.8 1.8z"/></clipPath></defs><path fill="#de0029" d="M26.7 14.6v28.7l-7.3-2.5V7.1l9.3 2.6c6 1.7 9.6 5 9.6 10.7-.1 6.7-3 9.4-8.7 7.6V14.9c-.1-1.6-2.9-1.7-2.9-.3h0z"/></svg>'; }
else { return '<svg viewBox="0 0 50 50"><path fill="#9da0a2" d="M43.8 37h-.1l-10.6 4-4.2 1.6v-4.9l8-2.9 1.9-.7c3.8-1.3 2.2-2.7-1.8-1.9l-3.8 1.3-4.3 1.6v-4.5c3.1-1 6.3-1.6 9.5-1.4 5.3.4 8.7 1.6 9.1 3.9.3 1.4-.9 2.9-3.7 3.9zm-26.7-2.1l-.9.3-3.6 1.3c-2.2.8-4.1-1.1-2.1-1.9l1.7-.6 5-1.9v-4.2l-.6.2L6 31.9h-.1c-1.9.7-3.8 2.2-3.7 4.2.1 2.1 4.7 2.6 8.2 3.2 2.4.4 4.6.3 6.7-.1v-4.3zm12.4-20V28c5.7 1.7 8.7-.9 8.7-7.6.1-5.7-3.6-9-9.6-10.7l-9.3-2.6v33.8l7.2 2.5.1.1V14.6c.1-1.4 2.9-1.3 2.9.3z"/></svg>'; } ]]]
styles:
custom_fields:
icon_ps4:
[top: 7%, left: 10%, width: 3.5vw, position: absolute]
template: ['base', 'loader']
##########################################################################
# #
# * STUDIO * #
# #
##########################################################################
- prefix: Studio
<<: *title
style:
top: 9.15%
left: 50.2%
<<: *title-style
#################################################
# #
# DATORLAMPA #
# #
#################################################
- type: custom:button-card
entity: light.datorlampa
style:
top: 20.35%
left: 55.18%
width: 10%
custom_fields:
icon_hue: *icon_hue
styles: *icon_hue_styles
template: light
#################################################
# #
# TAKLAMPOR #
# #
#################################################
- type: custom:button-card
entity: light.taklampor
style:
top: 20.35%
left: 66.14%
width: 10%
custom_fields:
icon_spot: &icon_spot >
[[[ const state = entity.state === 'on' ? 'animate_on' : 'animate_off';
return `<svg viewBox="0 0 50 50"><style>@keyframes animate_on{0%{transform: rotateZ(0deg); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0);}70%{transform: rotateZ(-15deg); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);}75%{transform: rotateZ(-15deg); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);}88%{transform: rotateZ(-11deg);}100%{transform: rotateZ(-15deg);}}.animate_on{animation: animate_on 0.7s; transform-origin: 40% 20%; animation-fill-mode: forwards; animation-delay: -0.1s;}@keyframes animate_off{0%{transform: rotateZ(-15deg); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0);}70%{transform: rotateZ(0deg); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);}75%{transform: rotateZ(0deg); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);}88%{transform: rotateZ(-4deg);}100%{transform: rotateZ(0deg);}}.animate_off{animation: animate_off 0.7s; transform-origin: 40% 20%; animation-fill-mode: forwards;}</style>
<path style="clip-path: url(#mask);" fill="#9da0a2" d="M40.5.8H17.1c-.1 0-.1 0-.1.1A3.12 3.12 0 0 0 20.1 4h6.1c.1 0 .1 0 .1.1v7.4L18 19.1l3.6 3.5 9.1-8.6c.4-.4.6-1 .7-1.6V4c0-.1 0-.1.1-.1h6c1.7.1 3.1-1.3 3-3.1z"/><defs><clipPath id="mask"><path class="${state}" d="M0 9.1h24l8.3 8.8H50V-9H0z"/></clipPath></defs><path class="${state}" fill="var(--button-card-light-color-no-temperature)" d="M25.5 46.4s1.4.5 10.4-8.2c.5-.4 6.3-6.3 5.8-7.1-.7-.8-18.6-19.5-18.6-19.5s-.6-.9-8.6 6.4c-.6.5-8.7 8-7.7 9.1l18.7 19.3z"/></svg>`; ]]]
styles: &icon_spot_styles
custom_fields:
icon_spot:
[top: 11.5%, left: 8%, width: 2.7vw, position: absolute]
template: light
#################################################
# #
# DATOR #
# #
#################################################
- type: custom:button-card
entity: switch.computer_imac
triggers_update:
['switch.computer_imac', 'input_boolean.computer_imac',
'input_boolean.computer_lock', 'script.home_leave']
style:
top: 37.9%
left: 55.18%
width: 10%
tap_action:
action: toggle
animate_locked: |
[[[ if (states['input_boolean.computer_lock'].state === 'on' && states['input_boolean.computer_imac'].state === 'off') {
this.shadowRoot.getElementById('lock').classList.add('locked');
window.setTimeout(() => { this.shadowRoot.getElementById('lock').classList.remove('locked'); }, 1100) } ]]]
hold_action: !include popup/studio_dator.yaml
custom_fields:
icon_imac: >
[[[ const state = entity.state === 'on' ? 'animate' : null;
return `<svg viewBox="0 0 50 50"><style>@keyframes animate{from{opacity: 0.5; transform: scale(0.6);}100%{opacity: 1;}}.animate{animation: animate 0.8s cubic-bezier(0.25, 1, 0.5, 1); transform-origin: center;}</style>
<path class="${state}" d="M31.9 44.5c-1-.3-1.9.4-1.9-3.7h-9.9c0 4.2-.9 3.4-1.9 3.7s-.2.7-.2.7h14.1s.8-.3-.2-.7zM47.6 4.8H2.5c-1.1 0-2 .9-2 2v30.1c0 1.1.9 2 2 2h45c1.1 0 2-.9 2-2v-30a1.95 1.95 0 0 0-1.9-2.1zm-.7 26.4H3.2V7.6H47v23.6z"/></svg>`; ]]]
icon_lock: >
[[[ const state = states['script.home_leave'].state === 'on' ? 'locked' : null;
if (states['input_boolean.computer_lock'].state === 'on' && states['input_boolean.computer_imac'].state === 'off') {
return `<svg viewBox="0 0 50 50"><style>@keyframes locked{from, to{transform: translateX(0);}10%, 30%, 50%, 70%, 90%{transform: translateX(-8%);}20%, 40%, 60%, 80%{transform: translateX(8%);}}.locked{animation: locked 1.1s;}</style>
<path id="lock" class="${state}" d="M8.2 22.6h2.4v-7.2C10.6 7.5 17.1 1 25 1s14.4 6.4 14.4 14.4v7.2h2.4V49H8.2m26.4-26.4v-7.2c0-5.3-4.3-9.6-9.6-9.6s-9.6 4.3-9.6 9.6v7.2"/></svg>`; } ]]]
styles:
custom_fields:
icon_imac:
[fill: "[[[ return entity.state === 'on' ? '#72757c' : '#9da0a2'; ]]]",
top: 8.5%, left: 11%, width: 3.3vw, position: absolute]
icon_lock:
[top: 11%, left: 73%, width: 1.7vw, position: absolute, fill: '#b0b3b6']
template: ['base', 'loader']
#################################################
# #
# MONITORER #
# #
#################################################
- type: custom:button-card
entity: switch.wemo_monitors
triggers_update:
['switch.wemo_monitors', 'sensor.monitors_volume']
style:
top: 37.9%
left: 66.14%
width: 10%
tap_action:
action: toggle
hold_action: !include popup/studio_monitorer.yaml
custom_fields:
icon_monitors: >
[[[ if (entity.state === 'on') {
return '<svg viewBox="0 0 50 50"><style>@keyframes animate{35%{transform: scale(0.8); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1);}36%{transform: translateY(0%);}49%{transform: scale(1.25);}63%{transform: scale(0.85); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1);}77%{transform: scale(1.15); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1);}95%{transform: scale(1);}}.animate{animation: animate 1.4s; transform-origin: center;}@keyframes rubber{0%{transform: scale(1);}40%{transform: scale(1);}49%{transform: scale(0.95);}63%{transform: scale(1);}77%{transform: scale(0.95);}100%{transform: scale(1);}}.rubber{animation: rubber 1.3s; transform-origin: center;}</style>
<g class="rubber"><path fill="#686868" d="M35.8 46.9H14.2c-1.1 0-2-1-2-2.3V6.7c0-1.3.9-2.3 2-2.3h21.5c1.1 0 2 1 2 2.3v37.9c0 1.2-.9 2.3-1.9 2.3z"/><path fill="#2a2a2a" d="M39.2 1H10.8C9.4 1 8.3 2.1 8.2 3.5v42.9a2.65 2.65 0 0 0 2.6 2.6h28.3c1.4 0 2.5-1.2 2.6-2.6V3.5c0-1.4-1.1-2.5-2.5-2.5zM25 7c1.3 0 2.4 1.1 2.4 2.4s-1.1 2.4-2.4 2.4-2.4-1.1-2.4-2.4C22.5 8 23.6 7 25 7zm10.2 35.5l-.4 1.9s-.2.6-.6.6H15.8c-.4 0-.6-.6-.6-.6s-.1-1.1-.4-1.9.6-.9.6-.9h19.3c0-.1.8-.1.5.9z"/> </g> <path class="animate" fill="#e5dd00" d="M25 15.7c-6.2 0-11.3 5.1-11.3 11.3S18.8 38.3 25 38.3 36.3 33.2 36.3 27c-.1-6.3-5.1-11.3-11.3-11.3zm0 14.5a3.33 3.33 0 0 1-3.3-3.3 3.33 3.33 0 0 1 3.3-3.3 3.33 3.33 0 0 1 3.3 3.3c-.1 1.9-1.5 3.3-3.3 3.3z"/></svg>'; }
else { return '<svg viewBox="0 0 50 50"><path fill="#9da0a2" d="M25 18.6c-4.6 0-8.4 3.8-8.4 8.4s3.8 8.4 8.4 8.4 8.4-3.8 8.4-8.4-3.7-8.4-8.4-8.4zm0 11.7a3.33 3.33 0 0 1-3.3-3.3 3.33 3.33 0 0 1 3.3-3.3 3.33 3.33 0 0 1 3.3 3.3c0 1.8-1.4 3.3-3.3 3.3zM39.2 1H10.9C9.4 1 8.3 2.1 8.3 3.6v42.9a2.65 2.65 0 0 0 2.6 2.6h28.3a2.65 2.65 0 0 0 2.6-2.6v-43C41.7 2 40.5.9 39.2 1zM25 7c1.3 0 2.4 1.1 2.4 2.4s-1.1 2.4-2.4 2.4-2.4-1.1-2.4-2.4S23.7 7 25 7zm10.3 35.5l-.4 1.9s-.2.6-.6.6H15.8c-.4 0-.6-.6-.6-.6l-.4-1.9c-.2-.9.6-.9.6-.9h19.3s.9.1.6.9zM25 38.2c-6.2 0-11.3-5.1-11.3-11.3a11.29 11.29 0 1 1 22.6 0c.1 6.3-5 11.3-11.3 11.3z"/></svg>'; } ]]]
circle: >
[[[ if (entity.state === 'on') {
const volume = states['sensor.monitors_volume'].state;
const radius = 20.5; const circumference = radius * 2 * Math.PI;
return `<svg viewBox="0 0 50 50"><circle cx="25" cy="25" r="${radius}" stroke="#b2b2b2" stroke-width="1.5" fill="none" style="
transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: ${circumference}; stroke-dashoffset: ${circumference - volume / 100 * circumference};" />
<text x="50%" y="54%" fill="#8d8e90" font-size="14" text-anchor="middle" alignment-baseline="middle">${volume}<tspan font-size="10">%</tspan></text></svg>`; } ]]]
styles:
custom_fields:
icon_monitors:
[top: 11%, left: 7%, width: 2.8vw, position: absolute]
template: base
##########################################################################
# #
# * SOVRUM * #
# #
##########################################################################
- prefix: Sovrum
<<: *title
style:
top: 9.15%
left: 75.1%
<<: *title-style
#################################################
# #
# SÄNGLAMPOR #
# #
#################################################
- type: custom:button-card
entity: light.sanglampor
style:
top: 20.35%
left: 80.05%
width: 10%
custom_fields:
icon_lamp: &icon_lamp >
[[[ const state = entity.state === 'on' ? 'animate' : null;
return `<svg viewBox="0 0 50 50"><style>@keyframes animate{0%{transform: scale(0.85);}20%{transform: scale(1.1);}40%{transform: scale(0.95);}60%{transform: scale(1.03);}80%{transform: scale(0.97);}}.animate{animation: animate 0.8s; transform-origin: center;}</style>
<path fill="#9da0a2" d="M26.5 21.8l3.8-6.1H19.7l3.8 6.1c-5 .7-6.3 5.8-5.7 10.2.7 5.1 3.2 10.1 5.7 14.4H19v2.5h11.8v-2.5h-4.5C29 42 31.4 37 32.1 32c.6-4.4-.6-9.4-5.6-10.2zm3.1 9.1c-.3 4.3-2.3 8.7-4.4 12.4l-.2.1v.1-.1c-1.8-3-3.3-6.4-4.1-9.7-.7-3.1-1-7.2 2.7-8.4 1.4-.5 3.1-.1 4.2.8 1.6 1 1.8 3 1.8 4.8z"/>
<path class="${state}" fill="var(--button-card-light-color-no-temperature)" d="M38.1 20L35.7 3.8c-.3-1.9-.4-1.7-.6-2-.9-.6-2.3-.7-2.3-.7H17.4s-1.4 0-2.3.7c-.2.3-.3.1-.6 2C14 5.7 11.9 20 11.9 20s5.8.3 13.4.3h0c7.3 0 12.8-.3 12.8-.3z"/> </svg>`;]]]
styles: &icon_lamp_styles
custom_fields:
icon_lamp:
[top: 11%, left: 4.5%, width: 3.05vw, position: absolute]
template: light
#################################################
# #
# AIR PURIFIER #
# #
#################################################
- type: custom:button-card
entity: switch.air_purifier
triggers_update:
['switch.air_purifier', 'input_boolean.air_purifier']
style:
top: 20.35%
left: 91.05%
width: 10%
tap_action:
action: toggle
hold_action: !include popup/sovrum_luftrenare.yaml
custom_fields:
icon_air_purifier: >
<svg viewBox="0 0 50 50"><path d="M36.8 1.2v1.7a5.34 5.34 0 0 1-5.3 5.3H18.4a5.34 5.34 0 0 1-5.3-5.3V1.2c-2.6.4-4.7 2.8-4.7 5.6v36.5c0 3.1 2.6 5.7 5.7 5.7h21.8c3.1 0 5.7-2.6 5.7-5.7V6.8c0-2.8-2.1-5.2-4.8-5.6zm-1.7 35.6c-.2 0-.4 0-.5-.1-.4-.1-1.2-.2-2.4-.6-.5-.2-.8-.3-1.2-.4-.3-.1-.7-.3-1.4-.5-1-.4-1.5-.5-1.9-.6-.5-.1-1.1-.2-1.9-.2s-1.4.2-1.9.4c-1 .3-1.8.7-2.1.9l-.6.3a9.75 9.75 0 0 1-1.4.6c-.3.1-.9.3-1.6.3h-.3c-.4 0-1 0-2-.2-.3-.1-.6-.1-.8-.2v-2.7l1.3.3c.5.1 1.3.2 1.7.2.5 0 .9-.2 1.1-.2.4-.1.6-.2 1-.4.2-.1.4-.2.7-.4.4-.2 1.3-.7 2.5-1 .6-.2 1.4-.4 2.5-.5s2 .1 2.5.2c.6.1 1.2.3 2.2.7l1.5.5c.3.1.6.2 1 .4 1 .3 1.8.5 2.1.5h.1v2.7zm0-6c-.2 0-.4 0-.5-.1-.4-.1-1.2-.2-2.4-.6-.5-.2-.8-.3-1.2-.4-.3-.1-.7-.3-1.4-.5-1-.4-1.5-.5-1.9-.6-.5-.1-1.1-.2-1.9-.2s-1.4.2-1.9.4c-1 .3-1.8.7-2.1.9l-.6.3a9.75 9.75 0 0 1-1.4.6c-.3.1-.9.3-1.6.3h-.3c-.4 0-1 0-2-.2-.3-.1-.6-.1-.8-.2v-2.7l1.3.3c.5.1 1.3.2 1.7.2.5 0 .9-.2 1.1-.2.4-.1.6-.2 1-.4.2-.1.4-.2.7-.4.4-.2 1.3-.7 2.5-1 .6-.2 1.4-.4 2.5-.5s2 .1 2.5.2c.6.1 1.2.3 2.2.7l1.5.5c.3.1.6.2 1 .4 1 .3 1.8.5 2.1.5h.1v2.7zm0-6c-.2 0-.4 0-.5-.1-.4-.1-1.2-.2-2.4-.6-.5-.2-.8-.3-1.2-.4-.3-.1-.7-.3-1.4-.5-1-.4-1.5-.5-1.9-.6-.5-.1-1.1-.2-1.9-.2s-1.4.2-1.9.4c-1 .3-1.8.7-2.1.9l-.6.3c-.4.2-.8.4-1.4.6-.3.1-.9.3-1.6.3h-.3c-.4 0-1 0-2-.2-.3-.1-.6-.1-.8-.2v-2.7l1.3.3c.5.1 1.3.2 1.7.2.5 0 .9-.2 1.1-.2.4-.1.6-.2 1-.4.2-.1.4-.2.7-.4.4-.2 1.3-.7 2.5-1 .6-.2 1.4-.4 2.5-.5s2 .1 2.5.2c.6.1 1.2.3 2.2.7l1.5.5c.3.1.6.2 1 .4 1 .3 1.8.5 2.1.5h.1v2.7zM15.7 1.9v-.8h18.6V3c0 1.5-1.2 2.8-2.8 2.8H18.4c-1.5 0-2.8-1.2-2.8-2.8V1.9z"/></svg>
styles:
custom_fields:
icon_air_purifier:
[top: 11%, left: 6.3%, width: 3.05vw, position: absolute,
fill: "[[[ return entity.state === 'on' ? '#5daeea' : '#9da0a2'; ]]]"]
template: ['base', 'loader']
#################################################
# #
# FAN #
# #
#################################################
- type: custom:button-card
entity: fan.sovrum_anslut
triggers_update:
['fan.sovrum_anslut', 'input_boolean.sovrum_anslut']
style:
top: 37.9%
left: 80.05%
width: 10%
tap_action:
action: toggle
hold_action: !include popup/sovrum_flakt.yaml
custom_fields:
icon_fan: >
[[[ const boolean = states[entity.entity_id.replace(entity.entity_id.split('.')[0], 'input_boolean')].state;
const style = '<svg viewBox="0 0 50 50"> <style>@keyframes rotate{0%{visibility:visible;transform:rotate(0deg)}100%{transform:rotate(1080deg)}}.start{animation:rotate 2.8s ease-in;transform-origin:center;fill:#5daeea;visibility:hidden}.on_delay{animation:rotate 1.8s linear infinite;transform-origin:center;fill:#5daeea;animation-delay:2.8s;visibility:hidden}.on{animation:rotate 1.8s linear infinite;transform-origin:center;fill:#5daeea;visibility:hidden}.end{animation:rotate 2.8s;transform-origin:center;fill:#9ca2a5;animation-timing-function:cubic-bezier(.61,1,.88,1)}</style>';
const path = '<circle cx="25" cy="25" r="6.6"/> <path d="M31.9 30.4c-.5.6-1.1 1.1-1.7 1.5-1.4 1.1-3.2 1.7-5.2 1.7-2.3 0-4.5-.9-6-2.4-.9 1.1-1.6 2.3-2.3 3.2l-4.9 5.4c-1.8 2.7.3 5.6 2.5 7 3.9 2.4 9.8 3.1 14.1 1.9 4.6-1.3 7.9-4.7 7.4-9.7-.2-3.4-1.9-6-3.9-8.6zM17 28.3c-.4-1-.6-2.1-.6-3.3a8.7 8.7 0 0 1 6.4-8.4l-1.6-3.5L19 6.2c-1.5-2.8-5-2.5-7.3-1.2-4 2.2-7.5 6.9-8.7 11.3-1.2 4.6.2 9.2 4.7 11.3 3.1 1.3 6.1 1.2 9.3.7zm26.9-17.6c-3.3-3.4-8-4.6-12.1-1.8-2.8 1.8-4.2 4.6-5.5 7.5 4.2.6 7.4 4.2 7.4 8.6 0 .9-.1 1.7-.4 2.5 1.3.2 2.8.3 3.8.4 2.3.4 4.7 1.3 7.1 1.7 3.2.3 4.7-3 4.8-5.6.3-4.6-1.9-10.1-5.1-13.3z"/>';
if (entity.state === 'off' && boolean === 'off') { return `${style}<g class="end">${path}</g></svg>`; }
if (entity.state === 'on' && boolean === 'off') { return `${style}<g class="start">${path}</g><g class="on_delay">${path}</g></svg>`; }
if (entity.state === 'on' && boolean === 'on') { return `${style}<g class="on">${path}</g></svg>`; }
else if (entity.state==='off' && boolean==='on') { return `${style}<g fill="#9ca2a5">${path}</g></svg>`; } ]]]
styles:
custom_fields:
icon_fan:
[top: 9%, left: 10%, width: 3vw, position: absolute]
template: ['base', 'loader']
#################################################
# #
# TV2 #
# #
#################################################
- type: custom:button-card
entity: media_player.samsung_tv_remote
triggers_update:
['media_player.samsung_tv_remote', 'input_boolean.samsung_tv_remote']
style:
top: 37.9%
left: 91.05%
width: 10%
tap_action: *tv_tap_action
hold_action: !include popup/sovrum_tv2.yaml
custom_fields:
icon_tv: *icon_tv
styles: *icon_tv_styles
template: ['base', 'loader']
##########################################################################
# #
# * MEDIA * #
# #
##########################################################################
- prefix: Media
<<: *title
style:
top: 53.4%
left: 25.4%
<<: *title-style
- type: custom:swipe-card
start_card: 1
parameters:
roundLengths: true
effect: coverflow
speed: 650
spaceBetween: 20
threshold: 7
coverflowEffect:
rotate: 80
depth: 300
style:
top: 56.55%
left: 35.8%
width: 20.97%
height: 1px
--ha-card-border-radius: .88vw
cards:
- type: picture-elements
image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' /%3E"
elements:
#################################################
# #
# RECENTLY DOWNLOADED #
# #
#################################################
- type: conditional
conditions:
- entity: input_select.conditional_media
state: Senast nedladdat
elements:
- type: custom:button-card
entity: sensor.plex_recently_added
triggers_update:
['sensor.plex_recently_added']
name: Senast nedladdat
state_display: >
[[[ const data = states[entity.entity_id].attributes.data;
const number = data[1].number == undefined ? '(' + data[1].aired.split('-')[0] + ')' : data[1].number;
return `${data[1].title} ${number}`; ]]]
custom_fields:
icon: >
<svg viewBox="0 0 50 50"><path d="M7.7.3h34.6c4.1 0 7.4 3.3 7.4 7.4v34.6c0 4.1-3.3 7.4-7.4 7.4H7.7c-4.1 0-7.4-3.3-7.4-7.4V7.7C.3 3.6 3.6.3 7.7.3z" fill="#282a2d"/><path d="M25,7.1H14.6L25,25L14.6,42.9H25L35.4,25L25,7.1z" fill="#e5a00d"/></svg>
blur: >
<svg viewBox="0 0 50 50" />
styles:
custom_fields:
media_image: &plex_poster
[background-position: center center, background-image:
"[[[ return 'url(' + states[entity.entity_id].attributes.data[1].fanart + ')'; ]]]"]
blur: *plex_poster
overlay: [background: 'rgba(0, 0, 0, 0.4)']
card:
[color: '#efefef', text-shadow: '1px 1px 5px rgba(18, 22, 23, 0.9)']
tap_action:
action: none
style:
top: 50%
left: 50%
width: 100%
template: conditional_media
#################################################
# #
# APPLE TV VARDAGSRUM #
# #
#################################################
- type: conditional
conditions:
- entity: input_select.conditional_media
state: Vardagsrum
elements:
- type: custom:button-card
entity: media_player.vardagsrum
custom_fields:
icon: &icon_apple_tv >
<svg viewBox="0 0 50 50"><path d="M25.2 49.7l-13.7-.1c-2.4 0-4.6-.8-6.5-2.2-2-1.6-3.6-3.6-4.3-6.2-.2-1-.2-1.9-.3-3V11.5C.5 7.9 1.9 5 4.8 2.7 6.2 1.6 7.8.8 9.6.5c.5-.1.9-.1 1.4-.1L27.5.3l10.9.1c2.6 0 4.8.8 6.7 2.4 2.1 1.7 3.7 3.9 4.2 6.6l.2 2.4.1 20.5-.1 6.7c-.1 2.2-.9 4.2-2.2 5.9-1.7 2.2-4 3.8-6.8 4.4-.6.1-1.2.2-1.9.2-.1.1-13.4.2-13.4.2zm-4-27.8c-.9-1.2-2.2-1.6-3.7-1.2-.4.1-.8.2-1.2.4-.3.1-.6.1-.8 0-.4-.1-.8-.3-1.2-.4-.3-.1-.7-.1-1-.1-1.5.2-2.4 1.1-3 2.6-.4 1.1-.3 2.2 0 3.5.4 1.5 1 2.9 2.1 4 .5.6 1.2.9 2 .6 1.1-.5 2.2-.5 3.4 0 .8.3 1.5 0 2.1-.6.7-.8 1.1-1.8 1.6-2.8v-.2c-1-.6-1.7-1.4-1.8-2.7-.2-1.4.5-2.4 1.5-3.1zm9.9-1.4c.1.2.1.3.1.4l3.6 9.5c.1.3.3.4.6.4h.7c.6 0 .6 0 .9-.6l3.7-9.4c.1-.1.1-.3.2-.5H39l-2.9 8.3-3.1-8.3-1.9.2zM27.3 18l-1.3.4c-.5.2-.5.2-.6.7v1.4h-1.6l.1 1.4h1.5v5c0 .7.1 1.4.2 2.1.1.5.3 1 .8 1.4.8.6 2.6.7 3.5.2l-.1-1.2h-1.3c-.5 0-.9-.3-1-.8-.1-.3-.2-.6-.2-1v-5.8H30c0-.5.1-1 0-1.4h-2.7V18zm-8.8-.9c-1.9.3-3 2-2.7 3.2 1.4.2 2.9-1.7 2.7-3.2z"/></svg>
style:
top: 50%
left: 50%
width: 100%
template: conditional_media
#################################################
# #
# APPLE TV SOVRUM #
# #
#################################################
- type: conditional
conditions:
- entity: input_select.conditional_media
state: Sovrum
elements:
- type: custom:button-card
entity: media_player.sovrum
custom_fields:
icon: *icon_apple_tv
style:
top: 50%
left: 50%
width: 100%
template: conditional_media
#################################################
# #
# PLAYSTATION 4 #
# #
#################################################
- type: conditional
conditions:
- entity: input_select.conditional_media
state: PlayStation 4
elements:
- type: custom:button-card
entity: media_player.playstation_4
custom_fields:
icon: &icon_ps4 >
<svg viewBox="0 0 50 50"><path d="M.3 25C.3 11.3 11.4.3 25 .3 38.8.3 49.7 11.6 49.7 25c0 13.7-11.1 24.7-24.7 24.7C11.2 49.7.2 38.5.3 25zM26 35.4V16.8c0-.3.1-.6.4-.7.3-.2.6 0 .9.2.4.3.6.8.6 1.3v7.1c0 .5.1.7.6.8.3.1.5.2.8.2 1.7.4 3-.3 3.6-2 0-.1.1-.2.1-.3.3-1.1.4-2.1.3-3.2-.1-1.3-.5-2.5-1.3-3.5-.9-1.2-2.1-1.9-3.6-2.3l-6.8-2h-.3v20.8c0 .6 0 .6.6.8l3.4 1.2c.2.1.4.1.7.2h0zm1-.3c.2 0 .3-.1.4-.1l10.5-3.9c.6-.2 1-.6 1.5-1 .5-.5.5-1 0-1.5-.1-.2-.3-.3-.5-.4-.6-.5-1.3-.8-2-1-2.1-.6-4.3-.8-6.5-.5-1 .2-2 .5-3 .7-.3.1-.4.2-.4.6v2.2c0 .1.1.1.1.2.2-.1.4-.1.5-.2l4.6-1.6c.6-.2 1.2-.3 1.9-.3.3 0 .5 0 .7.1s.4.2.4.3-.2.3-.3.4c-.3.2-.5.3-.8.4l-3.2 1.2-3.5 1.3c-.4.1-.5.3-.5.7v2.4zM20.3 30c-.2.1-.3.1-.4.1l-1.7.6c-.7.2-1.4.4-2.1.4-.4 0-.7-.1-1-.2-.1 0-.3-.2-.3-.3s.1-.3.2-.3c.2-.1.5-.2.7-.3l4.2-1.6c.4-.1.5-.3.5-.7v-1.9c0-.1 0-.2-.1-.4-.2.1-.4.1-.5.2L13 28.1c-.7.3-1.4.7-2.1 1.1-.8.5-.8 1.3-.1 1.9.3.2.6.5.9.6 2.1.8 4.2 1.3 6.5 1.2.6 0 1.1-.1 1.6-.2.4-.1.5-.2.5-.6V30z" /></svg>
style:
top: 50%
left: 50%
width: 100%
template: conditional_media
#################################################
# #
# GOOGLE NEST MINI #
# #
#################################################
- type: conditional
conditions:
- entity: input_select.conditional_media
state: Google Nest Mini
elements:
- type: custom:button-card
entity: media_player.google_nest_mini
custom_fields:
icon: &icon_nest_mini >
<svg viewBox="0 0 50 50"><path d="M49.7 25c0 13.6-11.1 24.7-24.8 24.7C11.3 49.7.3 38.6.3 25S11.4.3 25 .3 49.7 11.4 49.7 25zm-33.9 0a2.22 2.22 0 0 0-2.2-2.2c-1.2 0-2.3 1-2.3 2.2a2.22 2.22 0 0 0 2.2 2.2c1.3.1 2.3-.9 2.3-2.2h0zm10.8 0c0 1.2.9 2.2 2.2 2.3 1.3 0 2.3-1 2.3-2.2 0-1.3-1-2.3-2.2-2.3-1.3 0-2.3.9-2.3 2.2zm-3.2 0a2.22 2.22 0 0 0-2.2-2.2c-1.2 0-2.3 1-2.3 2.2a2.22 2.22 0 0 0 2.2 2.2c1.3 0 2.3-.9 2.3-2.2h0zm13 2.2a2.22 2.22 0 0 0 2.2-2.2c0-1.2-1-2.3-2.2-2.3a2.22 2.22 0 0 0-2.2 2.2c0 1.3 1 2.3 2.2 2.3z" /></svg>
style:
top: 50%
left: 50%
width: 100%
template: conditional_media
#################################################
# #
# * SMALL MEDIA CONTROLS * #
# #
#################################################
- type: picture-elements
image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' /%3E"
elements:
# SMALL APPLE TV VARDAGSRUM
- type: custom:button-card
entity: media_player.vardagsrum
custom_fields:
icon: *icon_apple_tv
style:
top: 23.9%
left: 23.8%
width: 47.7%
template: media
# SMALL APPLE TV SOVRUM
- type: custom:button-card
entity: media_player.sovrum
custom_fields:
icon: *icon_apple_tv
style:
top: 23.9%
left: 76.2%
width: 47.7%
template: media
# SMALL PLAYSTATION 4
- type: custom:button-card
entity: media_player.playstation_4
name: Playstation
custom_fields:
icon: *icon_ps4
style:
top: 76.2%
left: 23.8%
width: 47.7%
template: media
# SMALL GOOGLE NEST MINI
- type: custom:button-card
entity: media_player.google_nest_mini
name: Nest Mini
custom_fields:
icon: *icon_nest_mini
style:
top: 76.2%
left: 76.2%
width: 47.7%
template: media
##########################################################################
# #
# * ÖVRIGT * #
# #
##########################################################################
- prefix: Övrigt
<<: *title
style:
top: 53.4%
left: 50.2%
<<: *title-style
#################################################
# #
# BADRUM #
# #
#################################################
- type: custom:button-card
entity: light.badrum
style:
top: 64.5%
left: 55.18%
width: 10%
custom_fields:
icon_bathroom: >
[[[ const state = entity.state === 'on' ? 'animate_on' : 'animate_off';
return `<svg viewBox="0 0 50 50" fill="var(--button-card-light-color-no-temperature)"><style>@keyframes animate_on{0%{transform: rotateZ(0deg) translate(0%, 0%);}100%{transform: rotateZ(-90deg) translate(-1.5%, 0%);}}@keyframes animate_off{0%{transform: rotateZ(-90deg) translate(-1.5%, 0%);}45%{transform: rotateZ(-40deg);}55%{transform: rotateZ(0deg);}65%{transform: rotateZ(-15deg);}75%{transform: rotateZ(0deg);}85%{transform: rotateZ(-5deg);}95%{transform: rotateZ(0deg);}}.animate_on{animation: animate_on 0.4s; animation-fill-mode: forwards; transform-origin: 45% 41%; transition-timing-function: cubic-bezier(0.85, 0, 0.15, 1);}.animate_off{animation: animate_off 1.05s linear; animation-delay: 0.05s; animation-fill-mode: both; transform-origin: 45% 41%;}</style>
<path d="M12.9 1.2h2.5c1.6 0 2.9 1.3 2.9 2.9v18.6c0 1.4 1.1 2.5 2.4 2.5h20.5c.5 0 1 .4.9 1-.1 2.6-1.2 9.6-10.2 11v7.6c0 .2.2.4.4.4h1.5a1.58 1.58 0 0 1 1.6 1.6v.3a1.58 1.58 0 0 1-1.6 1.6H11a1.58 1.58 0 0 1-1.6-1.6v-.3a1.58 1.58 0 0 1 1.6-1.6h1.6c.2 0 .4-.2.4-.4v-7.6s-5.2-.3-5.2-5.9V4.2c0-1.6 1.3-2.9 2.9-2.9l2.2-.1c0 .1 0 0 0 0z"/><path class="${state}" d="M22.3 18.8h18.3a1.58 1.58 0 0 1 1.6 1.6v.6a1.58 1.58 0 0 1-1.6 1.6h-19c-.4 0-.7-.3-.8-.7v-2.3c0-.4.3-.7.7-.8h.8z"/></svg>`;]]]
styles:
custom_fields:
icon_bathroom:
[top: 11%, left: 6.5%, width: 3vw, position: absolute]
template: light
#################################################
# #
# FLÄKT2 #
# #
#################################################
- type: custom:button-card
entity: fan.studio_wemo
style:
top: 64.5%
left: 66.14%
width: 10%
tap_action:
action: toggle
hold_action: !include popup/studio_flakt.yaml
custom_fields:
icon_fan: >
[[[ const path = '<circle cx="25" cy="25" r="6.6"/> <path d="M31.9 30.4c-.5.6-1.1 1.1-1.7 1.5-1.4 1.1-3.2 1.7-5.2 1.7-2.3 0-4.5-.9-6-2.4-.9 1.1-1.6 2.3-2.3 3.2l-4.9 5.4c-1.8 2.7.3 5.6 2.5 7 3.9 2.4 9.8 3.1 14.1 1.9 4.6-1.3 7.9-4.7 7.4-9.7-.2-3.4-1.9-6-3.9-8.6zM17 28.3c-.4-1-.6-2.1-.6-3.3a8.7 8.7 0 0 1 6.4-8.4l-1.6-3.5L19 6.2c-1.5-2.8-5-2.5-7.3-1.2-4 2.2-7.5 6.9-8.7 11.3-1.2 4.6.2 9.2 4.7 11.3 3.1 1.3 6.1 1.2 9.3.7zm26.9-17.6c-3.3-3.4-8-4.6-12.1-1.8-2.8 1.8-4.2 4.6-5.5 7.5 4.2.6 7.4 4.2 7.4 8.6 0 .9-.1 1.7-.4 2.5 1.3.2 2.8.3 3.8.4 2.3.4 4.7 1.3 7.1 1.7 3.2.3 4.7-3 4.8-5.6.3-4.6-1.9-10.1-5.1-13.3z"/>';
const style = '<svg viewBox="0 0 50 50"> <style>@keyframes rotate{0%{visibility: visible; transform: rotate(0deg);}100%{transform: rotate(1080deg);}}.start{animation: rotate 2.8s ease-in; transform-origin: center; fill: #5daeea; visibility: hidden;}.on{animation: rotate 1.8s linear infinite; transform-origin: center; fill: #5daeea; animation-delay: 2.8s; visibility: hidden;}.end{animation: rotate 2.8s; transform-origin: center; fill: #9ca2a5; animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);}</style>';
if (entity.state === 'on') { return `${style}<g class="start">${path}</g><g class="on">${path}</g></svg>`; }
else { return `${style}<g class="end">${path}</g></svg>`; } ]]]
styles:
custom_fields:
icon_fan:
[top: 9%, left: 10%, width: 3vw, position: absolute]
template: base
#################################################
# #
# GARDEROB #
# #
#################################################
- type: custom:button-card
entity: light.kladkammare_2
style:
top: 82.1%
left: 55.18%
width: 10%
custom_fields:
icon_closet: >
[[[ const state = entity.state === 'on' ? 'door' : 'door reverse'; const opacity = entity.state === 'on' ? 'room' : 'room reverse';
return `<svg viewBox="0 0 50 50"> <style>.door{animation: door 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;}.room{animation: room 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;}.reverse{animation-direction: reverse;}@keyframes door{0%{transform: none; fill: #9da0a2;}100%{transform: skewY(10deg) translate(4.5%, -3.9%) scaleX(0.8); fill: #b68349;}}@keyframes room{0%{opacity: 0;}100%{opacity: 1;}}</style>
<path class="${opacity}" d="M11.4,1.4h27.2v43.1H11.4V1.4z" fill="#bcbcbc"/><path class="${state}" d="M11.4 1.4v43.1h27.2V1.4H11.4zm23 23.4c0 1.1-.9 1.9-1.9 1.9h0c-1.1 0-1.9-.9-1.9-1.9V21c0-1.1.9-1.9 1.9-1.9h0c1.1 0 1.9.9 1.9 1.9v3.8z"/></svg>`; ]]]
styles:
custom_fields:
icon_closet:
[top: 11%, left: 4.1%, width: 3.2vw, position: absolute]
template: light
#################################################
# #
# HALL #
# #
#################################################
- type: custom:button-card
entity: light.hall
style:
top: 82.1%
left: 66.14%
width: 10%
custom_fields:
icon_spot: *icon_spot
styles: *icon_spot_styles
template: light
##########################################################################
# #
# * HEMMA * #
# #
##########################################################################
- prefix: Hemma
<<: *title
style:
top: 53.4%
left: 75.1%
<<: *title-style
#################################################
# #
# MATTIAS #
# #
#################################################
- type: custom:button-card
entity: person.mattias
triggers_update:
['person.mattias', 'sensor.time']
style:
top: 64.5%