Getting EV charge from KW to kWh?

Hi

I would like to get an idea about the cost of charging my EV - but have some issues trying to figure out how to do it…
I have a HomeWizard plug in my electricity meter, so I can see the total consumption for my home - but no data for the isolated consumption for the “house” nor the EV charger… But I have a Charge Power sensor (in KW with a single decimal - not watts) from the integration towards the car …

So - my plan was to have a template sensor, that would return the value of the car charge power sensor - if the total consumption for the house is over 5KW, and the number from the car charge power is higher than 0 (and not unavailable).
I guess this template sensor then should be used for a riemann calculator/integration - to get from KW to kWh …
After this, I assume, that I can add the utility meters, pricing template etc…
But how do I build the template sensor - and get the riemann stuff done correctly ?