have a look some posts above: Fronius Integration into Energy dashboard - #13 by almtaler
This looks quite promising, apart from the entity names - which are used twice for grid and battery (grid_import_power
and grid_export_power
) - but you should only need the battery ones anyway. So I guess (copied untested as I don’t have a battery myself):
sensor:
- platform: template
sensors:
battery_discharge_power:
device_class: power
friendly_name: "Batterie entladen"
unit_of_measurement: "W"
value_template: "{{ max(0, states('sensor.power_battery_fronius_power_flow_0_http_192_168_99_1') | float) }}"
battery_charge_power:
device_class: power
friendly_name: "Batterie laden"
unit_of_measurement: "W"
value_template: "{{ max(0, 0 - states('sensor.power_battery_fronius_power_flow_0_http_192_168_99_1') | float) }}"
- platform: integration
source: sensor.battery_charge_power
name: Batterie geladen
unit_prefix: k
round: 2
- platform: integration
source: sensor.battery_discharge_power
name: Batterie entladen
unit_prefix: k
round: 2
Just try it and let me know if it works