Individual device monitoring value totally off

Hi fellow HA users,

I tried to add several Smart Plug devices (Tuya) to HA for Individual device monitoring. But de value of one smart plug is so off, I do not understand why. Let me explain showing some pictures:

I Added this to my sensors.yaml

- platform: integration
  source: sensor.pc_zolder_power
  name: "energy pc zolder"
  unit_prefix: k
  round: 2

- platform: integration
  source: sensor.pc_woonkamer_power
  name: "energy pc woonkamer"
  unit_prefix: k
  round: 2

- platform: integration
  source: sensor.wasmachine_power
  name: "energy wasmachine"
  unit_prefix: k
  round: 2

- platform: integration
  source: sensor.koffiemachine_power
  name: "energy koffiemachine"
  unit_prefix: k
  round: 2

It is all about the last one ‘energy koffiemachine’.

When looking in the Tuya App it represents on the 2nd of november the following usage:

This is 0.14kWatt or 140Watt.

HA is telling something totally different:

image

Almost 4000Watt !!

Looking at the usage history:

Somehow at about 05:46 the usage goes from 20.14kWh to 23.39kWh !! This isn’t even possible. But it explains the large usage.

The highest value this day is 24,06kWh. So also when it goes from 23.39kWh to 24.06kWh it is a usage from 0.67kWatt = 670Watt. This still does not correspond to the 140Watts the app displays.

The other sensors are also a bit off. But that’s only a few Watts. Not thousands.

I’m a bit lost here.
Someone who does have an explanation?

Can you check the “total” kwh consumed in the Tuya app to see if the numbers corresponds with the value in HA?

If HA was not able to gather information from the device in a couple of days (hours), and then reconnected at 05:46 the graph might look like yours does.

RED= no data is received/collected by HA, graph is flat Check previous days if they contain data.
GREEN= HA gets updated value for the last X days/hours
BLUE = Normal operation where HA receives updates when value has changes?

I’m using the plug for a few days now. This is the whole graph:

Total usage by the app:

The plugs are always on and connected to HA.

I now also monitor the sensor.koffiemachine_power:

image

Likely the problem is the power-spike the device produces. This will added to the “energy koffiemachine” entity. Can this be prevented?

Because the values keep showing large differences compared to the ‘real’ Tuya-app usage values, I created new entities. This time via the Helpers page.
A big change was the Integration Method. Now I use the “left” setting. It looks like the values are now (almost) the same as they are shown in the Tuya App. This difference is negligible.

For those who are also having problems generating a kWh energy sensor with (Tuya) power meters and power output, this is how I setup the " Riemann sum integral sensor".

Comparison Tuya App and HA (today’s usage):