forked from testuser7/apexcharts-card
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui-lovelace.yaml
616 lines (599 loc) 路 18.6 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
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
- 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: console.log(entity); 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
- 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
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
group_by:
func: avg
duration: 30min
- entity: sensor.random0_100
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: false
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
span:
start: day
y_axis_precision: 5
now:
show: true
color: '#ff0000'
label: Now
header:
show: true
show_states: true
series:
- entity: sensor.pvpc
float_precision: 5
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: false
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
chart_type: radialBar
series:
- entity: sensor.random0_100
- entity: sensor.random_0_1000
min: 0
max: 1000
- type: custom:apexcharts-card
chart_type: pie
header:
show: true
title: pie
series:
- entity: sensor.random0_100
- 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
color_threshold:
- value: 0
color: '#0000ff'
- value: 33
color: '#00ff00'
- value: 66
color: '#ff0000'
- entity: sensor.random_0_1000
- 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: false
- 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
experimental:
color_threshold: true
series:
- entity: sensor.random0_100
transform: return x / 2 - 15;
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
series:
- entity: sensor.random0_100
type: area
stroke_width: 0
opacity: 0.5
transform: return x / 2 - 15;
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
experimental:
color_threshold: true
series:
- entity: sensor.random0_100
type: column
# stroke_width: 0
transform: return x / 2 - 15;
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