Getting total kWh from Tuya devices

Hi there! I have bought the following smart power strip: It works very well and features energy meter.

It was added pretty easily to local tuya, however, I cannot figure out which entity is responsible for the total energy consumed in kWh. After some reading, my understanding is that there is no such Energy entity to begin with an the device calculates the total energy consumed using vltage, current and some coefficients.

Did I understand the way it works correctly? If yes, how can I reproduce it in HA so I can get the total kWh?

Thanks in advance!

I didn’t see any data point on the physical device holding total kwh, i am assuming that it is stored on their cloud.

I usually read instant w value, set integral integration to convert it to kwh.

In Device Debug menu on Tuya IOT website, there is indeed no total kWh value. Form the logs, it is clear that DP with ID 17 - Add electricity is used to calculate the total energy used. However, strangely in local tuya integration there is no such DP available for choosing.

Is the integral integration accurate in its calculations?

Home assistant should be up and running all the time and device should report values almost every second to make it fully correct. For me, there is 2% to 5% difference between home assistant and tuya itself. (Home assistant is less than tuya)

So, you will lose the correctness of data, when;

  • you are restarting home assistant or interrupting it
  • tuya devices have wifi connection issues and entities are unavailable
  • device doesn’t update instant values on maximum interval rather less frequently.

Integral integration is trying to calculate the total values using the reported values, so you should expect some difference even it is reported every second and there is no downtime in home assistant.

I see, thank you for the information!