-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dashboard.yaml
1719 lines (1706 loc) · 53.4 KB
/
Dashboard.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
type: custom:layout-card
layout_type: custom:grid-layout
cards:
- type: custom:sunsynk-power-flow-card
cardstyle: compact
large_font: true
show_solar: true
panel_mode: true
card_height: 415px
inverter:
modern: true
colour: '#959595'
autarky: power
solar:
mppts: 2
show_daily: true
colour: '#F4C430'
animation_speed: 9
max_power: 6600
pv1_name: West
pv2_name: North
display_mode: 2
auto_scale: true
pv2_max_power: 3850
pv1_max_power: 2750
efficiency: 3
battery:
energy: 15960
shutdown_soc: sensor.sunsynk_battery_capacity_shutdown
show_daily: true
colour: pink
animation_speed: 6
max_power: 4100
auto_scale: true
show_absolute: true
animate: true
path_threshold: 90
load:
show_aux: false
show_daily: true
animation_speed: 8
max_power: 8000
load1_name: Geyser
load1_icon: sensor.template_mdi
load3_name: Pool
load3_icon: mdi:pool
auto_scale: true
path_threshold: 90
additional_loads: 3
load2_name: Dishwasher
load2_icon: mdi:dishwasher
off_threshold: 3
grid:
show_daily_buy: true
no_grid_colour: green
animation_speed: 8
max_power: 8000
auto_scale: true
grid_off_colour:
- 122
- 0
- 0
grid_name: ''
entities:
use_timer_248: switch.sunsynk_toggle_system_timer
priority_load_243: switch.sunsynk_toggle_priority_load
day_battery_charge_70: sensor.sunsynk_day_battery_charge
day_battery_discharge_71: sensor.sunsynk_day_battery_discharge
day_load_energy_84: sensor.sunsynk_day_load_energy
day_grid_import_76: sensor.sunsynk_day_grid_import
day_grid_export_77: none
day_pv_energy_108: sensor.sunsynk_day_pv_energy
inverter_voltage_154: sensor.sunsynk_inverter_voltage
load_frequency_192: sensor.sunsynk_load_frequency
inverter_current_164: sensor.sunsynk_inverter_current
inverter_power_175: sensor.sunsynk_inverter_power
grid_power_169: sensor.sunsynk_grid_power
pv1_power_186: sensor.sunsynk_pv1_power
pv2_power_187: sensor.sunsynk_pv2_power
pv3_power_188: none
pv4_power_189: none
battery_voltage_183: sensor.sunsynk_battery_voltage
battery_soc_184: sensor.sunsynk_battery_soc
battery_power_190: sensor.sunsynk_battery_power
battery_current_191: sensor.sunsynk_battery_current
essential_power: sensor.sunsynk_essential_power_1
essential_load1: sensor.tuya_geyser_current_consumption
essential_load3: sensor.sonoff_10013bda3a_power
nonessential_power: sensor.sunsynk_nonessential_power_1
grid_ct_power_172: sensor.sunsynk_grid_ct_power
pv1_voltage_109: sensor.sunsynk_pv1_voltage
pv1_current_110: sensor.sunsynk_pv1_current
pv2_voltage_111: sensor.sunsynk_pv2_voltage
pv2_current_112: sensor.sunsynk_pv2_current
grid_connected_status_194: binary_sensor.sunsynk_grid_connected_status
inverter_status_59: sensor.sunsynk_overall_state
aux_power_166: sensor.sunsynk_aux_power
remaining_solar: sensor.solcast_pv_forecast_forecast_remaining_today
battery_temp_182: sensor.sunsynk_battery_temperature
radiator_temp_91: sensor.sunsynk_radiator_temperature
dc_transformer_temp_90: sensor.sunsynk_dc_transformer_temperature
prog1_time: sensor.sunsynk_time_slot_1
prog1_capacity: number.sunsynk_prog1_capacity
prog1_charge: switch.sunsynk_prog1_grid_charge
prog2_time: sensor.sunsynk_time_slot_2
prog2_capacity: number.sunsynk_prog2_capacity
prog2_charge: switch.sunsynk_prog2_grid_charge
prog3_time: sensor.sunsynk_time_slot_3
prog3_capacity: number.sunsynk_prog3_capacity
prog3_charge: switch.sunsynk_prog3_grid_charge
prog4_time: sensor.sunsynk_time_slot_4
prog4_capacity: number.sunsynk_prog4_capacity
prog4_charge: switch.sunsynk_prog4_grid_charge
prog5_time: sensor.sunsynk_time_slot_5
prog5_capacity: number.sunsynk_prog5_capacity
prog5_charge: switch.sunsynk_prog5_grid_charge
prog6_time: sensor.sunsynk_time_slot_6
prog6_capacity: number.sunsynk_prog6_capacity
prog6_charge: switch.sunsynk_prog6_grid_charge
essential_load1_extra: sensor.daily_geyser_energy
essential_load3_extra: sensor.pool_temperature
environment_temp: sensor.home_realfeel_temperature
prepaid_units: sensor.prepaid_units_left
essential_load2: sensor.sonoff_pow_r2_energy_power
essential_load2_extra: sensor.sonoff_pow_r2_energy_today
dynamic_line_width: true
view_layout:
grid-area: flow
- type: custom:plotly-graph
view_layout:
grid-area: graph
entities:
- entity: sensor.sunsynk_solar_power
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(255, 155, 48)
shape: spline
- entity: sensor.sunsynk_essential_power
name: |
$fn ({ ys,meta }) =>
"Load" + "⚡" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(95, 182, 173)
shape: spline
- entity: sensor.sunsynk_grid_ct_power
name: |
$fn ({ ys,meta }) =>
"Grid" + "💡" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(84, 144, 194)
shape: spline
filters:
- sliding_window_moving_average:
window_size: 1
extended: true
- entity: sensor.sunsynk_battery_power
fill: tozeroy
name: |
$fn ({ ys,meta }) =>
"Battery" + "🔋" + "(" +ys[ys.length - 1]+"W)"
line:
color: rgb(243, 179, 202)
shape: spline
- entity: sensor.sunsynk_battery_soc
name: |
$fn ({ ys,meta }) =>
"SOC" + "⚠️" + "(" +ys[ys.length - 1]+"%)"
yaxis: y2
line:
color: red
width: 1
shape: spline
fill: none
filters:
- sliding_window_moving_average:
window_size: 1
extended: true
hours_to_show: 24
refresh_interval: 60
title: null
defaults:
entity:
show_value: false
yaxes:
fixedrange: true
layout:
legend:
bgcolor: rgba(0,0,0,0)
itemsizing: constant
font:
size: 11
yaxis2:
range:
- 20
- 105
fixedrange: true
yaxis:
tickmode: linear
dtick: 1000
config:
scrollZoom: false
- type: custom:plotly-graph
view_layout:
grid-area: daily
entities:
- entity: sensor.sunsynk_day_pv_energy_local
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(255, 155, 48)
- entity: sensor.sunsynk_day_load_energy_local
name: |
$fn ({ ys,meta }) =>
"Load" + "⚡" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(95, 182, 173)
- entity: sensor.sunsynk_day_grid_import_energy_local
name: |
$fn ({ ys,meta }) =>
"Grid Import" + "💡" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(84, 144, 194)
- entity: sensor.sunsynk_day_battery_discharge_energy_local
name: |
$fn ({ ys,meta }) =>
"Battery Discharge" + "🖱️" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(151, 90, 182)
- entity: sensor.sunsynk_day_battery_charge_energy_local
name: |
$fn ({ ys,meta }) =>
"Battery Charge" + "🔋" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: yellow
hours_to_show: 5d
title: null
refresh_interval: 120
defaults:
entity:
statistic: state
period: day
type: bar
texttemplate: '%{y}'
filters:
- filter: i>0
yaxes:
fixedrange: true
fn: |
$fn({getFromConfig, vars})=> {
const range = getFromConfig("visible_range");
const width = range[1] - range[0];
vars.scroll = (label, p) => ({
args: [
{
layout: {
"xaxis.range": [range[0] + width*p, range[1] + width*p],
}
}, {
transition: {
duration: 150,
}
}
],
label,
method: "animate",
})
vars.zoom = (label, h) => ({
args: [
{
layout: {
"xaxis.range": [Date.now()-1000*60*60*h, Date.now()],
}
}
],
label,
method: "animate",
})
}
layout:
updatemenus:
- buttons:
- $fn({vars}) => vars.zoom( '30d', 24*30)
- $fn({vars}) => vars.zoom( '14d', 24*14)
- $fn({vars}) => vars.zoom( '7d', 24*7)
- $fn({vars}) => vars.scroll( ' <', -.5)
- $fn({vars}) => vars.scroll( ' >', .5)
direction: null
active: -1
pad:
r: 10
t: 10
type: buttons
x: 1
xanchor: auto
'y': 1
yanchor: auto
legend:
bgcolor: rgba(0,0,0,0)
yanchor: bottom
xanchor: left
x: 0
'y': 1
font:
size: 11
height: 410
config:
displayModeBar: false
scrollZoom: false
time_offset: 12h
- type: custom:plotly-graph
view_layout:
grid-area: solar
hours_to_show: 4d
time_offset: 2.5d
refresh_interval: auto
entities:
- entity: sensor.sunsynk_solar_power
name: Solar Power
line:
color: rgb(255, 155, 48)
shape: spline
width: 1
fill: tozeroy
fillcolor: rgba(255, 155, 48, 0.3)
yaxis: y3
show_value: false
showlegend: false
- entity: sensor.energy_production_today
line:
color: rgb(125, 125, 125)
shape: spline
fill: tozeroy
filters:
- fn: |
({meta}) => {
const entries = Object.entries(meta.wh_period);
const xs = entries.map(([start, _]) => new Date(start));
const ys = entries.map(([_, value]) => value);
return { xs, ys };
}
yaxis: y1
showlegend: true
- entity: sensor.energy_production_tomorrow
line:
color: rgb(90,90,90)
shape: spline
fill: tozeroy
filters:
- fn: |
({meta}) => {
const entries = Object.entries(meta.wh_period);
const xs = entries.map(([start, _]) => new Date(start));
const ys = entries.map(([_, value]) => value);
return { xs, ys };
}
yaxis: y1
- entity: sensor.energy_production_d2
line:
color: rgb(50,50,50)
shape: spline
fill: tozeroy
filters:
- fn: |
({meta}) => {
const entries = Object.entries(meta.wh_period);
const xs = entries.map(([start, _]) => new Date(start));
const ys = entries.map(([_, value]) => value);
return { xs, ys };
}
yaxis: y1
showlegend: true
- entity: sensor.sunsynk_battery_soc
name: Battery
line:
color: red
shape: spline
width: 1
yaxis: y2
show_value: true
showlegend: false
visible: true
- entity: ''
name: Now
yaxis: y9
showlegend: false
line:
width: 2
dash: dot
color: aqua
x: $ex [Date.now(), Date.now()]
'y':
- 0
- 1
defaults:
yaxes:
fixedrange: true
layout:
height: 410
margin:
t: 55
l: 50
showlegend: false
legend:
x: 0.1
'y': -0.8
yaxis2:
range:
- 20
- 105
fixedrange: true
annotations:
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: orange'>"
+ Number(hass.states['sensor.energy_production_tomorrow_sum'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Forecast Today</span><br>"
xref: x domain
yref: y domain
xanchor: center
yanchor: center
x: 0.06
'y': 1.2
showarrow: false
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: dodgerblue'>"
+ Number(hass.states['sensor.meteo_energy_production_today_remaining'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Remaining</span><br>"
xref: x domain
yref: y domain
xanchor: center
yanchor: center
x: 0.28
'y': 1.2
showarrow: false
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: '>"
+ Number(hass.states['sensor.energy_production_tomorrow_sum'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Forecast Tomorrow</span><br>"
xref: x domain
yref: y domain
xanchor: center
yanchor: centre
x: 0.5
'y': 1.2
showarrow: false
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: white'>"
+ Number(hass.states['sensor.energy_production_d2_sum'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Forecast Day 2</span><br>"
xref: x domain
yref: y domain
xanchor: center
yanchor: center
x: 0.72
'y': 1.2
showarrow: false
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: red'>"
+ Number(hass.states['sensor.sunsynk_battery_soc'].state) + "</span></span>%<br>"
+ "</span><span style=''>SOC</span><br>"
xref: x domain
yref: y domain
xanchor: center
yanchor: center
x: 0.94
'y': 1.2
showarrow: false
config:
scrollZoom: false
- type: custom:plotly-graph
view_layout:
grid-area: total
entities:
- entity: sensor.sunsynk_total_pv_energy
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆" + "(" +ys[ys.length - 1]+"kWh)"
offset: $fn() => 1000*60*60*4.5
marker:
color: rgb(255, 155, 48)
- entity: sensor.sunsynk_total_load_energy
name: |
$fn ({ ys,meta }) =>
"Load" + "⚡" + "(" +ys[ys.length - 1]+"kWh)"
offset: $fn() => 1000*60*60*7.5
marker:
color: rgb(95, 182, 173)
- entity: sensor.sunsynk_total_grid_import
name: |
$fn ({ ys,meta }) =>
"Grid Import" + "💡" + "(" +ys[ys.length - 1]+"kWh)"
offset: $fn() => 1000*60*60*10.5
marker:
color: rgb(84, 144, 194)
- entity: sensor.sunsynk_total_battery_discharge
name: |
$fn ({ ys,meta }) =>
"Bat Discharge" + "🖱️" + "(" +ys[ys.length - 1]+"kWh)"
offset: $fn() => 1000*60*60*13.5
marker:
color: rgb(151, 90, 182)
- entity: sensor.sunsynk_total_battery_charge
name: |
$fn ({ ys,meta }) =>
"Bat Charge" + "🔋" + "(" +ys[ys.length - 1]+"kWh)"
offset: $fn() => 1000*60*60*16.5
marker:
color: yellow
hours_to_show: current_day
defaults:
entity:
statistic: state
period: day
type: bar
width: $fn() => 1000*60*60*3
texttemplate: '%{y}'
yaxes:
fixedrange: true
title: null
layout:
xaxis:
nticks: 1
height: 410
config:
displayModeBar: false
scrollZoom: false
- type: custom:plotly-graph
view_layout:
grid-area: stats
title: Generation Purpose
entities:
- entity: sensor.sunsynk_day_load_energy
type: pie
hole: 0.6
values: >-
$ex [
hass.states["sensor.sunsynk_day_battery_charge_energy_local"].state,
hass.states["sensor.sunsynk_day_load_energy_local"].state
]
marker:
colors:
- rgb(84, 144, 194)
- rgb(95, 182, 173)
textinfo: value+percent
hours_to_show: 1
refresh_interval: auto
layout:
height: 390
margin:
t: 60
showlegend: false
annotations:
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: rgb(84, 144, 194)'>"
+ Number(hass.states['sensor.sunsynk_day_battery_charge_energy_local'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Charging</span><br>"
xref: paper
yref: paper
xanchor: center
yanchor: center
x: 0.9
'y': 1.2
showarrow: false
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: rgb(95, 182, 173)'>"
+ Number(hass.states['sensor.sunsynk_day_load_energy_local'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Consumption</span><br>"
xref: paper
yref: paper
xanchor: center
yanchor: center
x: 0.05
'y': 1.2
showarrow: false
- type: custom:plotly-graph
view_layout:
grid-area: stats1
title: Generation Today
entities:
- entity: sensor.sunysnk_battery_day_charge
type: pie
hole: 0.6
values: >-
$ex [
hass.states["sensor.sunsynk_day_battery_discharge_energy_local"].state,
hass.states["sensor.sunsynk_day_grid_import_energy_local"].state,
hass.states["sensor.sunsynk_day_pv_energy_local"].state ]
labels:
- Battery Charge
- Grid Offpeak
- Solar
marker:
colors:
- rgb(151, 90, 182)
- rgb(84, 144, 194)
- rgb(255, 155, 48)
textinfo: value+percent
hours_to_show: 1
refresh_interval: auto
layout:
height: 410
margin:
t: 60
showlegend: false
annotations:
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: rgb(255, 155, 48'>"
+ Number(hass.states['sensor.sunsynk_day_pv_energy_local'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Solar</span><br>"
xref: paper
yref: paper
xanchor: center
yanchor: center
x: 0.05
'y': 1.2
showarrow: false
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: rgb(151, 90, 182)'>"
+ Number(hass.states['sensor.sunsynk_day_battery_discharge_energy_local'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Battery</span><br>"
xref: paper
yref: paper
xanchor: center
yanchor: center
x: 0.5
'y': 1.2
showarrow: false
- text: |-
$fn ({hass}) =>
"<span style='font-size: 24px;'><span style='color: rgb(84, 144, 194)'>"
+ Number(hass.states['sensor.sunsynk_day_grid_import_energy_local'].state).toFixed(1) + "</span></span>kWh<br>"
+ "</span><span style=''>Grid</span><br>"
xref: paper
yref: paper
xanchor: center
yanchor: centre
x: 0.9
'y': 1.2
showarrow: false
- type: vertical-stack
cards:
- type: custom:plotly-graph
entities:
- entity: sensor.sonoff_10013bda3a_energy
statistic: state
name: Daily Energy
period: day
type: bar
texttemplate: '%{y}'
filters:
- filter: i>0
hours_to_show: 7d
defaults:
entity:
line:
width: 2
yaxes:
fixedrange: true
title: Daily Pool Energy
fn: |
$fn({getFromConfig, vars})=> {
const range = getFromConfig("visible_range");
const width = range[1] - range[0];
vars.scroll = (label, p) => ({
args: [
{
layout: {
"xaxis.range": [range[0] + width*p, range[1] + width*p],
}
}, {
transition: {
duration: 150,
}
}
],
label,
method: "animate",
})
vars.zoom = (label, h) => ({
args: [
{
layout: {
"xaxis.range": [Date.now()-1000*60*60*h, Date.now()],
}
}
],
label,
method: "animate",
})
}
layout:
updatemenus:
- buttons:
- $fn({vars}) => vars.zoom( '90d', 24*90)
- $fn({vars}) => vars.zoom( '30d', 24*30)
- $fn({vars}) => vars.zoom( '7d', 24*7)
direction: right
active: -1
pad:
r: 10
t: 10
type: buttons
x: 0
xanchor: left
'y': 1.25
yanchor: top
legend:
bgcolor: rgba(0,0,0,0)
itemsizing: constant
font:
size: 11
config:
displayModeBar: false
scrollZoom: false
- type: entities
entities:
- entity: switch.sonoff_10013bda3a
name: Pool pump
- entity: sensor.sonoff_10013bda3a_current
icon: mdi:current-ac
name: Current
- entity: sensor.sonoff_10013bda3a_power
icon: mdi:lightning-bolt
name: Power
view_layout:
grid-area: bat
- type: vertical-stack
cards:
- type: custom:plotly-graph
entities:
- entity: sensor.daily_geyser_energy
statistic: state
name: Daily Energy
period: day
type: bar
texttemplate: '%{y}'
filters:
- filter: i>0
hours_to_show: 7d
defaults:
entity:
line:
width: 2
yaxes:
fixedrange: true
title: Daily Geyser Energy
fn: |
$fn({getFromConfig, vars})=> {
const range = getFromConfig("visible_range");
const width = range[1] - range[0];
vars.scroll = (label, p) => ({
args: [
{
layout: {
"xaxis.range": [range[0] + width*p, range[1] + width*p],
}
}, {
transition: {
duration: 150,
}
}
],
label,
method: "animate",
})
vars.zoom = (label, h) => ({
args: [
{
layout: {
"xaxis.range": [Date.now()-1000*60*60*h, Date.now()],
}
}
],
label,
method: "animate",
})
}
layout:
updatemenus:
- buttons:
- $fn({vars}) => vars.zoom( '90d', 24*90)
- $fn({vars}) => vars.zoom( '30d', 24*30)
- $fn({vars}) => vars.zoom( '7d', 24*7)
direction: right
active: -1
pad:
r: 10
t: 10
type: buttons
x: 0
xanchor: left
'y': 1.25
yanchor: top
legend:
bgcolor: rgba(0,0,0,0)
itemsizing: constant
font:
size: 11
config:
displayModeBar: false
scrollZoom: false
- type: entities
entities:
- entity: switch.geyser
- entity: sensor.tuya_geyser_current
icon: mdi:current-ac
name: Current
- entity: sensor.tuya_geyser_current_consumption
icon: mdi:lightning-bolt
name: Power
view_layout:
grid-area: geyser
- type: markdown
content: " ## System Timer Settings\n<table width=\"100%\" border=0>\n <tbody> \n <tr>\n <td align=\"left\">\n <b>Time Slot</b>\n </td>\n <td align=\"left\">\n <b>Battery SOC</b>\n </td>\n <td align=\"left\">\n\t<b>Grid</b>\n\t</td>\n </tr>\n <tr>\n <td align=\"left\">\n {{states('sensor.sunsynk_time_slot_1')}} - {{states('sensor.sunsynk_time_slot_2')}}\n </td>\n <td align=\"left\">\n {{ states('number.sunsynk_prog1_capacity') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('switch.sunsynk_prog1_grid_charge', 'on') %} <ha-icon icon=\"mdi:checkbox-marked-outline\"></ha-icon> {% else %} <ha-icon icon=\"mdi:checkbox-blank-outline\"></ha-icon> {% endif %}\n\t</td>\n </tr>\n <tr>\n <td align=\"left\">\n {{states('sensor.sunsynk_time_slot_2')}} - {{states('sensor.sunsynk_time_slot_3')}}\n </td>\n <td align=\"left\">\n {{ states('number.sunsynk_prog2_capacity') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('switch.sunsynk_prog2_grid_charge', 'on') %} <ha-icon icon=\"mdi:checkbox-marked-outline\"></ha-icon> {% else %} <ha-icon icon=\"mdi:checkbox-blank-outline\"></ha-icon> {% endif %}\n\t</td>\n </tr>\n <tr>\n <td align=\"left\">\n {{states('sensor.sunsynk_time_slot_3')}} - {{states('sensor.sunsynk_time_slot_4')}}\n </td>\n <td align=\"left\">\n {{ states('number.sunsynk_prog3_capacity') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('switch.sunsynk_prog3_grid_charge', 'on') %} <ha-icon icon=\"mdi:checkbox-marked-outline\"></ha-icon> {% else %} <ha-icon icon=\"mdi:checkbox-blank-outline\"></ha-icon> {% endif %}\n\t</td>\n </tr>\n <tr>\n <td align=\"left\">\n {{states('sensor.sunsynk_time_slot_4')}} - {{states('sensor.sunsynk_time_slot_5')}}\n </td>\n <td align=\"left\">\n {{ states('number.sunsynk_prog4_capacity') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('switch.sunsynk_prog4_grid_charge', 'on') %} <ha-icon icon=\"mdi:checkbox-marked-outline\"></ha-icon> {% else %} <ha-icon icon=\"mdi:checkbox-blank-outline\"></ha-icon> {% endif %}\n\t</td>\n </tr>\n <tr>\n <td align=\"left\">\n {{states('sensor.sunsynk_time_slot_5')}} - {{states('sensor.sunsynk_time_slot_6')}}\n </td>\n <td align=\"left\">\n {{ states('number.sunsynk_prog5_capacity') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('switch.sunsynk_prog5_grid_charge', 'on') %} <ha-icon icon=\"mdi:checkbox-marked-outline\"></ha-icon> {% else %} <ha-icon icon=\"mdi:checkbox-blank-outline\"></ha-icon> {% endif %}\n\t</td>\n </tr>\n <tr>\n <td align=\"left\">\n {{states('sensor.sunsynk_time_slot_6')}} - {{states('sensor.sunsynk_time_slot_1')}}\n </td>\n <td align=\"left\">\n {{ states('number.sunsynk_prog6_capacity') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('switch.sunsynk_prog6_grid_charge', 'on') %} <ha-icon icon=\"mdi:checkbox-marked-outline\"></ha-icon> {% else %} <ha-icon icon=\"mdi:checkbox-blank-outline\"></ha-icon> {% endif %}\n\t</td>\n </tr>\n </tbody>\n</table>"
view_layout:
grid-area: weather
- type: custom:flex-horseshoe-card
view_layout:
grid-area: g3
entities:
- entity: sensor.sunsynk_essential_power_1
unit: W
name: AC
- entity: sensor.sunsynk_inverter_voltage
decimals: 0
unit: V
- entity: sensor.sunsynk_grid_frequency
decimals: 2
unit: Hz
name: Grid
- entity: sensor.sunsynk_grid_ct_power
decimals: 0
unit: W
name: Grid
- entity: sensor.sunsynk_day_grid_import
decimals: 2
unit: kWh
name: Import
- entity: sensor.sunsynk_day_load_energy
decimals: 2
unit: kWh
name: Daily
show:
horseshoe_style: autominmax
layout:
hlines:
- id: 0
xpos: 50
ypos: 40
length: 70
styles:
- opacity: 0.2;
- id: 0
xpos: 50
ypos: 60
length: 70
styles:
- opacity: 0.2;
vlines:
- id: 0
xpos: 50
ypos: 50
length: 18
styles:
- opacity: 0.2;
states:
- id: 0
entity_index: 0
xpos: 50
ypos: 33
styles:
- font-size: 3em;
- opacity: 0.9;
- text-anchor: middle;
- id: 1
entity_index: 1
xpos: 44
ypos: 53
styles:
- font-size: 1.5em;
- text-anchor: end;
- id: 2
entity_index: 2
xpos: 55
ypos: 53
styles:
- text-anchor: start;
- font-size: 1.5em;
- id: 3
entity_index: 3
xpos: 50
ypos: 75
styles:
- text-anchor: middle;
- font-size: 2em;
- id: 4
entity_index: 4
xpos: 75
ypos: 7
styles:
- text-anchor: start;
- font-size: 1.2em;
- id: 5
entity_index: 5
xpos: 0
ypos: 7
styles:
- text-anchor: start;
- font-size: 1.2em;
icons:
- id: 0
entity_index: 1
xpos: 30
ypos: 52
align: start
size: 1
names:
- id: 0
entity_index: 0
xpos: 50
ypos: 95
styles:
- font-size: 1.2em;
- id: 1
entity_index: 4
xpos: 85
ypos: 12
styles:
- font-size: 0.5em;
- text-anchor: start;
- id: 2
entity_index: 5
xpos: 0
ypos: 12
styles:
- font-size: 0.5em;
- text-anchor: start;
- id: 3
entity_index: 3
xpos: 50
ypos: 80
styles:
- font-size: 0.5em;
- text-anchor: middle;
horseshoe_scale:
min: 0
max: 8000
width: 6
color_stops:
'0': '#5fb6ad'
'2000': '#5fb6ad'
card_mod:
style: |
ha-card {
--ha-card-background: var(--card-background-color);
color: var(--primary-color);
}
- type: custom:flex-horseshoe-card
view_layout:
grid-area: g1
entities:
- entity: sensor.sunsynk_solar_power
decimals: 0
unit: W
name: Solar
- entity: sensor.sunsynk_pv1_power
decimals: 0
unit: W
name: PV1
- entity: sensor.sunsynk_pv2_power
decimals: 0
unit: W
name: PV2
- entity: sensor.sunsynk_pv1_voltage
decimals: 0
unit: V
- entity: sensor.sunsynk_pv2_voltage
decimals: 0
unit: V
- entity: sensor.sunsynk_pv1_current
decimals: 1
unit: A
- entity: sensor.sunsynk_pv2_current
decimals: 1
unit: A
- entity: sensor.sunsynk_day_pv_energy