Tuya 2021 Smart Plugs & Energy Dashboard

Hi,

Did anyone succeed in getting Tuya Plugs consumption into the energy dashboard with the new “official” Tuya setup?

I used to have tuya local and that worked more or less (I could follow a Sum-Riemann integration in my energy dashboard, which was an ok approximation), but I was annoyed by the setup procedure (finding the id, the key, fixing the IP…)

So I moved to Tuya v2 in Hacs which was nicely integrated in the Energy Dashboard, but stopped working with the launch of the official integration (changes in API, servers on Tuya side)

So I installed the official integration: I see the consumption of my plugs, but they don’t appear in Energy Dashboard devices even though the entities look ok:

From my plug:

state_class: measurement
unit_of_measurement: W
friendly_name: Prise Four Power
device_class: power

And I even tried the Riemann trick:

state_class: total
source: sensor.prise_four_power
unit_of_measurement: kWh
friendly_name: total_consumption_prise_four
icon: mdi:chart-histogram
device_class: energy

Any idea?

you need the sensor to be the following:

  - platform: integration
    source: sensor.ty16005218c4dd572f4c50_2
    name: Plug - office - ups_power_K
    unit_prefix: k
    round: 2
    method: left

It’s what I had done (“the Riemann trick”) without any luck:

  - platform: integration
    source: sensor.prise_four_power
    name: total_consumption_prise_four
    method: left
    unit_prefix: k
    unit_time: h
    round: 2

there is something odd going on with tuya - as i too now have the same issue. Where my states arent actually increasing - i think there maybe an issue with tuya sending updates to HA. i have seen comment on this issue on another thread - i will keep digging