Program for measurement on solar cell

Hi All,
I need to know how many Ah the solar system delivered to the battery in last 24h. System from solar unit send data (voltage on battery and current to battery) to mqtt every 10m. So i need make program, whitch make averange value from current in the last 24h, and send back to mqtt.

Can someone help me with this program?

Thank !

I would do this by sending all the data to Influxdb and then you can run a query to get the 24 hour total, or anything else you need.
However, you might not want to that length if you don't use influxdb.

I use postgresql, all data are saved also in database...

What is U?

I need calculate capacity (Ah)... Understand me ?

You don't need the voltage for Ah, just the current and time.

Yes, sry my mistake.... Just make averange value from current data in last 24h.

I presume that postgress will do SUM and COUNT, so then you just have to do the divide in node red.