Live upload of power is "skipping" every few iterations

Hi I am uploading data from an oldish aurora inverter using a python script that runs as a cron job every five minutes. the upoad is done by the python script constructing a curl command line and passing it to the sytem.

The srcipt is here:

It works fine for upload of the energy output, and some of the times for upload of the power to the live chart. However not every upload of power workssometimes for one and sometimes for two iterations the power is recorded as 0. The table below the update shows that the update is occuring every five minutes - but not adding the power value.
Any suggestions what is causing these intermittent zero power values in the live view

If the script is uploading energy (v1) and the value does not increase between intervals, then the calculated power value (green line) will be 0W.

Either increase the energy on each upload or send a power value (v2) to override the calculated power value.