Howto: Fronius Integration with battery into Energy Dashboard

No, the integration must be added as usual, the configuration.yaml is only to create the entities for the energy dashboard

ok, so I think I have to dive deeper into that template stuff before moving on. :roll_eyes:

not necessarily, you have to install the integration at first and then you can add a template to create the entities to add on the energy dashboard.
You can use the code on the first post, it works well and if you have HA in english it should be only a copy and paste.
Anyway once you get it works, you can customize it like I did, adding stuff, or give a better format to the values etc…

The default entity_ids the Fronius integration sets up have changed meanwhile. But it should be trivial to find the according ones. Copy & paste won’t work out of the box though.

Thanks for the clarification, that’s why I used “should” . :sweat_smile:

Anyway, at the beginning I copied and paste the code at first post and worked, of course I had to add more stuff since I have 2 inverter but - entities’ names in Italian a part - I didn’t have any big issues with it. :wink:

I think my problem is, that I don‘t know where to paste the code. I pasted it to my configuration.yaml which, obviously don‘t work? I also don‘t understand if it is needed to ad the „helpers“. I could not find anything about that in the first post.

I used “packages” folder.
Inside of home assistant installation folder i created a subfolder called “packages”.
Here I added a file named fotovoltaico.yaml (fotovoltaico is the italian word for solar plant), and I pasted the code above.

To enable the package folder you have to add this line to configuration.yaml

homeassistant:
  packages: !include_dir_named packages

For the helpers there is a section on gui. Settings → Devices & Services → Helpers (last tab on top)

I did it so but maybe there is a better way

1 Like

“Helpers” came to existence long after the first post in this thread. You can configure a Riemann sum integration by yaml or - now alternatively - via a helper.

1 Like

Thanks for your help!
What I meanwhile did (basically through trial and error) is:

  • created the sensors by pasting this in the configuration.yaml (@crc-error79 I read about the packages folder, which makes sense to me, will be the next step).
template:
  - sensor:
      - name: "Battery Power Charging"
        unit_of_measurement: W
        device_class: power
        state: "{{ max(0, 0 - states('sensor.solarnet_leistung_von_der_batterie') | float(default=0)) }}"
      - name: "Battery Power Discharging"
        unit_of_measurement: W
        device_class: power
        state: "{{ max(0, states('sensor.solarnet_leistung_von_der_batterie') | float(default=0)) }}"
      - name: "Power Photovoltaics"
        unit_of_measurement: W
        device_class: power
        state: "{{ states('sensor.solarnet_power_photovoltaics') | float(default=0) }}"

Then I created the two helpers for battery charging and discharging. I think I’m on a good way now.

Yeah! You are getting data to use in the energy dashboard!
Now - this is the boring part - you must only be patience because it riemann sum requires time, many time :slight_smile:
I think that by tomorrow you should be able to confront that data with the one from solarweb app to see if it works correctly

1 Like

Only thing is that I’m not sure ist the units are ok?! I guess it should be kW, resp. kWh ?! Setting up the riemann integration, I choose “none” instead og “k” as prefix. Is this correct?


It is ok, that’s the same error I did at the first…
The energy dashboard will do the conversion Wh → kWh for you

I think there is still a mismatch concerning the units. The battery has been loaded over the day up to 82% (capacity 10.2 kWh).



Screenshot 2023-08-07 153501

Shouldn’t it be 9.63 kWh in the first picture?!

Had you add the two entities (helper - Riemann sum) for battery (“charging” and “in use”) to the energy dashboard?

Yes, I created a helper for charge and one for discharge.

On the last picture you posted charge and discharge are 0, it seems that the helper are not set here, could you check? …because on the other pictures you have values for the battery

I still believe, there is a fault with the units.
This is the entity,

I used to create the two sensors:


Then, I created the two riemann summ integration:


These are correct… it is strange you have no data…
When you added it? Because it need time to populate data

Mine are also in Wh (the missing data in graphs is because today I powered off the server for maintenance)

@FlyByWire
Just noticed, are you sure that the Riemann sum are done with the right sensors?
Because it is strange that the update is almost the same for both: charge and discharge.

If you see mine data now I am using the battery so the “batteria - in uso” (battery in use) is updated to few seconds ago, but “batteria - ricarica” (battery in charge) has the last update 1 hour ago (when the panels were in production)

Yes, I‘m sure that is correct. Again, coming back to units. When I look at the created sensor for discharging the battery:


and comparing to the Fronius web.app:

the number seems to be correct, but the unit is not?!

Could this be changed to kW?