Get daily energy from a power sensor

Is this in esphome ? Total Daily Energy Sensor is an esphome integration

If not, use this:

or install this, and it does it all for you: