OK, for anybody interested, I have the solution!! It has taken a while since I’ve been busy, but it’s quite simple:
shell_command:
pvoutputcurl: 'curl -d "d={{now().strftime("%Y%m%d")}}" -d "t={{now().strftime("%H:%M")}}" -d "v4={{states.sensor.studioforpvoutput_mean.state|round(0)}}" -H "X-Pvoutput-Apikey: apikeygoeshere" -H "X-Pvoutput-SystemId: idgoeshere" https://pvoutput.org/service/r2/addstatus.jsp'
(the sensor mean has a max age of 5 minutes of realtime readings)
And then run an automation:
- alias: UploadPvoutput
hide_entity: False
trigger:
platform: time
minutes: '/5'
seconds: 00
action:
service: shell_command.pvoutputcurl
In the above example I am uploading “v4”. but you can do whatever you want as per the documentation: