Only small amount of data is being transferred

Hi, I am using an ESP8266 with 2 S[0] meters however it appears it is primarily loading no blank data and occasionally loading some data (unsure if accurate though in those time periods it does record some data. Hoping someone may be able to shed some light on where I need to look.

My setup is as follows

Wiring -
S[0] House Consumption Meter to pin D5 (screw terminal)
S[0] Solar Generation Meter to pin D6 (screw terminal)
Signal Wire from both are interconnected and then connected to Gnd pin (screw terminal)

my PVoutput URL is Here

A copy of my code is available Here

I have attached a copy of my code as it stands. As you will see it appears that it is connecting and transmitting some details at some times but other times it is connecting and sending zero usage.

Any tips as to where I should start to investigate further would be appreciated. I have tried replacing wires between the S[0] meters and the ESP, replacing the ESP with another one, and have continued to have very intermittent transferring of data.

Hopeful I may have worked out my own problem. I was uploading V1 & V3 data points and have tried changing to just V2 and V4 and having the ESP calculate average power and send those figures instead. Only been working for a short time but some tests I did last night were also successful using this method.

Don’t really understand why I couldn’t use the V1 & V3 and upload the watt hours but suspect it may be that I was resetting the totals to zero on each upload so that each 5 minutes would contain the data just for that 5 minute period instead of the Total for that particular day or Total since the ESP had been booted as of that time.