Page 1 of 1

Cumulative PV numbers?

Posted: Fri Feb 02, 2024 5:31 am
by jsfoxe
So, as well as the current instantaneous power values in W, the inverter maintains cumulative since-manufacture transfer values in units of 0.1kWh.

Those are kept for: PV generation, battery charge, battery discharge, grid export, grid import, inverter output, inverter input and load.

Charge/discharge, export/import and output/input are separately measuring the two directions of energy flow at the same points. PV and load only have a single direction. Usually. Further, I can imagine that charge/discharge, output/input and PV are measured directly within the inverter so ought to be fairly accurate. Export/import are from the CT which as previously pointed out suffers from measurement loss over a long CT cable run. Load is the odd one out as it can't be directly measured (usually), so must be being calculated as something like output+import-input-export, which means it suffers the same inaccuracy as the import/export figures. There is also a hidden value in here: loss due to the power required to power the inverter itself. I only calculate instantaneous for that, but assume it can be calculated as pv+discharge+input-output-charge.

It appears to be a well-known undocumented fact that most of these values can be retrieved from the cloud using the variable names:

charge: "chargeEnergyToTal"
discharge: "dischargeEnergyToTal"
export: "feedin"
import: "gridConsumption"
output: "generation"
input: "input"
load: "loads"

But I can't find anywhere any reference to a variable for PV. Note that "generation" isn't it: that really is inverter output and includes battery discharge (and losses).

I've seen an integration try to calculate it as (load+charge+export-import-discharge) but that very badly undercounts by anywhere from 5-30% and the cumulative error gets worse over time. It's not even monotonic! I experimented with (output+charge-input-discharge) and (output-discharge) but they provide no better values.

I *know* that the inverter tells the cloud this number, *please* tell me there's a named variable to get it back out...?

Re: Cumulative PV numbers?

Posted: Fri Feb 02, 2024 7:42 am
by canton7
How do you know that the inverter sends cumalative PV generation to the cloud? There's no modbus register for it. The consensus seems to be that the cumulative figure shown on foxcloud is calculated by the cloud, not by the inverter.

Re: Cumulative PV numbers?

Posted: Fri Feb 02, 2024 9:02 am
by calum
There's no modbus register for it.
In light of this, I'm curious where the sensor.solar_energy_total entity provided by Foxess Modbus gets its value from!

Re: Cumulative PV numbers?

Posted: Fri Feb 02, 2024 12:59 pm
by canton7
It's just a Reimann sum integral, integrating pv power every poll.

Re: Cumulative PV numbers?

Posted: Fri Feb 02, 2024 3:54 pm
by jsfoxe
canton7 wrote: Fri Feb 02, 2024 7:42 am How do you know that the inverter sends cumalative PV generation to the cloud?
Because I can see the data in the protocol, being sent out from the inverter into the cloud within the 5 minutely data block, grouped right next to all the other cumulative energy values I mention, and its value correlates very well with what the PV instantaneous power readings are doing...
There's no modbus register for it.
...and also various bits of leaked documentation list the modbus registers for it right there alongside the registers for the other cumulative energy values.
The consensus seems to be that the cumulative figure shown on foxcloud is calculated by the cloud, not by the inverter.
The consensus appears to be wrong.
calum wrote: Fri Feb 02, 2024 9:02 am
There's no modbus register for it.
In light of this, I'm curious where the sensor.solar_energy_total entity provided by Foxess Modbus gets its value from!
According to nathanmarlor/foxess_modbus, on a H1 it comes from registers 11069 and 11070 (which agrees with other sources too):

Code: Select all

        key="solar_energy_total",
        addresses=[
            ModbusAddressesSpec(models=H1_SET, input=[11070, 11069]),
            ModbusAddressesSpec(models=[KH], input=[11070, 11069], holding=[32001, 32000]),
            ModbusAddressesSpec(models=H3_SET, holding=[32001, 32000]),
        ],
...which, as there appears to be a contributor to that repo called canton7, I'm perhaps a little surprised to see the assertion that it doesn't exist pop up here...

Re: Cumulative PV numbers?

Posted: Fri Feb 02, 2024 8:03 pm
by canton7
No need to be snarky! That's right - there's a pv sum for all pv, but not for the individual strings.

Re: Cumulative PV numbers?

Posted: Fri Feb 02, 2024 8:15 pm
by jsfoxe
I didn't ask for individual strings. I asked for the cumulative total, which I already knew is there somewhere and sent to the cloud. The side-by-side equivalent to all the other cumulative values I mentioned.