Creating a script or something for power monitoring

Hi there

I have some smart plugs that monitor power but unfortunately day consumption is done in the app.

is there a script or something i can create that takes a reading every second and adds it together and after taking 3600 samples works out the total used in a hour and adds it to the daily total and saves and records it and resets at midnight? (i know the maths part for this)

also be able to use the data from the plugs in the energy monitor?

still a bit new at HA so please be gentle

regards
Jeremy

Have you looked at Power Calc from HACS?

no didnt know it existed. i’ll check it out thanks.

If you can get the sensors into home assistant, the energy is automatically calculated on the energy page. No need for custom integrations.