Skip to content

Understand PV string power generation using foxess ha

DaiButt edited this page Dec 6, 2021 · 13 revisions

There are a couple of ways of getting to your PV generation data using foxess-ha.

1) The FoxESS Cloud API can return the variables “Generation Power” and “Energy Generated”, respectively real time generation (kW) and cumulative daily energy generated (kWh).

There are a few potential issues with this;

a) FoxESS appear to draw the boundary of the PV system downstream of the inverter.

If you have battery storage, Energy Generated/Generation Power will not reflect your PV generation (as battery charge/discharge will impact the numbers).

b) If you do not have battery storage, this is less of an issue. However inverter/system losses will have an impact on the numbers (more on this later).

c) It does not allow the user to understand performance of individual arrays/strings.

2) To try and get a value for “PV generation” (the yellow part in the diagram above) foxess-ha performs an energy balance;

In - Out = Accumulation

(Solar generation + Grid consumption) - (loads consumption + feed in) = (battery charge - battery discharge)

or rewritten as;

Solar Generation = battery charge - battery discharge - Grid consumption + loads consumption + feed in.

In foxess-ha these are available as sensor.foxess_energy_generated (daily kWh) and sensor.foxess_solar_power (real time kW).

This overcomes the issue in 1a) above for those with battery storage.

Issue 1b (inverter losses) is still an issue however.

When PV is not generating (say overnight) the mass balance method means any losses get lumped in to the energy_generated and solar_power entities, causing the former to decrease and the latter to turn negative. Using sensor.foxess_energy_generated as the solar source in the HA energy dashboard can lead to “negative solar power” in the hourly charts, mainly overnight.

Issue 1c is also not resolved, for those that want to understand individual string performance.

3) The Foxess Cloud API can also return the values of PV1, PV2, PV3 and PV4; the real time power output of PV strings 1-4.

In foxess-ha these are available as sensor.foxess_pv1_power, sensor.foxess_pv2_power, etc.

These are the array power readings that FoxESS is measuring and these do not go negative (as far as we know!).

However they are only available as real time power values (kW) not daily accumulated energy values (kWh), so cannot be used directly in the HA energy dashboard.

To use them in the HA energy dashboard, Riemann sum integral entities can be created for each array in configuration.yaml (example for 2 array system);

platform: integration
   source: sensor.foxess_pv1_power
   name: pv1_sum
   unit_time: h
   round: 2
platform: integration
   source: sensor.foxess_pv2_power
   name: pv2_sum
   unit_time: h
   round: 2

Theses entities are increasing totals, and can be plugged into the energy dashboard configuration;

This gets round the issues in 1a, 1b (partly) and 1c.

Inverter losses do still have an impact, it seems these will now appear as ”extra” consumption in the HA energy dashboard “Home” figures.

This also allows separate forecasts for each array to be configured using Solcast or Forecast.Solar;


4) If it is required to have daily totals for each array outside of the HA energy dashboard

Add them as utility meters, sourced from the Riemann sum integrals above;

utility_meter:
   daily_pv1_sum:
      source: sensor.pv1_sum
      cycle: daily
   daily_pv2_sum:
      source: sensor.pv2_sum
      cycle: daily