Howto: Fronius Integration with battery into Energy Dashboard

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.

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