Have a look here Powercalc - Virtual power sensors - Share your Projects! / Custom Integrations - Home Assistant Community (home-assistant.io)