Push Fronius log data from the past into PV Output?

Hey mate, not sure what version of the script you’re running, but the most recent version, all you have to change is the following:

$dataManagerIP = “fronius”;

Change ‘fronius’ to the IP address of your inverter, the most recent version of the script automatically detects the serial number.

Ah, got it. Thanks. Working now!

I’m getting an output now and have been comparing it to the Solarweb report for that day.

Initial 5-min interval at 0:00 gives no energy consumed according to this PHP data extract, but in Solarweb it shows I did consume energy in that 5-min interval.

Otherwise the totals for consumption and production all add up (except consumption for that initial interval).

Be interested to know how to extract either self consumption, or energy import / export to compare with Solarweb data.

Hi All,

Yes glad that everyone’s be able to extract some data. The 0:00 energy reading is zero because the energy used to this point in time is actually the last five minutes of the previous day i.e. 23:55 - 0:00 and I was too lazy to modify the code to extract the early data.

Basically this would require working out the previous date. Allowing for the fact that months have different numbers of days and some years are leap years and what happens if the missing data were from Jan 1st… There’s probably a function someone that does the heavy lifting…

I did some more thinking about this. The ENERGY figures reported by the Data Manager card represent the accumulated values over a 5 minute period. By definition then the first non zero value of the day must occur at 00:05. A non-zero value at 00:00 would be the accumulated energy for the period 23:55 - 0:00 of the previous day and consequently would need to be associated with that day.

Looking at my own PVO data I see that I have no data recorded for 0:00 at all.

G.

PVO has always been missing 5-min of data at the change of day when data comes via Fronius push. It’s a bug IMO.

PVO consumption data has never aligned with Solarweb as a result. It doesn’t affect production data since solar output is nil at midnight anyway.

The data is there, but it gets missed in PVO for some reason each day.

Is that correct though?

In Solarweb data the timestamps mark the beginning of intervals, not the end of intervals.

23:55 -> contains the data for period 23:55 to 23:59:59.99
0:00 -> contains the data for period 0:00 to 0:04:59.99

No they don’t and it would not make sense if they were. The 00:00 generation and consumption energy values are the previous day’s total values (consider the time as 24:00 in effect). The power values at that time should be the average generation and consumption powers over the 23:55 -> 00:00 period. Clearly there is no energy generated in that period and thus the generation power is 0. Since PVOutput was originally only concerned with generation that is why I believe this bug exists because it was never corrected once consumption energy/power was added. I pointed out this PVOutput bug here (and others) years ago.

I figured that this subject had probably been previously discussed. The 0:00 push would need to be attributed to the previous day.

A remedy would be to make 00:00 that LAST value of a given date which would of course be very confusing. I also assume then that there aren’t too many PVO users living in very high latitudes… 24 hours of sunlight and low ambient temperatures for panel efficiency - at least for a few days / year.

In PVO (via Fronius push) and this php code the 0:00 interval is always null. That’s OK if it really is yesterday’s data, but why then is there no 24:00 interval?

Put another way, the Fronius push to PVO and in this php code only provide data for 287 intervals per day.

In Solarweb there are data for 288 intervals per day.

There are 288 x 5-min intervals per day.

Solarweb and PVO daily reports both show time intervals from ranging from 0:00 to 23:55 and NOT from 0:05 to 24:00 (or 0:00).

Hence why to me it seems the time stamps mark the start of the interval, not the end.

I don’t see why it would not make sense to consider them to mark the start of the interval. It’s just an arbitrary definition of what to name an interval.

Why is that confusing? “00:00” is simply equivalent to “24:00” of the previous day.

In June 2019 I compared my PVO graphs (created using my own pusher logic) to Solarweb and they were essentially exactly the same except Solarweb was setting the day’s total consumption energy to the 23:55 value, not the next 00:00 value. The last 5 mins of consumption energy was being “leaked away” which was the same flaw as PVOutput. I sent many emails to Fronius Australia and Austria and eventually performed demonstrations of how it was clearly wrong, e.g. I turned an 2400W electric heater on at 23:55 and off at 23:59 each day and showed them the bump in consumption was not seen on their graphs. They finally agreed with me and fixed their graphs to calculate this correctly in Nov 2019.

1 Like

The Fronius push message sent with timestamp 00:00 contains the last day generation energy value for the entire day. (I.e. the final total, i.e. the maximum value). After the inverter sends that then it immediately resets it’s internal day accumulator.

