Converting Time to kWh

Hello Everyone!

I have a Nibe heating system that uses a compressor for heating. The HACS integration gives me a two values for how the compressor is being used in hours. The first one is a total run time “compressor operating time” and one “compressor operating time hot water” which is the time spent on hot water.
I know that the compressor uses about 1 kW runtime so I wish to convert the time values in to kWh to then use it in the energy dashboard. Icing on the cake would be to also calculate how much was used for heating and hot water by subtracting hot water from the total.
Been trying to get it working but I can’t manage, it seems that either the energy don’t want to pick it up or the sensor changes back to a time value after I change it to kWh via the developer tools.

Anyone who tried anything similar and got it working? Could not find any threads about it.

Thanks!

1 kW running for one hour = 1 kWh
Pretty simple really. Evey hour your 1 kW load runs consumes 1 kWh

You can easily create a template power sensor which will return the rated power consumption when the device is on and 0 when it is off (or some other device in case it consumes something in standby mode) and then use an integration helper to create an energy sensor from that.

Or you can use Powercalc, which kind of do this all for you: