Teckin sp22 total consumption like Shelly

So far I have been using Shelly as a smart socket. In the Shelly integration, I always get the kwh displayed directly as a sensor.

sensor.shelly_energy
state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: Shelly- energy

There is no such thing for the Teckin sp22 smart socket, I “only” get the mA(current) and W(current_consumption) as sensors.
How can I rebuild such a sensor in order to have the complete consumption?

My try was, but not working:

      - name: "teckin_energy"
        state: '{{ states("sensor.switch_teckin_watt") | float }}'
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing

Anyone have an idea?

I will try Riemann left, maybe this works.

Works!