Tuya device consumption costs on energy dashboard


I have some sockets connected using Tuya that provide me real metrics for power, current and voltage.

I have tried to use Powercalc to read the power from the sensor and create the energy graph but seems not working.

I have seen a lot of people using manual configs to convert W to kW but I didn’t find anything that works properly and match with real consumption values reported by Smart Life app on iPhone.

Is there anyone facing the same problem or can suggest how to sort this implementation?

Thanks in advance.

The two options are:

Powercalc using your socket’s power sensor to calculate energy: Real power sensor — Powercalc documentation

I don’t know what method that 3rd party integration uses to estimate energy from power or how accurate it is.

Or feeding your power sensor to the Riemann Sum integration to calculate energy: Integration - Riemann sum integral - Home Assistant

The biggest source of error for the Riemann Sum integration is not selecting the correct method. Usually this should be set to method: left unless you have very smoothly varying power levels, then the default trapezoidal method will have less error. Nine times out of ten for on/off sockets left is the best method with the smallest amount of error. But it is still an approximate integral and the faster your socket power sensor updates the less error you will have.

Thanks @tom_l . I use Powercalc for some sockets but for Tuya doesn’t work properly, I don’t know why. When I check the graph, there is no data on energy: