Virtual Device Calculation from W to kWh

Hello,

i wanted to impliment a counter for my fridge, microwave and so on. I cant connect a smart-plugin behind my fridge/microwave (to less space).

I created a number helper “input_number.sonstige_watt” with the value “20” (Power: 20 W).
Now i need a counter to calculate the “kWh”. But no plan how i do that.
I found someone who has a real counter for Power, but that dont work for me. Link

I tried this:

- platform: integration
   source: input_number.sonstige_watt
   name: sonstige_verbrauch
   unit_prefix: k
   unit_time: h
   round: 2
   # method: left

But only get this:

Need some help…

You should be able to do what you want with this:

I think the problem is that “input_number.sonstige_watt” is an string and not an int. How can set it in line “source:” to int ?