-
Notifications
You must be signed in to change notification settings - Fork 76
/
ui-lovelace.yaml
1174 lines (1147 loc) 路 35.8 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
apexcharts_card_templates:
test2:
color_list:
- red
- red
test:
config_templates: test2
graph_span: 24h
color_list:
- black
all_series_config:
group_by:
duration: 1h
func: avg
stroke_width: 2
views:
- title: Main
panel: true
cards:
- type: grid
columns: 3
cards:
- type: custom:apexcharts-card
apex_config:
chart:
toolbar:
show: true
tools:
zoom: true
zoomin: true
zoomout: true
pan: true
reset: true
zoom:
enabled: true
fill:
type: gradient
gradient:
type: vertical
shadeIntensity: 0.8
stops:
- 0
- 1000
inverseColors: false
update_interval: 5sec
# stacked: true
series:
- entity: sensor.random_0_1000
name: Sensor 1
type: area
curve: straight
color: yellow
show:
extremas: true
- entity: sensor.random_0_1000
name: Sensor 1
invert: true
type: area
curve: straight
show:
extremas: time
# - entity: sensor.random_0_1000
# name: Sensor 2
# type: area
# offset: -1d
# invert: true
graph_span: 15min
cache: true
layout: minimal
header:
show: false
- type: custom:apexcharts-card
stacked: true
span:
offset: -1d
series:
- entity: sensor.random_0_1000
name: RAM Usage
unit: Mb
type: area
curve: smooth
- entity: sensor.random_0_1000
name: Ram Free
type: area
stroke_width: 20
graph_span: 15min
cache: true
layout: minimal
header:
floating: true
- type: custom:apexcharts-card
update_interval: 2s
stacked: true
experimental:
color_threshold: true
hidden_by_default: true
# disable_config_validation: true
series:
- entity: sensor.random_0_1000
name: test1
type: column
show:
datalabels: true
group_by:
duration: 1m
func: last
transform: return x/10;
color_threshold:
- value: 33
color: '#00ff00'
- value: 66
color: '#000001'
- value: 0
color: '#ff0000'
- entity: sensor.random0_100
name: test2
type: column
show:
hidden_by_default: true
datalabels: total
group_by:
duration: 1m
func: last
# color_threshold:
# - value: 0
# color: '#0000ff'
# - value: 33
# color: '#00ff00'
# - value: 66
# color: '#ff0000'
graph_span: 10min
cache: true
- type: custom:apexcharts-card
graph_span: 200h
series:
- entity: sensor.humidity
curve: straight
show:
extremas: true
- type: custom:apexcharts-card
graph_span: 1h
header:
title: Test Aggregate
show: true
show_states: true
colorize_states: true
series:
- entity: sensor.random0_100
name: AVG
curve: smooth
type: line
show:
as_duration: millisecond
in_header: true
in_chart: false
name_in_header: false
group_by:
duration: 10min
func: avg
- entity: sensor.random0_100
name: AVG
curve: smooth
type: line
show:
as_duration: minute
group_by:
duration: 10min
func: avg
- entity: sensor.random0_100
curve: smooth
name: MIN
type: line
show:
as_duration: hour
group_by:
duration: 10min
func: min
- entity: sensor.random0_100
curve: smooth
name: MAX
type: line
show:
as_duration: day
group_by:
duration: 10min
func: max
- entity: sensor.random0_100
curve: smooth
name: LAST
type: line
show:
# as_duration: month
in_header: true
in_chart: false
# show:
# as_duration: month
group_by:
duration: 10min
func: last
- entity: sensor.random0_100
curve: smooth
name: FIRST
type: line
show:
as_duration: year
in_header: raw
group_by:
duration: 10min
func: first
- entity: sensor.random0_100
curve: smooth
name: DIFF
type: line
show:
as_duration: year
in_header: true
in_chart: false
group_by:
duration: 10min
func: diff
- type: custom:apexcharts-card
graph_span: 4h
header:
title: Test
series:
- entity: sensor.humidity
type: area
name: Outside Humidity
opacity: 0.3
group_by:
func: avg
duration: 1h
- entity: sensor.random0_100
type: area
name: Office Humidity
opacity: 0.3
group_by:
func: avg
duration: 1h
show:
datalabels: true
- type: sensor
entity: sensor.humidity
graph: line
- type: custom:apexcharts-card
graph_span: 6h
header:
show: false
series:
- entity: sensor.humidity
type: line
name: Outside Humidity
fill_raw: last
group_by:
func: avg
fill: last
duration: 30min
- entity: sensor.random0_100
fill_raw: last
type: column
name: Office Humidity
group_by:
func: avg
duration: 30min
# color_threshold:
# - value: 49
# color: '#ff0000'
# - value: 0
# color: '#00ff00'
- type: custom:apexcharts-card
header:
show: true
title: Start of day
graph_span: 24h
span:
start: day
series:
- entity: sensor.random0_100
extend_to_end: false
type: column
show:
datalabels: true
group_by:
func: avg
fill: 'null'
- type: custom:apexcharts-card
header:
show: true
title: Last 8h
graph_span: 8h
span:
end: hour
apex_config:
yaxis:
- title:
text: test1
show: true
opposite: true
decimalsInFloat: 1
- title:
text: Test2
show: true
# opposite: true
decimalsInFloat: 1
series:
- entity: sensor.random0_100
extend_to_end: false
type: column
invert: true
float_precision: 3
group_by:
func: avg
fill: 'last'
show:
legend_value: true
datalabels: true
- entity: sensor.random0_100
extend_to_end: false
type: column
group_by:
func: avg
fill: 'last'
show:
datalabels: true
- entity: sensor.random0_100
extend_to_end: false
type: column
group_by:
func: avg
fill: 'last'
show:
datalabels: true
- type: custom:apexcharts-card
graph_span: 24h
span:
start: day
# y_axis_precision: 5
now:
show: true
color: '#ff0000'
label: Now
header:
show: true
show_states: true
yaxis:
- decimals: 5
series:
- entity: sensor.pvpc
float_precision: 5
show:
extremas: time
in_header: true
data_generator: |
return [...Array(22).keys()].map((hour) => {
const attr = 'price_' + `${hour}`.padStart(2, '0') + 'h';
const value = entity.attributes[attr];
return [moment().startOf('day').hours(hour).valueOf(), value];
})
- type: custom:apexcharts-card
graph_span: 8d
span:
start: day
offset: -3d
header:
show: true
title: Temperature Forecast
show_states: true
now:
show: true
label: 'now'
color: '#0066ff88'
apex_config:
legend:
show: false
series:
- entity: weather.openweathermap
name: Temperature
unit: 掳C
attribute: temperature
fill_raw: last
extend_to_end: false
group_by:
func: avg
duration: 1h
- entity: weather.openweathermap
type: line
extend_to_end: false
unit: 掳C
show:
in_header: after_now
data_generator: |
return entity.attributes.forecast.map((entry) => {
return [new Date(entry.datetime).getTime(), entry.temperature];
});
- type: custom:apexcharts-card
graph_span: 20min
experimental:
color_threshold: true
series:
- entity: sensor.random_0_1000
type: line
stroke_width: 2
color_threshold:
- value: 0
color: blue
- value: 250
color: green
- value: 500
color: yellow
# opacity: 0
- value: 500
color: orange
- value: 750
color: orange
- value: 750
color: red
- value: 1000
color: red
- type: custom:apexcharts-card
header:
show: true
title: radialBar
show_states: true
chart_type: radialBar
series:
- entity: sensor.random0_100
- entity: sensor.random_0_1000
unit: Mbits/s
float_precision: 4
min: 0
max: 1000
group_by:
func: avg
duration: 30min
- type: custom:apexcharts-card
chart_type: pie
header:
show: true
title: pie
series:
- entity: sensor.random0_100
unit: kWh
show:
datalabels: percent
- entity: sensor.random_0_1000
- type: custom:apexcharts-card
chart_type: donut
header:
show: true
title: donut
series:
- entity: sensor.random0_100
- entity: sensor.random_0_1000
- type: custom:apexcharts-card
chart_type: line
graph_span: 15m
header:
show: true
title: line
series:
- entity: sensor.random0_100
show:
extremas: true
color_threshold:
- value: 0
color: '#0000ff'
- value: 33
color: '#00ff00'
- value: 66
color: '#ff0000'
- entity: sensor.random_0_1000
show:
extremas: true
- type: custom:apexcharts-card
header:
show: true
title: scatter
chart_type: scatter
apex_config:
responsive:
- breakpoint: 400
options:
chart:
height: 500px
- breakpoint: 5000
options:
chart:
height: auto
series:
- entity: sensor.random0_100
group_by:
func: sum
duration: 20min
- entity: sensor.random_0_1000
group_by:
func: sum
duration: 20min
- type: custom:apexcharts-card
graph_span: 1h
update_delay: 5.5s
# apex_config:
# dataLabels:
# enabled: true
hours_12: true
header:
show: true
title: Light Brightness (attribute test)
series:
- entity: light.kitchen_lights
attribute: brightness
apex_config:
tooltip:
x:
format: MMM
- type: custom:apexcharts-card
header:
show: true
title: shouldn't extend to end with group_by
span:
start: day
series:
- entity: sensor.random0_100
group_by:
duration: 1h
func: last
- entity: sensor.random0_100
extend_to_end: false
group_by:
duration: 1h
func: last
- type: custom:apexcharts-card
update_interval: 2s
graph_span: 10s
header:
show: true
title: should show a line
series:
- entity: sensor.outside_temperature
curve: stepline
extend_to_end: true
- type: custom:apexcharts-card
update_delay: 3s
graph_span: 5min
series:
- entity: input_boolean.test_boolean
transform: "return x === 'on' ? 1 : 0;"
- type: custom:apexcharts-card
update_delay: 3s
graph_span: 5min
series:
- entity: input_boolean.test_boolean
transform: "return x === 'on' ? 1 : 0;"
- type: custom:apexcharts-card
update_delay: 3s
graph_span: 5min
series:
- entity: input_boolean.test_boolean
transform: "return x === 'on' ? 1 : 0;"
- type: custom:apexcharts-card
graph_span: 30min
header:
show: true
show_states: true
colorize_states: true
experimental:
color_threshold: true
series:
- entity: sensor.random0_100
transform: return x / 2 - 15;
show:
header_color_threshold: true
color_threshold:
- value: -10
# color can be a color name, rgb(r, g, b), '#0000ff' or var(--color-variable)
# default is: the default color of the serie
color: blue
# optional opacity, value from 0 to 1.
# Default is 1 for 'type: line' and 0.7 for `type: area`
opacity: 0
- value: 0
color: cyan
- value: 15
color: green
- value: 25
color: orange
- type: custom:apexcharts-card
graph_span: 30min
experimental:
color_threshold: true
header:
show: true
show_states: true
colorize_states: true
series:
- entity: sensor.random0_100
type: area
stroke_width: 0
opacity: 0.5
transform: return x / 2 - 15;
show:
header_color_threshold: true
invert: true
color_threshold:
- value: -10
# color can be a color name, rgb(r, g, b), '#0000ff' or var(--color-variable)
# default is: the default color of the serie
# color: blue
# optional opacity, value from 0 to 1.
# Default is 1 for 'type: line' and 0.7 for `type: area`
# opacity: 1
- value: 0
color: cyan
- value: 15
color: green
- value: 25
color: orange
- type: custom:apexcharts-card
graph_span: 30min
header:
show: true
show_states: true
colorize_states: true
experimental:
color_threshold: true
series:
- entity: sensor.random0_100
type: column
# stroke_width: 0
transform: return x / 2 - 15;
show:
header_color_threshold: true
color_threshold:
- value: -10
# color can be a color name, rgb(r, g, b), '#0000ff' or var(--color-variable)
# default is: the default color of the serie
# color: blue
# optional opacity, value from 0 to 1.
# Default is 1 for 'type: line' and 0.7 for `type: area`
opacity: 0
- value: 0
color: cyan
- value: 15
color: green
- value: 25
color: orange
- type: custom:apexcharts-card
config_templates:
- test
series:
- entity: sensor.temperature
- entity: sensor.temperature
- type: custom:apexcharts-card
experimental:
color_threshold: true
series:
- entity: sensor.temperature
fill_raw: last
type: column
color_threshold:
- value: -10
color: blue
opacity: 1
- value: 0
color: cyan
- value: 15
color: green
- value: 25
color: orange
data_generator: |
let res = [];
let i = -6;
start = new Date(start.getTime() - 4 * 1000 * 60 * 60);
Array.from(Array(28).keys()).forEach((entry, index) => {
res.push([new Date(start.getTime() + index * 1000 * 60 * 60).getTime(), i]);
i += 2;
if (i >= 28) i = -15;
});
return res;
- type: 'custom:apexcharts-card'
experimental:
color_threshold: true
graph_span: 12h
header:
show: true
show_states: true
colorize_states: true
series:
- entity: sensor.temperature
show:
header_color_threshold: true
curve: smooth
color_threshold:
- value: 300
color: green
- value: 700
color: '#82ed82'
- value: 1100
color: '#e8e041'
- value: 1600
color: '#e88941'
- value: 2100
color: '#e84141'
data_generator: |
let res = [];
let i = 400;
start = new Date(start.getTime() - 4 * 1000 * 60 * 60);
Array.from(Array(28).keys()).forEach((entry, index) => {
res.push([new Date(start.getTime() + index * 1000 * 60 * 60).getTime(), i]);
i += 200;
if (i >= 1401) i = 400;
});
return res;
now:
show: true
label: now
apex_config:
chart:
height: 250px
- type: 'custom:apexcharts-card'
show:
loading: false
apex_config:
chart:
height: 350
fill:
type: gradient
gradient:
type: vertical
fill: dark
shadeIntensity: 0
stops:
- 20
- 100
opacityFrom:
- 0.1
- 0.1
- 1
opacityTo:
- 0.6
- 0.6
- 0.3
plotOptions:
bar:
columnWidth: 50%
yaxis:
- show: true
title: Temp
min: -20
max: 30
- show: false
title: Temp
min: -20
max: 30
- show: true
title: Snow
min: 0
max: 40
opposite: true
- show: false
min: 0
max: 40
graph_span: 6d
span:
start: day
header:
show: true
title: Weather Forecast
all_series_config:
show:
extremas: time
series:
- entity: weather.home
type: area
fill_raw: last
extend_to_end: false
color: var(--yellowish)
name: Max
stroke_width: 2
data_generator: |
return entity.attributes.forecast.map((entry) => {
return [new Date(entry.datetime).getTime(), entry.temperature];
});
- entity: weather.home
type: area
fill_raw: last
extend_to_end: false
color: var(--cyanish)
name: Min
stroke_width: 2
data_generator: |
return entity.attributes.forecast.map((entry) => {
return [new Date(entry.datetime).getTime(), entry.templow];
});
- entity: weather.home
type: column
fill_raw: last
extend_to_end: false
color: 'rgba(255, 255, 255, 1)'
name: Snow
stroke_width: 0
data_generator: |
return entity.attributes.forecast.map((entry) => {
return [new Date(entry.datetime).getTime(), entry.temperature];
});
- entity: weather.home
type: column
fill_raw: last
extend_to_end: false
color: var(--cyanish)
name: Rain
stroke_width: 0
data_generator: |
return entity.attributes.forecast.map((entry) => {
return [new Date(entry.datetime).getTime(), entry.templow];
});
- type: 'custom:apexcharts-card'
span:
end: day
hours_12: false
header:
show: true
show_states: true
colorize_states: true
all_series_config:
stroke_width: 2
series:
- entity: sensor.pvpc
name: Daikin
type: column
group_by:
func: sum
duration: 120min
- type: custom:apexcharts-card
experimental:
color_threshold: true
brush: true
graph_span: 2h
brush:
selection_span: 10m
header:
show: true
title: test
standard_format: true
show_states: false
series:
- entity: sensor.random0_100
color: blue
type: area
stroke_width: 1
color_threshold:
- value: 0
color: red
- value: 50
color: yellow
- value: 100
color: green
- entity: sensor.random0_100
color: blue
stroke_width: 1
float_precision: 0
show:
in_brush: true
in_chart: false
- type: custom:apexcharts-card
graph_span: 1h
all_series_config:
type: column
series:
- entity: sensor.random0_100
name: last
group_by:
func: last
duration: 10min
- entity: sensor.random0_100
name: first
group_by:
func: first
duration: 10min
start_with_last: true
- type: custom:apexcharts-card
graph_span: 1 week
span:
end: week
all_series_config:
type: column
extend_to_end: false
group_by:
fill: 'null'
series:
- entity: sensor.random0_100
name: last
group_by:
func: last
duration: 10min
- entity: sensor.random0_100
name: first
group_by:
func: first
duration: 10min
start_with_last: true
- type: custom:apexcharts-card
graph_span: 1h
header:
show: true
show_states: true
series:
- entity: sensor.random0_100
name: last hour
- entity: sensor.random0_100
name: previous hour
offset: -1h
show:
offset_in_name: false
- type: custom:apexcharts-card
header:
show: true
title: Irradiance
show_states: true
colorize_states: true
now:
show: true
graph_span: 1d
span:
start: day
series:
- entity: sensor.random0_100
group_by:
func: avg
duration: 1h
- entity: sensor.random0_100
offset: -1d
group_by:
func: avg
duration: 1h
show:
in_header: before_now
- type: custom:apexcharts-card
header:
show: true
title: Shouldn't show a spike at the begining
graph_span: 60m
update_interval: 1m
span:
end: hour
series:
- entity: sensor.counter
type: column
# offset: +5min
group_by:
func: diff
duration: 10s
- type: custom:apexcharts-card
header:
show: true
title: Significant Updates
graph_span: 1m
series:
- entity: sensor.counter_no_significant_update
- type: custom:apexcharts-card
header:
show: true
title: Significant Updates
graph_span: 1h
apex_config:
xaxis:
labels:
formatter: >
EVAL:function(value) {
return "42";
}
yaxis:
labels:
formatter: |
EVAL:function(value) {
return "42";