johnf / pvoutput

PVoutput API for Ruby
MIT License
1 stars 1 forks source link

POST of generation data via add_batch_output results in consumption data being zeroed #8

Closed degerrit closed 6 years ago

degerrit commented 6 years ago

Hi, I recently started using https://github.com/jwillemsen/saj_collector to post generation data to pvoutput.org using your library. In parallel, pvoutput is still fetching my consumption data from flukso.net (Automatic Uploads) - this has been working well for years.

Now the odd thing is, since I started uploading my generation data, my day-totals for consumption are being zeroed out.

Here's the relevant snippet:

options.each do |date, values|
  puts "Energy generated #{date}: #{values[:energy_generated]} Wh"
end

pvoutput.add_batch_output(options)

Not being a ruby programmer :-) - using tcpdump, I've determined a POST to /service/r2/addbatchoutput.jsp being made, looks like this (condensed & newlines added for readability):

data=20171201,0,,,,,,,,,,,; ;20171226,3200,,,,,,,,,,,; 20171227

I guess a workaround may be to eliminate completely the empty data fields (untested), but I guess the real issue is the API assuming empty fields are equal to 0? Tested -> does not work

Or should I post this bug to the PVOutput forum @ https://forum.pvoutput.org/c/api ? Thanks

degerrit commented 6 years ago

I will post a bug to PVOutput forum, will close issue myself ;-)

degerrit commented 6 years ago

https://forum.pvoutput.org/t/api-post-addbatchoutput-of-generation-data-results-in-consumption-data-automatic-upload-being-zeroed/386