Sensors adding up to total

Hi, I do have a Modbus connection to my Photovoltaik Installation. It shows me the current amount of produced energy, etc. however I would like to calculate the daily, monthly, yearly totals.
Anyone any idea how to do this-