BTW, this whole issue of dealing with day rollover is a bit of a pain and for generation energy and power it is essentially a moot point given there is no generation over midnight. However, it seems to me that Fronius realized this themselves when they added the smart meter (i.e. consumption monitoring) to the API because I note they did not even bother with a day consumption energy total, they only have a lifetime consumption total and software must derive day totals itself if a day count is wanted. This is how generation should have been done also. There is actually a lifetime counter for generation in the API but it is useless because it updates at a much slower rate than DAY_ENERGY so can not be used. Believe me, I have spent a lot of time on all these issues to get my generation and consumption energy and power graphs displayed perfectly on PVOutput.

Except that they occur on completely different days.

I do agree though that it is highly likely that it was never considered how / when to perform a final update for a given day since most systems wouldn’t be generating when the calendar advances from one day to another.

http://www.antarctica.gov.au/news/2019/first-australian-solar-farm-in-antarctica-opens-at-casey-research-station

No, “time 00:00 @ date” is mathematically exactly equivalent to “time 24:00 @ (date - 1)”.

Some languages/library/standards even accept either form. E.g. see https://en.wikipedia.org/wiki/ISO_8601#Times.

How do you get correct consumption data into PVO?

I created a free proxy service on the web which you point your Fronius inverter to instead of directly to PVOuput. It calculates everything correctly from the inverter and meter push data and stores that to PVOutput, fixing all the issues I know of. There is no need for the logdata push so you can delete it. Message me if you want to use it. Apart from myself, a couple of other users have been using it for ages very happily.

Hey, would appreciate some help. I’m getting the following errors when running the script before it spits out power and energy, but consumption equals energy. XXXXX is my meters serial.

Warning: Undefined array key “meter:xxxxx” in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 41
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 41
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 41
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 41
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 41

Warning: Undefined array key “meter:XXXXX” in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 42
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 42
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 42
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 42
Warning: Trying to access array offset on value of type null in C:\Users\Vesta\Downloads\PHP 803\GetFroniusData.php on line 42

23:50,44431.735,0,44431.735

Lines 41 and 42 are

$EnergyReal_WAC_Minus_Absolute = $arr[Body][Data][meter: . $meterSerial][Data][EnergyReal_WAC_Minus_Absolute][Values][$x];|

$EnergyReal_WAC_Plus_Absolute = $arr[Body][Data][meter: . $meterSerial][Data][EnergyReal_WAC_Plus_Absolute][Values][$x];|

Cheers

Hi @max-nz,

A couple of things to check first.

(i) Do you access your inverter my hostname or IP address? Line 4 of the script needs to be able to resolve to the inverter.

$dataManagerIP = “fronius”;

If you can ‘ping’ ‘fronius’ from your computer all is well otherwise replace "fronius’ with the IP address. e.g.

$dataManagerIP = “192.168.1.55”;

The IP address MUST be in quotes. Don’t accidentally delete the trailing semicolon ‘;’ or you will be in a world of hurt.

(ii) Have you altered lines 5 & 6 to set a “valid” country and “location”? Take a look at PHP: List of Supported Timezones - Manual to make sure that you have used values that are valid for PHP. Make sure that you do not accidentally delete or insert extra inverted commas around the values or accidentally delete on the trailing semicolons.

(iii) If you want to extract data from an earlier DATE you must specify it at line 14.

$date = “YYYY-MM-DD”;

(iv) If you want to extract data for TODAY you should set a time that is not in the future otherwise ignore $time as the entire 24 period will be extracted.

Let me know how things go.

I’m facing the same issue as @max-nz above.

It seems to be loading the meter ID ok as I see a number listed (which I’ll blank out below with xxx)

Warning: Undefined array key “meter:xxxxxxxx” in E:\PHP\FroniusData.php on line 41
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 41
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 41
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 41
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 41
Warning: Undefined array key “meter:xxxxxxxx” in E:\PHP\FroniusData.php on line 42
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 42
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 42
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 42
Warning: Trying to access array offset on value of type null in E:\PHP\FroniusData.php on line 42
23:55,42566.143611111,0,42566.143611111
Then repeats for the next 5min increment but reports the same errors above each time then ends with what looks like the time and usage details we are after on the last line above before it repeats again…

I’m running Windows 11 and downloaded PHP version 8.1.2 - VS16 x64 Non Thread Safe (2022-Jan-19 10:43:46), I also installed the mentioned Visual C++ Redistributable for Visual Studio 2015-2019 Pack that did not help.

