I found the problem in the gw2pvo python script. He was trying to perform a correction to the 5 min total power generated for the day, but the factor he was using was causing errors in the power generated to that point which was messing with the average power reading and leading to incorrect total power for the day. First I removed the factor which means that the total energy was calculated as if the entire 5mins of generation was based on the reading at the end of that 5 minutes. This let to much more accurate numbers for total power generated. However I believe the better thing to do is to take an average between the current 5 min reading and the last 5 min reading and base the power for that 5 minutes on the average. I modified the gw_api.py file as follows (in the getDayReadings function):
eday_kwh = 0
#added last_sample to keep track of the prior reading
last_sample = 0
for sample in data['pacs']:
date += timedelta(minutes=sample['minutes'])
pgrid_w = sample['pac']
#Changed the increase to be the average of the current and last sample multiplied by the 5 minute time period and unit conversion factors
increase = abs(pgrid_w + last_sample)/2 * sample['minutes'] / 1000 / 60
if increase > 0:
#removed the factor from the eday_kwh increment
eday_kwh += increase
entries.append({
'dt' : date,
'pgrid_w': pgrid_w,
'eday_kwh': round(eday_kwh, 3)
})
#record the current reading to be the last reading for the next iteration
last_sample = pgrid_w
result['entries'] = entries
I think this should be accurate enough for me. Thanks for your help.