Howto: Fronius Integration with battery into Energy Dashboard

Saved my day (and night)! :heart:

My main problem is, that there are no Entity like “Battery Power Charging” or even with “charging” in its name. (Or for me “laden” or “entladen”)
Sadly im only be able to screenshot my entire Entity-list.
Which of these i have to take?

It should be BYD Spannung DC and positive or negative is either charging or discharging. You can control that by looking at the inverter dashboard.

Take sensor.solarnet_leistung_von_der_batterie

Hi, i’m new to use HA and i would to configure energy dashboard from fronius sensor. i understood i have to use the sum riemann helper but the sensors i use not working. My sensors have italian name and Yaml file not work, too.
can anyone help me ? thanks

After I recreated almost everything it seems to work now.
But the Battery shows to much Energy…
I have this in my config:

template:
  - sensor:
      - name: "Battery Power Charging"
        unit_of_measurement: kW
        device_class: power
        state: "{{ max(0, 0 - states('sensor.pv1_2_leistung_von_der_batterie') | float(default=0)) }}"
      - name: "Battery Power Discharging"
        unit_of_measurement: kW
        device_class: power
        state: "{{ max(0, states('sensor.pv1_2_leistung_von_der_batterie') | float(default=0)) }}"
      - name: "Power Photovoltaics"
        unit_of_measurement: W
        device_class: power
        state: "{{ max(0, states('sensor.pv1_2_pv_leistung') |float(default=0) + states('sensor.pv2_leistung_ac') | 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"
    unit_prefix: k
    method: left

  - platform: template
    sensors:
        pv_sensor_leistung_gesamt:
            friendly_name: "PV Gesamt"
            unit_of_measurement: 'W'
            value_template: '{{ states("sensor.pv1_2_pv_leistung") |float + states("sensor.pv2_leistung_ac") | float }}'  

Why is the dot at the wrong position?

I once more recreated this. This time only with W. Now ist seems to be finished…

Hi everyone,
I am also new to HA and agree with the previous speaker - a difficult subject.
After testing and discarding various solutions, I am obviously successful with @syon’s solution (still need some sunshine for the “Battery Power Charging” sensor) :slight_smile:

Many thanks to everyone who has tried to solve the problems here and tried to explain the background.

:slightly_smiling_face:

I’m still a little helpless with the Fronius Integration.
I did everything as written in this topic but the result is wrong…

I have 2 inverter. One Fronius symo hybrid and one Fornius symo. is it necessary to add both or are both added in the solarnet entity?

It depends on how they are set up. If they are connected via SolarNet (inverter to inverter), you will have both accumulated in your SolarNet device. If they have separate Datamanagers (each has an IP address and is LAN / WIFI connected) then you will need to add both and get 2 SolarNet devices.

Yeah, thx.
I’ve tested with SunSpec and Fronius (SolarNet).
They both had their own IP. At this Point they deliver Data.
I’ll have an eye on them.

Hi, thanks for all the infos. That helped me a lot!

I’m running the Rieman Sum for a while now, but noticed an issue in the evening:
It looks like the battery draining is counted twice. If the battery is loaded everything is fine. Once the battery is draining the fronius sensor total energy does increase as well as the battery draining total. So in the energy dashboard both are summed up.

You can see that in the energy dashboard:


It looks like the PV is producing energy and the battery is draining.

A solution (which is not tested as I will also loose some historic data) could be to subtract the drained energy from the PV total energy with a template sensor.
Does that make sense?
Does anybody else have the same issue?

Here you can see that the total energy is increasing even if the sun is not shining any more. At this time the energy is being used from the battery. If the battery is being loaded and no power is consumed from the PV the value is not increasing.

Now I got it. The Problem was that the units were mixed between W and kW… sometimes its that easy.
But now I struggle with deleting the old data and the longterm data.

Can you please share your details from Home Assistant? For me the values are still messed up.
2024-03-01_13h40_21

I’m facing the following issue. In my case, the energy data looks correct about 95% of the time. However, I’ve noticed that under certain conditions, it appears as though my house is producing electricity, as shown in the image. I have two inverters (Fronius Symo 6.0-3-M and Fronius Symo Gen24 10.0 Plus) and a BYD battery. Am I misreading the energy dashboard, or is it really possible that the house is consuming 0.00 kWh of electricity, generating no solar energy, yet I’m still feeding electricity back into the grid?


Hey there. If you double checked the energy dashboard config, the problem could be that the smart meter position is configured wrong in the inverter settings. That was the case with my installation but as this was 6 months ago I am not sure how I noticed it, but if you check the fronius ui and test some things and compare them with the smart meter display that could be the way. The grid position settings can only be changed with an technician account.
Check your installation and look if the cables match the setting, if you feel secure to open your electricity panel. Basically nothing can happen when the fuses are off. If you are not sure ask a professional. Same goes for login credentials.


The subtract method should definetly not be needed.

thedoctor586 and Crackeronkelz the same could work for you but you posted too few information at least for me to search for an solution. Could you add screenshots of your energy dashboard config?

I can also help you both look for it but that would spam the forum, so we could make a call on Discord if that is allowed.

1 Like

Normally you go to developer tools > statistics and click “fix issue” for the sensor in question and delete the data there.
image

If you only look for correcting the energy data, you also go there without deleting the integration and click the little graph button and changing all the values and then convert the numbers.

1 Like

Hi :person_raising_hand: Thank you for your feedback !
I really would appreciate a call on discord with you ! I would contact you via direct message!
After we found the solution i would come back and share the solution for the community :slight_smile:

1 Like

Hi John!

thanks for the suggestion. I tried it out and it did not help.

From what I can see in the history of the PV total value from fronius, is that the system does count the battery like an internal system. So the energy, which is fed into the battery won‘t count at this time, but when it leaves the battery. So the total sum is correct, but for the the energy dashboard the sum increases at the wrong time.

So my solution, which I will try out now is to subtract battery discharging and add the battery loading sum.

{{ 
(states('sensor.pv_energy_total') | float(0)) - 
(states('sensor.byd_battery_discharging_total') | float(0))  + 
(states('sensor.byd_battery_charging_total') | float(0))
}}

Like I said it is hard to tell without knowing your setup and your sensor, but you are using the SolarNet total energy sensor as solar production in the energy dashboard right?
Then you have the wrong energy dashboard settings.
Look herefor the correct settings.