Cumulative PV numbers?

Post Reply
jsfoxe
Posts: 20
Joined: Thu Dec 21, 2023 8:07 pm

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...?
canton7
Posts: 42
Joined: Sun Oct 23, 2022 12:17 pm

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.
calum
Posts: 389
Joined: Fri Feb 24, 2023 11:00 am
Location: Stockport

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!
H1-3.7 / 6xHV2600 / 14x400W / RS485 Modbus->HA
FoxESS Modbus HA Integration
Contact Fox here
canton7
Posts: 42
Joined: Sun Oct 23, 2022 12:17 pm

It's just a Reimann sum integral, integrating pv power every poll.
jsfoxe
Posts: 20
Joined: Thu Dec 21, 2023 8:07 pm

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...
canton7
Posts: 42
Joined: Sun Oct 23, 2022 12:17 pm

No need to be snarky! That's right - there's a pv sum for all pv, but not for the individual strings.
jsfoxe
Posts: 20
Joined: Thu Dec 21, 2023 8:07 pm

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.
Post Reply