I had thought that there might be problems with Internet outages. I have a robust and fast Internet connection but there is always the chance of an outage or maybe PVOutput is taken down for maintenance.
I also have a SMA inverter and use SBFspot (https://github.com/SBFspot/SBFspot/wiki) to upload the data to PVOutput. SBFSpot writes the inverter data to a SQLite database and then a second program uploads the data from the database to PVOutput. If the upload isn’t successful then it keeps retrying until it succeeds and this works very well. I had thought that I might try something similar with your code although I’d have to learn quite a lot of new stuff so it would take some time.
To test this, do you know if I could have two programs querying the inverter at the same time without messing things up? If this is possible I’d leave your original script running and develop the part that writes the data to the database first. I could then test that was running ok before developing the database to PVOutput upload part.
Any thoughts?
Bob.