Calculate total power usage

Ok I think I might be missing something. I thought this was going to be an easy information to surface this morning, but so far, I have failed to come up with a solution.
I have a smart plug from Tuya that reports power consumed right now. How can I turn this into reporting total power drawn from this plug over say 24h? I kinda assumed that it would be out of the box, but it’s not. And now not even sure if this can be implemented just via HA.

Here was discussed a similar question: https://community.home-assistant.io/t/2021-8-new-energy-feature-in-ha-conversion-from-w-to-kwh/328830
Maybe solution helps you, too.

Thank you. This at least gave a direction towards the solution, although I am still not sure how to correctly setup this. I’ll ask questions in that topic instead.