Hi community, I am trying to calculate my energy consumption with my sockets from Localtuya integration.
Tuya outputs the power in W. This I convert with the Riemann sum integral helper in kWh. The configuration looks like this:
Since I created the sensor via the user interface, I can’t insert the yaml code
unique_id: socket_kwh
name: socket kWh
source: socket_w
unit_prefix: k
unit_time: h
method: trapezoidal
round: 2
Then I created a unity_meter sensor: socket_kwh as input sensor.
With this configuration I get in Home Assistant a value of 0,34 kWh in the Tuya will be 0,19 kWh. What am I doing wrong?