Calculate the current consumption in W as in Fronius solarweb

Hello all,

I have a Fronius Symo Hybrid 5.0-3-S, a Symo 4.5-3-S, a BYD battery HV and a powermeter. The integration in HA works well with the official Fronius integration.
I can see the current consumption of the house in W in the solarweb view of Fronius. I would like to have that in HA as well. The current consumption is not available in the json data of the inverter and must be calculated. But I can’t manage to build a formula from the given entities. Has anyone ever managed to do this? I could not find anything on the net.

Thanks for your help
Ralph

Fronius

What data is available in the json data?

Hi whoismoses,

thanks for your help.

So far I only use the entities provided by the Fronius integration. But this is the same data provided via Json.

The inverter with IP …150 manages everything. The second one with IP …151 only supplies energy.

These are the entities provided by the Fronius integration.

As a newbie, I can only embed one image, so here are the links to the images in my cloud.

Fronius Json data from IP…150 inverter

This is the data from the HA Dashboard

You can create a template entity using

{{ states("sensor.power_photovoltaics_fronius_power_flow_0") | float(0) + 
states("sensor.power_grid_fronius_power_flow_0") | float(0) }}

Thanks for your template.
I adaped it. But it doesn’t work for me, because I still have to consider the battery. But thinking about your template has given me an idea. I’ll log the values for a whole day, then compare them and get back to you.

Wouldn’t it just work to add/subtract (not sure how battery is represented) the SolarNet power battery entity state?

I have created two different templates.
“aktueller_verbrauch” contains only the combined production of the two inverters + battery and grid.
In direct comparison of the current values with the Fronius display, this is usually somewhat higher. About 20 watts more. But if I look at the time course, they are not quite plausible, because I have small negative peaks here.

aktueller_verbrauch:
  value_template: "{{ states('sensor.pv_produktion_sum') | float(0) + states('sensor.power_battery_fronius_power_flow_0_192_168_178_150') | float(0) + states('sensor.power_grid_fronius_power_flow_0_192_168_178_150') | float(0) }}"
  unit_of_measurement: W

In “aktueller_verbrauch_alles” I have simply summed up all entities with the measurement W. Here the current values fit pretty well. But over time, the negative peaks are much larger.

aktueller_verbrauch_alles:
   value_template: "{{ states('sensor.pv_produktion_sum') | float(0) + states('sensor.power_ac_fronius_inverter_1_192_168_178_150') | float(0) + states('sensor.power_battery_fronius_power_flow_0_192_168_178_150') | float(0) + states('sensor.power_grid_fronius_power_flow_0_192_168_178_150') | float(0) + states('sensor.power_load_fronius_power_flow_0_192_168_178_150') | float(0) + states('sensor.power_real_fronius_meter_0_192_168_178_150') | float(0) }}"
  unit_of_measurement: W

Link to the image in my cloud

This is how it looks in the Fronius web interface.

Link to the image in my cloud

As an approximate value this works quite well but for permanent archiving this bothers me. If someone has an idea where my error lies, gladly report.