Fronius GEN24 with battery (api values)?

I am VERY close to getting my python script to work as expected, however, I am still a little unclear on exactly what needs to be passed to the API.

I have the v1 value sorted using the c1=1 but I am unsure about the n value and what (from the following example data) needs to go into v2, v3 and v4

There is a value (EnergyReal_WAC_Sum_Consumed) that I have been using as the value for v3 but is this what I should be using? It appears to only increase in value if/when I draw power from the grid.

Here is a set of values taken at 2024-11-27 11:25:49+11:00 (as an example):
v1 → Energy Generation: 551164.2794444445 Watt hours
v3 → Energy Consumption: 8266.0 Watt hours
p = 5566.99560546875 watts AC Output (+ produce/export, - consume/import)
P_PV = 5804.0721435546875 watts generation (DC Side)
P_LOAD = -583.3456054687504 watts consumption (+ generator, - consumer)
P_Akku = -1.121452808380127 watts to/from battery (+ discharging, - charging)
P_Grid = -4983.65 watts to/from grid (+ from grid, - to grid)

I am not even sure if I have explained this well enough as I am a little frazzled after looking at it for hours on end.

Cheers,
Colin

Consumption energy (v3) can be calculated from

  • EnergyReal_WAC_Minus_Absolute (total cumulative export)
  • EnergyReal_WAC_Plus_Absolute (total cumulative import)

See the PHP code from @grannos below -

Thanks for your reply.

It is @grannos script that I am basing the python script off and these values are the same.

  • EnergyReal_WAC_Minus_Absolute = EnergyReal_WAC_Sum_Produced
  • EnergyReal_WAC_Plus_Absolute = EnergyReal_WAC_Sum_Consumed
    So I assume that if I have the c1 = 1 (i.e. Both v1 and v3 values are lifetime energy values), then it should be reporting the correct figures when I pass the Sum_Consumed to v3?

So this now leaves the values of n, v2 and v4. What do I need to put into these values?

Cheers.