Day and night energy totals (ideas wanted)

I’m thinking of purchasing a grid connect solar system with battery. To help size this it would be advantageous if I could collect my energy used during the day and night separately. For a year.

I have a whole house daily energy used sensor, sensor.total_energy. I could use input numbers to store the value from this at sunrise, sunset and just before midnight (when it resets to 0). Then calculate the day and night totals at midnight with an automation and send them to telegram. I could use these messages to keep track of the values in a spreadsheet.

Unless anyone can think of a better way of doing this?

Straight into google sheets perhaps?

I’m using Hassio so this addon looked promising until I saw the issues and the fact that the repository has not been updated for 2 years.

Why not use a simple csv file?

That would seem to be a whole heap easier. Thanks.