Wenn du Hilfe benötigst, 🔍 suche bitte, bevor du einen neues Thema oder Beitrag erstellst.
>>> Deye Updaten lassen <<< Umfrage Deye-Wiki
Deye Hybrid Angebote Deye Zubehör Produkte
Die Daten kommen im sec. Takt
Ich sage es nur ungern, aber Modbus kann nicht mit einer Sekunde takten, sondern mindestens mit fünf Sekunden. Schau im home-assistant.log nach, da wirst du bestimmt eine entsprechende Warnung finden.
So ich hab mal was Probiert und die Register stimmen für die CT Klemmen.
Wenn ich ehrlich bin, glaube ich nicht, dass deine CT-Werte im HA stimmen. Du musst beide Register zusammenfassen, z. B. für CT1 das Register 616 (Low Word) und das Register 705 (High Word).
Hier ein Beispiel meiner Konfiguration für die Wallbox. Wichtig ist der Eintrag „data_type: uint32”.
Bei mir sind es die Register 17 und 18, wodurch sich die Konfiguration erleichtert. Bei dir liegen die Register weit auseinander. Wie das in der Konfiguration eingegeben wird, kann ich nicht sagen, eventuell so:
registers: [0x0268, 0x02C1] oder so
addresses: [0x0268, 0x02C1]
Das musst du probieren oder danach googeln.
# It is a 32bit number represented in two 16bit registers - name: "kWh Total" unique_id: whec_kwh_total slave: 1 address: 17 scan_interval: 15 input_type: input device_class: energy unit_of_measurement: kWh state_class: total_increasing scale: 0.001 offset: 0 precision: 1 data_type: uint32
Es gibt noch einen weiteren Aspekt, den man beachten muss: Der CT-Wert kann positiv oder negativ werden. Das muss auch irgendwie konfiguriert werden.
Ich bin nicht sicher ob data_type: int32 ausreicht.
Deye SUN-12K-SG04LP3-EU, 36 х Trina Vertex S 425W, 2 x Deye RW-M 6.1
Deye SUN-8K-SG04LP3-EU, 10 х Trina Vertex S+ 430W, 2 x Deye RW-M 6.1
2 x Deye SUN 2000, je 4 х Trina Vertex S+ 430W, Netzparallel zu 8kW WR
1 x Deye SUN 600, 2 х Sharp NU-JC 410W, Netzparallel zu 8kW WR
Aber die werte stimmen überein mit dem Display vom Deye.
Wegen den Sec. Takt. Es sieht schneller aus als 5 Sec.
Machts das jemand hier im Forum?
Liest jemand eimen Deye Sun 12kW Niedervolt mit einem Waveshare aus?!
Weiss jemand wie man den die Yaml richig schreibt?
Aber die werte stimmen überein mit dem Display vom Deye.
Ich denke, dass die Werte bei einer Einspeisung von über 4.096 Watt nicht mehr stimmen werden.
Wegen den Sec. Takt. Es sieht schneller aus als 5 Sec.
Hast du in der Logdatei nachgeschaut? Es ist eigentlich egal, ob du über Modbus, Deye oder ein anderes Gerät ausliest. Für die Wallbox benutze ich auch Waveshare und hatte auch bei einigen Registern die Aktualisierungszeit auf eine Sekunde eingestellt. Irgendwann habe ich dann in der Log-Datei nachgesehen. Die Meldung kommt vom Home Assistant und nicht von der Wallbox oder Deye.
Deye SUN-12K-SG04LP3-EU, 36 х Trina Vertex S 425W, 2 x Deye RW-M 6.1
Deye SUN-8K-SG04LP3-EU, 10 х Trina Vertex S+ 430W, 2 x Deye RW-M 6.1
2 x Deye SUN 2000, je 4 х Trina Vertex S+ 430W, Netzparallel zu 8kW WR
1 x Deye SUN 600, 2 х Sharp NU-JC 410W, Netzparallel zu 8kW WR
Ja hab nach gesehen. Da steht das es nicht schneller als alled 5 sec. geht.
Ich werd heute mal checken ob die werte über 4096W nicht mehr stimmen.
Hallo Leute,
Ich verwende die David Rapan Solarman Integration für HA, bin an sich sehr zufrieden, aber seitdem ich Einspeisen darf bekomme ich sehr komische Grid Readings, die tlw. auf 60kW - 100kW hoch gehen 🤔 in meinem plotly graph , was ja nur ein Fehler sein kann sonst würde mir ja der Deye abrauchen 😉
System ist ein Deye SUN-10k-sg04lp3-eu, LAN logger und HA Green. Alle Systeme und Integrationen sind upgedated. Hat irgendjemand eine Idee a) woran das liegen kann und b) wie ich das weg bekomme.
Dzt. habe ich die y-Achse des plotly Graphs fixiert, das hilft mal ein bisschen schaut aber trotzdem auch nicht schön aus, und wenn ich über die Tageswerte mal integrieren würde, wäre das Eergebnis wohl auch mega verfälscht 😪
Hier mal ein Bump meiner Frage: HAt da jemand vlt. eine Idee woran diese spikey Grid readings herkommen könnten? Danke im Voraus für etwaige Hilfe 🖐️
@lucullus:
Ich habe auch noch keine Antwort auf Deine Frage, würde aber gerne Deinen Plotly-Code übernehmen, der visuelle Editor gibt das ja nicht her. Oder hast Du das anders gelöst mit den Details (Momentandaten oben etc.).
Vielleicht können wir so auch feststellen, ob bei mir die gleichen Effekte auftreten.
Hallo zusammen,
ich habe das Problem, dass mir Solarman die Entitäten für den Microwechselrichter Eingang nicht zur Verfügung stellt. In Home Assistant wird "Nicht verfügbar" angezeigt. Kann man die irgendwie verfügbar machen?
Das sollte standardmäßig gehen, wenn der MI-Input aktiviert ist und auch im Deye angezeigt wird. Bei mir sieht das so aus:
Die Entität heißt: sensor.solarman_microinverter_l1_power
@ccgulf klar, sehr gerne.
der entsprechende Abschnitt is title: Deye SUN12K
ist etwas länger, aber der abschnitt für den plotly code ist der Abschnitt: "graph"
views:
- title: Home
header:
card:
type: markdown
content: |-
# Hello {{ user }}
Deine Übersicht der PV Produktion ✨
sections:
- type: grid
cards:
- type: heading
heading: Solar Overview
heading_style: subtitle
- type: custom:sunsynk-power-flow-card
cardstyle: full
show_solar: true
battery:
energy: 20400
shutdown_soc: 10
show_daily: true
count: 2
soc_decimal_places: 3
max_power: 0
shutdown_soc_offgrid: 0
show_absolute: false
invert_power: false
hide_soc: false
remaining_energy_to_shutdown: false
show_remaining_energy: false
colour:
- 0
- 249
- 0
animation_speed: -1
battery1:
energy: 10200
shutdown_soc: 10
show_daily: true
soc_decimal_places: -4
max_power: 0
shutdown_soc_offgrid: 0
show_absolute: false
invert_power: false
hide_soc: false
remaining_energy_to_shutdown: false
show_remaining_energy: false
colour:
- 0
- 249
- 0
battery2:
energy: 10200
shutdown_soc: 10
show_daily: true
soc_decimal_places: -4
max_power: 0
shutdown_soc_offgrid: 0
show_absolute: false
invert_power: false
hide_soc: false
remaining_energy_to_shutdown: false
show_remaining_energy: false
colour:
- 0
- 249
- 0
solar:
show_daily: true
mppts: 2
pv1_name: NW
pv2_name: SE
display_mode: 1
auto_scale: true
dynamic_colour: true
invert_flow: false
load:
show_daily: true
additional_loads: 1
load1_name: Hans
essential_name: Wuggitz25
load1_icon: mdi:home-account
grid:
show_daily_buy: true
show_daily_sell: true
show_nonessential: false
show_absolute: false
entities:
use_timer48: switch.sunsynk_toggle_system_timer
priority_load43: switch.sunsynk_toggle_priority_load
inverter_voltage_154: sensor.deye_sun12k_load_l1_voltage
inverter_voltage_L2: sensor.deye_sun12k_load_l2_voltage
inverter_voltage_L3: sensor.deye_sun12k_load_l3_voltage
load_frequency_192: sensor.deye_sun12k_load_frequency
inverter_current_164: sensor.deye_sun12k_output_l1_current
inverter_current_L2: sensor.deye_sun12k_output_l2_current
inverter_current_L3: sensor.deye_sun12k_output_l3_current
load_power_L1: sensor.deye_sun12k_load_l1_power
load_power_L2: sensor.deye_sun12k_load_l2_power
load_power_L3: sensor.deye_sun12k_load_l3_power
inverter_power_175: sensor.deye_sun12k_power
grid_connected_status_194: binary_sensor.deye_sun12k_grid
inverter_status_59: sensor.deye_sun12k_device_state
day_battery_charge_70: sensor.deye_sun12k_today_battery_charge
day_battery_discharge_71: sensor.deye_sun12k_today_battery_discharge
battery_voltage_183: sensor.deye_sun12k_battery_voltage
battery2_voltage_183: sensor.deye_sun12k_battery_1_voltage
battery_soc_184: sensor.deye_sun12k_battery
battery_power_190: sensor.deye_sun12k_battery_power
battery_current_191: sensor.deye_sun12k_battery_current
grid_power_169: sensor.deye_sun12k_grid_power
day_grid_import_76: sensor.deye_sun12k_today_energy_import
day_grid_export_77: sensor.deye_sun12k_today_energy_export
grid_ct_power_172: sensor.deye_sun12k_grid_power
day_load_energy_84: sensor.deye_sun12k_today_load_consumption
essential_power: none
nonessential_power: none
essential_load1: sensor.eg_total_power
essential_load1_extra: sensor.eg_verbrauch
aux_power_166: sensor.sunsynk_aux_power
pv1_power_186: sensor.deye_sun12k_pv1_power
pv2_power_187: sensor.deye_sun12k_pv2_power
pv1_voltage_109: sensor.deye_sun12k_pv1_voltage
pv1_current_110: sensor.deye_sun12k_pv1_current
pv2_voltage_111: sensor.deye_sun12k_pv2_voltage
pv2_current_112: sensor.deye_sun12k_pv2_current
day_pv_energy_108: sensor.deye_sun12k_today_production
inverter:
model: deye
three_phase: true
auto_scale: true
modern: true
show_battery: true
show_grid: true
decimal_places: 2
large_font: true
wide: false
dynamic_line_width: true
cards: []
- type: custom:layout-card
layout_type: custom:grid-layout
path: deye-sun12k
title: Deye SUN12K
icon: mdi:home-plus
cards:
- type: custom:sunsynk-power-flow-card
cardstyle: compact
large_font: true
show_solar: true
panel_mode: true
card_height: 100%
inverter:
modern: true
colour: '#959595'
autarky: power
solar:
mppts: 2
show_daily: true
colour: '#F4C430'
animation_speed: 9
max_power: 12000
pv1_name: NW
pv2_name: SE
display_mode: 2
auto_scale: true
pv2_max_power: 5400
pv1_max_power: 10800
efficiency: 3
battery:
energy: 20400
shutdown_soc: number.deye_sun12k_battery_shutdown_soc
show_daily: true
colour: pink
animation_speed: 6
max_power: 12000
auto_scale: true
show_absolute: true
animate: true
path_threshold: 90
load:
show_aux: false
show_daily: true
animation_speed: 8
max_power: 8000
essential_name: Wuggitz25
load1_name: Hans
load1_icon: sensor.template_mdi
load2_name: W25
load2_icon: sensor.template_mdi
path_threshold: 90
additional_loads: 3
load3_name: Temp
off_threshold: 3
grid:
show_daily_buy: true
show_daily_sell: true
no_grid_colour:
- 125
- 125
- 125
animation_speed: 8
max_power: 8000
auto_scale: true
grid_off_colour:
- 122
- 0
- 0
grid_name: ''
entities:
use_timer48: switch.sunsynk_toggle_system_timer
priority_load43: switch.sunsynk_toggle_priority_load
day_battery_charge_70: sensor.deye_sun12k_today_battery_charge
day_battery_discharge_71: sensor.deye_sun12k_today_battery_discharge
day_load_energy_84: sensor.deye_sun12k_today_load_consumption
day_grid_import_76: sensor.deye_sun12k_today_energy_import
day_grid_export_77: sensor.deye_sun12k_today_energy_export
day_pv_energy_108: sensor.deye_sun12k_today_production
inverter_voltage_154: sensor.deye_sun12k_load_l1_voltage
load_frequency_192: sensor.sunsynk_load_frequency
inverter_current_164: sensor.deye_sun12k_load_l1_current
inverter_power_175: sensor.deye_sun12k_power
grid_power_169: sensor.sunsynk_grid_power
pv1_power_186: sensor.deye_sun12k_pv1_power
pv2_power_187: sensor.deye_sun12k_pv2_power
battery_voltage_183: sensor.deye_sun12k_battery_1_voltage
battery_soc_184: sensor.deye_sun12k_battery
battery_power_190: sensor.deye_sun12k_battery_power
battery_current_191: sensor.deye_sun12k_battery_current
essential_power: sensor.deye_sun12k_load_ups_power
essential_load1: sensor.eg_total_power
essential_load2: sensor.w25_power
essential_load3: sensor.shellyplus1pm_a0dd6c31131c_temperature_2
nonessential_power: none
grid_ct_power_172: sensor.deye_sun12k_grid_power
pv1_voltage_109: sensor.deye_sun12k_pv1_voltage
pv1_current_110: sensor.deye_sun12k_pv1_current
pv2_voltage_111: sensor.deye_sun12k_pv2_voltage
pv2_current_112: sensor.deye_sun12k_pv2_current
grid_connected_status_194: binary_sensor.deye_sun12k_grid
inverter_status_59: binary_sensor.deye_sun12k
aux_power_166: none
remaining_solar: sensor.solcast_pv_forecast_forecast_remaining_today
battery_temp_182: sensor.deye_sun12k_battery_temperature
radiator_temp_91: sensor.deye_sun12k_temperature
dc_transformer_temp_90: sensor.deye_sun12k_dc_temperature
prog1_time: time.deye_sun12k_program_1_time
prog1_capacity: number.deye_sun12k_program_1_soc
prog1_charge: select.deye_sun12k_program_1_charging
prog2_time: sensor.deye_sun12k_time_slot
prog2_capacity: number.deye_sun12k_program_soc
prog2_charge: select.deye_sun12k_program_charging
prog3_time: sensor.deye_sun12k_time_slot
prog3_capacity: number.deye_sun12k_program_3_soc
prog3_charge: select.deye_sun12k_program_3_charging
prog4_time: sensor.deye_sun12k_time_slot_4
prog4_capacity: number.deye_sun12k_program_4_soc
prog4_charge: select.deye_sun12k_program_4_charging
prog5_time: sensor.deye_sun12k_time_slot_5
prog5_capacity: number.deye_sun12k_program_5_soc
prog5_charge: select.deye_sun12k_program_5_charging
prog6_time: sensor.deye_sun12k_time_slot_6
prog6_capacity: number.deye_sun12k_program_6_soc
prog6_charge: select.deye_sun12k_program_6_charging
essential_load1_extra: sensor.eg_verbrauch
essential_load2_extra: sensor.w25_verbrauch
dynamic_line_width: true
wide: false
view_layout:
grid-area: flow
- type: custom:plotly-graph
view_layout:
grid-area: graph
entities:
- entity: sensor.deye_sun12k_pv_power
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(255, 155, 48)
shape: spline
- entity: sensor.deye_sun12k_load_ups_power
name: |
$fn ({ ys,meta }) =>
"Load" + "⚡" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(95, 182, 173)
shape: spline
- entity: sensor.eg_total_power
name: |
$fn ({ ys,meta }) =>
"Load Hans" + "⚡" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(95, 182, 1)
shape: spline
- entity: sensor.deye_sun12k_grid_power
name: |
$fn ({ ys,meta }) =>
"Grid" + "💡" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(84, 144, 194)
shape: spline
- entity: sensor.deye_sun12k_battery_power
fill: tozeroy
name: |
$fn ({ ys,meta }) =>
"Battery" + "🔋" + "(" +ys[ys.length - 1]+"W)"
line:
color: rgb(243, 179, 202)
shape: spline
- entity: sensor.deye_sun12k_battery
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:
range:
- -8000
- 15000
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.deye_sun12k_today_production
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(255, 155, 48)
- entity: sensor.deye_sun12k_today_load_consumption
name: |
$fn ({ ys,meta }) =>
"Load" + "⚡" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(95, 182, 173)
- entity: sensor.deye_sun12k_today_energy_export
name: |
$fn ({ ys,meta }) =>
"Grid Export" + "💡" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(84, 144, 194)
- entity: sensor.deye_sun12k_today_energy_import
name: |
$fn ({ ys,meta }) =>
"Grid Import" + "💡" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(84, 144, 100)
- entity: sensor.deye_sun12k_today_battery_discharge
name: |
$fn ({ ys,meta }) =>
"Battery Discharge" + "🖱️" + "(" +ys[ys.length - 1]+"kWh)"
marker:
color: rgb(151, 90, 182)
- entity: sensor.deye_sun12k_today_battery_charge
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.deye_sun12k_pv_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.deye_sun12k_today_production
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.deye_sun12k_battery
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.deye_sun12k_today_production'].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.solcast_pv_forecast_forecast_remaining_today'].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.solcast_pv_forecast_forecast_tomorrow'].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.solcast_pv_forecast_forecast_tomorrow'].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.deye_sun12k_battery'].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.deye_sun12k_pv_power
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.deye_sun12k_today_load_consumption
type: pie
hole: 0.6
values: >-
$ex [
hass.states["sensor.deye_sun12k_today_battery_charge"].state,
hass.states["sensor.deye_sun12k_today_load_consumption"].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.deye_sun12k_today_battery_charge'].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.deye_sun12k_today_load_consumption'].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.deye_sun12k_today_battery_discharge"].state,
hass.states["sensor.deye_sun12k_today_energy_import"].state,
hass.states["sensor.deye_sun12k_today_production"].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.deye_sun12k_today_production'].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.deye_sun12k_today_battery_discharge'].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.deye_sun12k_today_energy_import'].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.eg_verbrauch
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 Energy Hans
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.eg_total_power
icon: mdi:current-ac
name: Current
- entity: sensor.eg_verbrauch
icon: mdi:lightning-bolt
name: Power
view_layout:
grid-area: hans
- 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')}}\n </td>\n <td align=\"left\">\n {{ states('number.deye_sun12k_program_1_soc') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('select.deye_sun12k_program_1_charging', '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')}} - {{states('sensor.sunsynk_time_slot_3')}}\n </td>\n <td align=\"left\">\n {{ states('number.deye_sun12k_program_soc') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('select.deye_sun12k_program_charging', '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.deye_sun12k_program_3_soc') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('select.deye_sun12k_program_3_charging', '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.deye_sun12k_program_4_soc') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('select.deye_sun12k_program_4_charging', '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.deye_sun12k_program_5_soc') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('select.deye_sun12k_program_5_charging', '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.deye_sun12k_program_6_soc') | round(0) }} %\n </td>\n <td align=\"left\">\n\t{% if is_state('select.deye_sun12k_program_6_charging', '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.deye_sun12k_load_ups_power
unit: W
name: AC
- entity: sensor.deye_sun12k_load_l1_voltage
decimals: 0
unit: V
- entity: sensor.deye_sun12k_grid_frequency
decimals: 2
unit: Hz
name: Grid
- entity: sensor.deye_sun12k_grid_power
decimals: 0
unit: W
name: Grid
- entity: sensor.deye_sun12k_today_energy_import
decimals: 2
unit: kWh
name: Import
- entity: sensor.deye_sun12k_today_load_consumption
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.deye_sun12k_pv_power
decimals: 0
unit: W
name: Solar
- entity: sensor.deye_sun12k_pv1_power
decimals: 0
unit: W
name: PV1
- entity: sensor.deye_sun12k_pv2_power
decimals: 0
unit: W
name: PV2
- entity: sensor.deye_sun12k_pv1_voltage
decimals: 0
unit: V
- entity: sensor.deye_sun12k_pv2_voltage
decimals: 0
unit: V
- entity: sensor.deye_sun12k_pv1_current
decimals: 1
unit: A
- entity: sensor.deye_sun12k_pv2_current
decimals: 1
unit: A
- entity: sensor.deye_sun12k_today_production
decimals: 2
unit: kWh
name: Daily
- entity: sensor.solcast_pv_forecast_forecast_remaining_today
decimals: 2
unit: kWh
name: Left Today
show:
horseshoe_style: autominmax
layout:
hlines:
- id: 0
xpos: 50
ypos: 40
length: 70
styles:
- opacity: 0.2;
vlines:
- id: 0
xpos: 50
ypos: 59
length: 36
styles:
- opacity: 0.2;
states:
- id: 0
entity_index: 0
xpos: 50
ypos: 33
styles:
- font-size: 3em;
- opacity: 0.9;
- id: 1
entity_index: 1
xpos: 47
ypos: 53
styles:
- font-size: 1.5em;
- text-anchor: end;
- id: 2
entity_index: 2
xpos: 53
ypos: 53
styles:
- text-anchor: start;
- font-size: 1.5em;
- id: 3
entity_index: 3
xpos: 46
ypos: 63
styles:
- text-anchor: end;
- font-size: 1.5em;
- id: 4
entity_index: 4
xpos: 53
ypos: 63
styles:
- text-anchor: start;
- font-size: 1.5em;
- id: 5
entity_index: 5
xpos: 46
ypos: 73
styles:
- text-anchor: end;
- font-size: 1.5em;
- id: 6
entity_index: 6
xpos: 53
ypos: 73
styles:
- text-anchor: start;
- font-size: 1.5em;
- id: 7
entity_index: 7
xpos: 0
ypos: 7
styles:
- text-anchor: start;
- font-size: 1.2em;
- id: 8
entity_index: 8
xpos: 75
ypos: 7
styles:
- text-anchor: start;
- font-size: 1.2em;
icons:
- id: 0
entity_index: 1
xpos: 1
ypos: 53
align: start
size: 1
- id: 1
entity_index: 2
xpos: 53
ypos: 65
align: end
size: 0.5
names:
- id: 0
entity_index: 0
xpos: 50
ypos: 95
styles:
- font-size: 1.2em;
- id: 1
entity_index: 1
xpos: 15
ypos: 45
styles:
- text-anchor: start;
- font-size: 0.5em;
- id: 2
entity_index: 2
xpos: 85
ypos: 45
styles:
- text-anchor: end;
- font-size: 0.5em;
- id: 3
entity_index: 7
xpos: 0
ypos: 12
styles:
- text-anchor: start;
- font-size: 0.5em;
- id: 4
entity_index: 8
xpos: 80
ypos: 12
styles:
- font-size: 0.5em;
- text-anchor: start;
horseshoe_scale:
min: 0
max: 10000
width: 6
color_stops:
'0': orange
'2000': orange
card_mod:
style: |
ha-card {
--ha-card-background: var(--card-background-color);
color: var(--primary-color);
}
- type: custom:plotly-graph
view_layout:
grid-area: energy
hours_to_show: current_day
title: System Timer
time_offset: 1h
refresh_interval: auto
fn: |
$fn({hass, vars}) => {
vars.computeAll = () => {
const timeSlots = [
{start: 1, end: 2, cap: 1},
{start: 2, end: 3, cap: 2},
{start: 3, end: 4, cap: 3},
{start: 4, end: 5, cap: 4},
{start: 5, end: 6, cap: 5},
{start: 6, end: 1, cap: 6}
];
const now = new Date();
const xs = [];
const ys = [];
timeSlots.forEach(({start, end, cap}) => {
const startTimeString = hass.states[`sensor.sunsynk_time_slot_${start}`].state;
const endTimeString = hass.states[`sensor.sunsynk_time_slot_${end}`].state;
const capacity = parseFloat(hass.states[`number.sunsynk_prog${cap}_capacity`].state);
const [startHours, startMinutes] = startTimeString.split(':').map(Number);
const [endHours, endMinutes] = endTimeString.split(':').map(Number);
const startTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), startHours, startMinutes);
let endTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), endHours, endMinutes);
if (endTime < startTime) {
endTime.setDate(endTime.getDate() + 1);
}
xs.push(startTime, endTime);
ys.push(capacity, capacity);
});
return { xs, ys };
}
}
entities:
- entity: sensor.deye_sun12k_battery
name: |
$fn ({ ys,meta }) =>
"SOC" + "🔋" + "(" +ys[ys.length - 1]+"%)"
line:
color: red
shape: spline
width: 1
fillcolor: rgba(255,0,0, 0.3)
show_value: true
texttemplate: '%{y}'
- entity: sensor.deye_sun12k_pv_power
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆" + "(" +ys[ys.length - 1]+"W)"
line:
color: rgb(255, 155, 48)
shape: spline
width: 1
fill: tozeroy
fillcolor: rgba(255, 155, 48, 0.3)
yaxis: y2
show_value: false
showlegend: true
- entity: sensor.deye_sun12k_external_ct1_power
name: |
$fn ({ ys,meta }) =>
"Grid" + "💡" + "(" +ys[ys.length - 1]+"W)"
fill: tozeroy
line:
color: rgb(84, 144, 194)
- entity: sensor.sunsynk_combined_capacity
name: |
$fn ({ ys, meta }) =>
"Prog Capacity"
line:
color: rgb(30, 144, 255)
width: 2
fillcolor: rgba(30, 144, 255, 0.6)
show_value: true
unit_of_measurement: '%'
filters:
- fn: ({ vars }) => vars.computeAll()
layout:
showlegend: true
yaxis:
nticks: 20
range:
- 0
- 105
fixedrange: true
yaxis2:
range:
- 0
- 6600
fixedrange: true
xaxis:
nticks: 9
tickangle: 0
config:
scrollZoom: false
- type: custom:flex-horseshoe-card
view_layout:
grid-area: g2
entities:
- entity: sensor.deye_sun12k_battery
decimals: 0
unit: '%'
name: BATTERY
- entity: sensor.deye_sun12k_battery_1_voltage
decimals: 2
unit: V
- entity: sensor.deye_sun12k_battery_current
decimals: 2
unit: A
- entity: sensor.deye_sun12k_battery_power
decimals: 0
unit: W
- entity: sensor.deye_sun12k_today_battery_discharge
decimals: 2
unit: kWh
name: Discharge
- entity: sensor.deye_sun12k_today_battery_charge
decimals: 2
unit: kWh
name: Charge
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;
- 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: 76
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: 81
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;
horseshoe_scale:
min: 0
max: 100
width: 6
color_stops:
'0': pink
'2000': pink
card_mod:
style: |
ha-card {
--ha-card-background: var(--card-background-color);
color: var(--primary-color);
}
- type: custom:plotly-graph
view_layout:
grid-area: sg
entities:
- entity: sensor.deye_sun12k_today_production
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆" + "(" +ys[ys.length - 1]+"kWh)"
type: bar
texttemplate: '%{y}'
filters:
- filter: i>0
marker:
color: rgb(255, 155, 48)
- entity: sensor.deye_sun12k_today_energy_import
name: |
$fn ({ ys,meta }) =>
"Grid Import" + "💡" + "(" +ys[ys.length - 1]+"kWh)"
type: bar
texttemplate: '%{y}'
filters:
- filter: i>0
marker:
color: rgb(84, 144, 194)
- entity: sensor.deye_sun12k_today_load_consumption
show_value: true
name: |
$fn ({ ys,meta }) =>
"Load" + "⚡" + "(" +ys[ys.length - 1]+"kWh)"
period: day
type: line
texttemplate: '%{y}'
line:
color: rgb(95, 182, 173)
width: 2
hours_to_show: 31d
title: null
refresh_interval: 600
defaults:
entity:
statistic: state
period: day
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.scroll( '<', -.5)
- $fn({vars}) => vars.scroll( '>', .5)
direction: right
active: -1
pad:
r: 10
t: 10
type: buttons
x: 1
xanchor: right
'y': 1.25
yanchor: top
- 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
barmode: stack
legend:
bgcolor: rgba(0,0,0,0)
itemsizing: constant
font:
size: 11
height: 410
config:
displayModeBar: false
scrollZoom: false
- type: custom:plotly-graph
view_layout:
grid-area: m
entities:
- entity: sensor.deye_sun12k_today_production
statistic: sum
name: |
$fn ({ ys,meta }) =>
"Solar" + "🔆"
period: month
type: bar
width: $fn() => 1000*60*60*130
offset: $fn() => -1000*60*60*325
texttemplate: '%{y}'
filters:
- delta
marker:
color: rgb(255, 155, 48)
- entity: sensor.deye_sun12k_today_load_consumption
statistic: sum
name: |
$fn ({ ys,meta }) =>
"Load" + "⚡"
period: month
type: bar
filters:
- delta
width: $fn() => 1000*60*60*130
offset: $fn() => -1000*60*60*195
texttemplate: '%{y}'
marker:
color: rgb(95, 182, 173)
- entity: sensor.deye_sun12k_today_energy_import
statistic: sum
name: |
$fn ({ ys,meta }) =>
"Grid Import" + "💡"
period: month
type: bar
texttemplate: '%{y}'
width: $fn() => 1000*60*60*130
offset: $fn() => -1000*60*60*325
filters:
- delta
marker:
color: rgb(84, 144, 194)
- entity: sensor.deye_sun12k_today_energy_export
statistic: sum
name: |
$fn ({ ys,meta }) =>
"Grid Export" + "💡"
period: month
type: bar
texttemplate: '%{y}'
width: $fn() => 1000*60*60*130
offset: $fn() => -1000*60*60*65
filters:
- delta
marker:
color: '#385674'
- entity: sensor.deye_sun12k_today_battery_discharge
statistic: sum
name: |
$fn ({ ys,meta }) =>
"Battery Discharge" + "🔋"
period: month
type: bar
width: $fn() => 1000*60*60*130
offset: $fn() => 1000*60*60*65
texttemplate: '%{y}'
filters:
- delta
marker:
color: rgb(151, 90, 182)
- entity: sensor.deye_sun12k_today_battery_charge
statistic: sum
name: |
$fn ({ ys,meta }) =>
"Battery Charge" + "🔋"
period: month
type: bar
width: $fn() => 1000*60*60*130
offset: $fn() => 1000*60*60*195
texttemplate: '%{y}'
filters:
- delta
marker:
color: yellow
hours_to_show: 6M
title: Monthly Production
refresh_interval: 600
defaults:
yaxes:
fixedrange: true
layout:
legend:
bgcolor: rgba(0,0,0,0)
itemsizing: constant
font:
size: 11
height: 410
config:
displayModeBar: false
scrollZoom: false
time_offset: 1M
- type: vertical-stack
view_layout:
grid-area: ls
cards:
- type: entities
entities:
- entity: sensor.prepaid_units_left
type: custom:bar-card
entity_row: true
severity:
- color: Red
from: 0
to: 40
- color: Orange
from: 41
to: 80
- color: null
from: 81
to: 300
- entity: input_number.prepaid_units
- entity: sensor.units_used_since_last_update
name: Units Used Since Last Update (kWh)
icon: mdi:flash
- entity: sensor.last_update_date
name: Last Update
icon: mdi:calendar
- entity: script.update_prepaid_units
- type: custom:plotly-graph
entities:
- entity: sensor.deye_sun12k_today_energy_import
texttemplate: '%{y:.1f}'
name: Import
type: bar
statistic: state
period: day
marker:
color: '#5e90c1'
opacity: 1
filters:
- filter: i>0 && i < xs.length - 1
- fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.deye_sun12k_today_energy_import'].state],
})
- entity: sensor.deye_sun12k_today_battery_discharge
texttemplate: '%{y:.1f}'
name: Discharge
type: bar
statistic: state
period: day
marker:
color: '#935bb6'
opacity: 1
filters:
- filter: i>0 && i < xs.length - 1
- fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.deye_sun12k_today_battery_discharge'].state],
})
- entity: sensor.deye_sun12k_today_production
texttemplate: '%{y:.1f}'
textposition: outside
name: Production
type: bar
statistic: state
period: day
marker:
color: orange
opacity: 1
filters:
- filter: i>0 && i < xs.length - 1
- fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.deye_sun12k_today_production'].state],
})
- entity: sensor.deye_sun12k_today_load_consumption
texttemplate: '%{y:.1f}'
name: Consumption
type: bar
statistic: state
period: day
marker:
color: '#6cb6ac'
opacity: 0.9
filters:
- map_y_numbers: y *(-1)
- filter: i>0 && i < xs.length - 1
- fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.deye_sun12k_today_load_consumption'].state * (-1)],
})
- entity: sensor.deye_sun12k_today_battery_charge
texttemplate: '%{y:.1f}'
textposition: outside
name: Charge
type: bar
statistic: state
period: day
marker:
color: '#fdff1d'
opacity: 0.9
filters:
- map_y_numbers: y *(-1)
- filter: i>0 && i < xs.length - 1
- fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.deye_sun12k_today_battery_charge'].state * (-1)],
})
- entity: sensor.deye_sun12k_today_energy_export
texttemplate: '%{y:.1f}'
name: Export
type: bar
statistic: state
period: day
marker:
color: '#385674'
opacity: 0.9
filters:
- map_y_numbers: y *(-1)
- filter: i>0 && i < xs.length - 1
- fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.deye_sun12k_today_energy_export'].state * (-1)],
})
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.scroll( '<', -.5)
- $fn({vars}) => vars.scroll( '>', .5)
direction: right
active: -1
pad:
r: 10
t: 10
type: buttons
x: 1
xanchor: right
'y': 1.25
yanchor: top
- buttons:
- $fn({vars}) => vars.zoom( '60d', 24*60)
- $fn({vars}) => vars.zoom( '30d', 24*30)
- $fn({vars}) => vars.zoom( '15d', 24*15)
direction: right
active: -1
pad:
r: 10
t: 10
type: buttons
x: 0
xanchor: left
'y': 1.25
yanchor: top
barmode: relative
bargap: 0.2
height: 520
legend:
bgcolor: rgba(0,0,0,0)
itemsizing: constant
font:
size: 11
xaxis:
showgrid: true
linewidth: 0
linecolor: null
yaxis:
visible: true
fixedrange: true
hours_to_show: 31d
config:
scrollZoom: false
refresh_interval: auto
view_layout:
grid-area: ge
layout:
grid-template-columns: 10% 10% 10% 10% 10% 10% 10% 10% 10%
grid-template-rows: auto 2fr auto auto
grid-template-areas: |
"g1 g1 g1 g2 g2 g2 g3 g3 g3"
"flow flow flow flow graph graph graph graph graph"
"ge ge ge ge ge ge ge ge ge"
"m m m m m m m m m"
justify-items: stretch
mediaquery:
'(max-width: 800px)':
grid-template-columns: 100%
grid-template-areas: |
"g1"
"g2"
"g3"
"flow"
"graph"
"ge"
"m"
'(max-width: 1300px)':
grid-template-columns: 33% 33% 33%
grid-template-rows: auto
grid-template-areas: |
"g1 g2 g3"
"flow flow flow "
"graph graph graph"
"ge ge ge"
"m m m"
subview: false
Lg, S.