Any idea what might cause the above? I have made the following changes to the PHP file:
$dataManagerIP = “192.168.1.200”;
$country = “Australia”;
$capitalCity =“Brisbane”;
$date = “2022-02-11”;
$time = “23:59”; (tried commenting this out as well)

P.S. I also tried to use the “VS16 x64 Non Thread Safe (2022-Jan-19 10:43:46)” Version of PHP as well as the 32bit “VS16 x86 Non Thread Safe (2022-Jan-19 10:44:10)” but got the same errors with the script on these builds of PHP as well.

P.S. I’ve also noticed the Energy Consumed does not seem to bright for our system that I’ll need to look into next (I had the same issue with the main PVOutput push script by needing to add a /n switch at the end of the export URL to export "net’ usage I believe…

Hi @jonnoc

What output do you get if you put the following into a browser? Depending on your local DNS you may need to use the Fronius’ IP rather than ‘fronius’.

http://fronius/solar_api/v1/GetMeterRealtimeData.cgi?Scope=System

It should return a ‘screenful’ of data.

Grannos

I’m not able to use ‘fronius’ as it does not seem to be registered on my router as such but if I enter the IP address in the URL link you requested I get the following output:

{
“Body” : {
“Data” : {
“0” : {
“Current_AC_Phase_1” : 4.1790000000000003,
“Current_AC_Sum” : 4.1790000000000003,
“Details” : {
“Manufacturer” : “Fronius”,
“Model” : “Smart Meter 63A-1”,
“Serial” : “2xxxxxxx”
},
“Enable” : 1,
“EnergyReactive_VArAC_Phase_1_Consumed” : 12216970,
“EnergyReactive_VArAC_Phase_1_Produced” : 47856630,
“EnergyReactive_VArAC_Sum_Consumed” : 12216970,
“EnergyReactive_VArAC_Sum_Produced” : 47856630,
“EnergyReal_WAC_Minus_Absolute” : 12911235,
“EnergyReal_WAC_Phase_1_Consumed” : 5069201,
“EnergyReal_WAC_Phase_1_Produced” : 12911235,
“EnergyReal_WAC_Plus_Absolute” : 5069201,
“EnergyReal_WAC_Sum_Consumed” : 5069201,
“EnergyReal_WAC_Sum_Produced” : 12911235,
“Frequency_Phase_Average” : 50,
“Meter_Location_Current” : 0,
“PowerApparent_S_Phase_1” : 988.33000000000004,
“PowerApparent_S_Sum” : 988.33000000000004,
“PowerFactor_Phase_1” : 0.78000000000000003,
“PowerFactor_Sum” : 0.78000000000000003,
“PowerReactive_Q_Phase_1” : -504.64999999999998,
“PowerReactive_Q_Sum” : -504.64999999999998,
“PowerReal_P_Phase_1” : 780.28999999999996,
“PowerReal_P_Sum” : 780.28999999999996,
“TimeStamp” : 1644925657,
“Visible” : 1,
“Voltage_AC_Phase_1” : 236.5
}
}
},
“Head” : {
“RequestArguments” : {
“DeviceClass” : “Meter”,
“Scope” : “System”
},
“Status” : {
“Code” : 0,
“Reason” : “”,
“UserMessage” : “”
},
“Timestamp” : “2022-02-15T21:47:38+10:00”
}
}

If I do a ping -a 192.168.1.200 via cmd on my system I don’t get a hostname back but I can ping the unit fine. If I do an nslookup on the same IP address I get the following back: *** UnKnown can’t find 192.168.1.200: Non-existent domain

I also checked my Asus router that gives out IP addresses and it lists the device as “u-blox AG” but that does not allow me to ping that name

If I login to my inverter directly and goto “System information”
I see the following details:

Inverter
No Device type PMC Serial number
1 Fronius Primo 8.2-1 31191001154400485|4,071,334|1.4D_I|RECERBO|R| 3xxxxxxx
Meter
No Device type Location of the meter Serial number
1 Smart Meter 63A-1 Feed-in point (Primary meter) 2xxxxxxx

Essentially the serial number listed in the PHP output file starts with a ‘2’ as does the API link you posted however I’ve noticed this is the serial number of the Smart Meter and not the inverter (is that correct or could that be the issue possibly?) I could possibly manually enter the serial number starting with ‘3’ being the inverters in the PHP file and try again ?