Hi,
I have a solaredge system and a BYD LVS 12 KW Battery with it. The solaredge integration gives me a entity which outputs negative kW when charging and positive kW when discharging.
So what i did is divide them into input (into the battery) and output (out of the battery) kW with two templates:
sensor:
- name: Solaredge Battery Input Power
unit_of_measurement: "kW"
device_class: "power"
state: >
{% set energy = states('sensor.solaredge_gespeicherte_energie') | float %}
{% if energy < 0 %}
{{ energy * -1 }}
{% else %}
0
{% endif %}
sensor:
- name: Solaredge Battery Output Power
unit_of_measurement: "kW"
device_class: "power"
state: >
{% set energy = states('sensor.solaredge_gespeicherte_energie') | float %}
{% if energy > 0 %}
{{ energy }}
{% else %}
0
{% endif %}
This results in this the "Gespeicherte Energie" getting properly separated into two positive kW readings.
Now i have setup a integral integration to sum those into kWh to be displayed in the engery dashboard like so:
platform: integration
source: sensor.solaredge_battery_input_power
name: solar_battery_input
platform: integration
source: sensor.solaredge_battery_output_power
name: solar_battery_output
This results in some weird behaviour in the dashboard showing way to much kWh going in and out of the battery. Observations tell me something is off in the integration integration since it records a night charge (yes i charge the battery from grid to full [i have a dynamic energy tarif so it's cheaper in the night]) going from 282,42kWh to 307,78kWh. Knowing that the battery is "just" 12 kW this is impossible to achieve.
Does someone know how to fix this?
Thanks