Hi bankstownbloke
I found a solution but I am not sure why. If I use POST rather than GET it works. I suspect it has something to do the requests library and the difference between how the GET and POST requests are handled. It appears that the GET is not sending the parameters as expected by the API. Not sure it you process the GET and POST calls the same.
Another issue I am seeing now is that there is a difference between sending daily updates using the web page Add Output CSV Loader function with the following data sample
9/04/2021,36449.08333,22548.25,13079.16667
This represents DATE,GENERATED,EXPORTED,USED
When I do the same using python as a POST
url = 'https://pvoutput.org/service/r2/addoutput.jsp'
headers = {
'X-Pvoutput-SystemId': ID,
'X-Pvoutput-Apikey': API
}
params = {
'd': DATE,
'g': GENERATION,
'e': EXPORT,
'c': CONSUMPTION
}
resp = requests.post(url, headers=headers, data=params, timeout=10)
The difference is that when I do it via the website the $ balance for the day is updated but when I do it via the POST it is not. I want it to update.
I was thinking to using the curl command and send it via a subprocess call to see if it makes a difference.
Any ideas with this one?
Thanks David