Howto: Fronius Integration with battery into Energy Dashboard

Hi John,

thanks for pointing this out and referring me to the docs. I have added another Riemann Sensor, which uses the power photovoltaics. AFAIK this is the DC power, not the AC power.

  • If a battery is connected to an inverter: Use Riemann sum over Power photovoltaics entity (from your SolarNet device).

If I use the template, which produces different energy sum over the day:

So 40.5 kWh for the Riemann sum over the power photovoltaics and 38.9 kWh for the template sensor.

Here is my template sensor for reference:


{{ 
(states('sensor.pv_solarnet_energy_total') | float(0)) - 
(states('sensor.byd_batterie_entladen_gesamt') | float(0))  + 
(states('sensor.byd_batterie_laden_gesamt') | float(0))
}}

battery chariging and discharging are the riemann sums of the power feed into the battery

I believe the difference comes from the power photovoltaics being DC and we loose some energy in the conversion to AC.

So my guess would be that the total energy is more accurate than the riemann sum.

Thanks for all the help!

In you screenshots you can see that at about 9 o’clock there is a wrong interpretation.
There is no self consumed solar power and negative battery discharging.
Does your template sensor take into account, that there is missing energy because of the battery efficency? I don’t have the two byd sensors so i can’t tell if they work as I expect.
But if they come from the integration you have the energy total sensor which updates every 10sec and the other two which update every minute, so the sensor has even less accuracy but still a correct total, which could produce problem with historic data.
The accuracy of the riemann is low, but you can use a modbus sensor to optimize that, but still your dashboard seams to be wrong.
The check if the total daily numbers are correct you have to calculate yourself which are more accurate, but just because your sensor has a higher value doesn’t mean it is more accurate.

1 Like

Hi,

I integrated my battery with the settings from the first post. I do not really remember the reason I put in kW instead of w. Until May 9th, everything was fine. Between 9 and 10 PM, the numeric value of kWh went up by 1000x.

I did not change any config that time.

Any idea on that?




Thanks!!

Edit:

I (partly) solved the Problem by switching from “KW” to “W” in ‘configuration.yaml’

The values are now looking good. The problem is the wrong energy history for the battery. Any idea how to “bulk” edit the wrong values? That’s a lot of data to correct with the statistic function in the developer tools


I would have to manually correct all data points between May, 9th and today?!

Another thing is that there are two readings on May, 20th that are even higher. I tried to edit this in the statistic function, but I couldn’t find the values for that time. I only see 5-Minute intervals (where I already manually edited 22:05 and 22:00, which did not resolve the problem). The exact timestamps (22:06:47 and 22:07:44) are not shown there.


Grr
 I just wrote a nice message to say it’s working
 And after checking it, it’s not working at all. I might as well chuck random numbers at it

A lot of different configurations and problems are discusses already. But did somebody have an complete Guide or a blog how to integrate fronius in the energy dashboard with battery etc. ?

Yes here

1 Like

Just a heads up: in the coming release 2024.7 there will be a bunch of new entities.
The signed power entities of Fronius API will be split up to 2 separate entities (positive and negative part - eg. charging/discharging). Therefore less template entities will be needed then (max(0-..., 0)).
The old signed entity will just be available as before for backward compatibility, but on new installations disabled by default.

Since it is beta phase now (until Wednesday) you may have a look at Lokalise and search for “fronius” to have decent names right from the start for everyone (especially if you know other languages than English or German). https://developers.home-assistant.io/docs/translations

Hi guys,

I have still some questions regarding all the entities showing up.

I have 2 inverters, Symo and GEN24. That means I have 2 SolarNet devices, the 2 inverters itself as separate devices the BYD batterie and my smart meter.

Did I understood right, that I need a helper to sum up the PV power from Symo and GEN24? The same for PV energy?

In one SolarNet device I see the entity “sensor.solarnet_leistung_generator” and the entity “sensor.solarnet_verbrauchsleistung” What is this?

Yes you probably need to sum these.

Verbrauchleistung should be the power your house uses.
Generator is the power which comes out of the inverter including battery at night.

1 Like

Thanks for all the help here @csett86 . Am I correct to assume that the integral is always for the past 24hours (rolling window)? Or is it always counted from the beginning of the day?

Many thanks in advance

The integral calculates the time elapsed since the last update of the source entity and the value. So if it updates 1 kW after 1 hour thats 1 kWh. But 1 kW every 15 min is 0.25 kWh.
If you want a reset every day use the Utility Meter

If you have following sensors:

sensor.solarnet_entladeleistung
sensor.solarnet_ladeleistung

then this code converts those to kwh:

template:
  - sensor:
      - name: "SolarNet Entladeleistung"
        state: "{{ states('sensor.solarnet_entladeleistung') | float / 1000 }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing


      - name: "SolarNet Ladeleistung"
        state: "{{ states('sensor.solarnet_ladeleistung') | float / 1000 }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing

New sensors after:
sensor.solarnet_entladeleistung_2
sensor.solarnet_ladeleistung_2

Now those can be selected in the Energie Dashboard.
hope that helps

You should be using Riemann sum integral.
Now you are just assigning the wrong unit and device class (kWh instead of kW). This will not work in energy dashboard.

This seems to work for me:

template:
  - sensor:
      - name: "Battery Power Charging"
        unit_of_measurement: W
        device_class: power
        state: "{{ max(0, states('sensor.solarnet_power_battery_charge') | float(default=0)) }}"
      - name: "Battery Power Discharging"
        unit_of_measurement: W
        device_class: power
        state: "{{ max(0, states('sensor.solarnet_power_battery_discharge') | float(default=0)) }}"
      - name: "Power Photovoltaics"
        unit_of_measurement: W
        device_class: power
        state: "{{ states('sensor.solarnet_power_photovoltaics') | float(default=0) }}"

sensor:
    - platform: integration
      source: sensor.battery_power_charging
      name: "Total Battery Energy Charged"
      method: left
    - platform: integration
      source: sensor.battery_power_discharging
      name: "Total Battery Energy Discharged"
      method: left
    - platform: integration
      source: sensor.power_photovoltaics
      name: "Total Photovoltaics Energy"
      method: left

Even if i am not happy about the presentation of current distribution in kWh (fronius is doing it it kW which is more “current” in my opinion)