I‘m reading my power meter with the Volkszähler integration, which delivers me the actual total energy consumption in kWh. How can I create a sensor to calculate the theoretical power consumption in kW?
I understand how to calculate it with a mathematical function, but don’t know how to realize this in Home Assistant.
The math part:
Power= (TotalEnergyNOW - TotalEnergyLASTSTATE) * 3600 / (time in secs between states)
To get from energy to power you have to differentiate with respect to time ( 𝛿E/𝛿t, essentially your formula with very small time steps). There’s a sensor for that:
Give it your energy sensor and it will give you instantaneous power at the times your energy sensor updates.