Ok, I see I read your first email wrong.
Let me start again. There are two ways you can create the increasing kWh-sensor you are looking for.
-
Integrate the values of a sensor with the measurement unit = W, see this post Plugwise core and custom_component - #91 by bouwew
-
Create a kWh sensor from the Wh sensor, as you tried to do originally, and then create yet another sensor that adds the values: add the new Wh-value to the sum of the previous Wh-values, every time a new hourly value is provided. This will give you the increasing kWh sensor that you need for HA Energy.