Tuya devices with engery monitoring not showing in engery dashboard

I could be entirely missing something something but none of the devices running through tuya that have energy monitoring show in the energy dashboard.

Sonoff lan devices dont either but that’s less surprising.

All devices otherwise work and energy monitoring shows in home assistant fine and work with automatons without issue.

Is this a know issue or did i make a mistake?

Since i am awaiting eye surgery me screwing up would not be surprising lol.

In general, you can only select entities for the energy dashboard that have defined a state_class attribute.

Are you using the Local Tuya integration for your devices? If so, there is a known limitation where the state_class is not set for any sensors: https://github.com/rospogrigio/localtuya/issues/536

Have you added those devices to the energy dashboard settings? I found this didn’t happen automatically for me when I added energy monitoring plugs to HA.

Settings → Dashboards → Energy → Then on the far right there is a section for Individual devices where you add the various power monitoing devices for them to appear in the Energy dashboard.

The fact that they measure does not mean they show the correct data for the board, see above earlier comment.
Try adding something like this which uses the state of the other sensor having consumption in it.

  - platform: integration
    source: sensor.gosund_1_consumption
    name: powerplug_gaming_ha
    method: left
    round: 2
    unit_prefix: k

Note: I also had to add the other/consumption sensor as the value was in attribute so device > sensor-consumption > sensor statistics

  - platform: template
    sensors:
      gosund_1_consumption:
        friendly_name: "GosundPlug1 current consumption"
        unit_of_measurement: 'W'
        device_class: power
        value_template: "{{ states.switch.gosundplug1.attributes.current_consumption }}"

Not using local tuya.
Strangly it would never work for me and kept giving a error that it cant be setup by the UI.

Dkarson devices aren’t added automatically you have to select them which is part of the energy dashboard setup.
The problem is that they dont show in the list so can not be added.

All feed back welcome though.

Vingerha i suspected i may have to add things manually.
Normally not a big deal but a much bigger pain in the but when it takes me 10 just to type this.

Thanks for the examples all be adding the plugs tom and finding out how many typing mistakes i can make doing so.

Thanks for all the help and input guys.

Working now and i only made about 20 spelling mistakes lol.

Great… Please mark a solution then

This doesn’t work for me at all - no matter what I do it seems.

I’ve added the latest Tuya plug-in (I’ve also tried tuya local (I gave up on that)) I’ve got 4 smart plugs that cannot be flashed to tasmota. I’ve got about 20 that are flashed and they are great!

So the Tuya plug; using the Tuya native plugin, brings the device into HA. If I click on the device I can then enable the “Current”, “Power” and “Voltage” sensors.
This, as we know, doesn’t allow them to be added into the energy dashboard (I still don’t understand why, when the data is there…)

I’ve then added, using this thread, the following to my configuration.yaml

  - platform: integration
    source: sensor.smart_plug_power
    name: TUYASmart1
    unit_prefix: k
    round: 2
  - platform: template
    sensors:
      smart_plug_power:
        friendly_name: "TUYASmart1 Current Consumption"
        unit_of_measurement: 'W'
        device_class: power
        value_template: "{{ states.switch.smart_plug_socket_1.attributes.current_consumption }}"

I’ve then rebooted and still nothing in the energy dashboard… Where am I going wrong!?

Hello did you got this working if yes how , I have the same problem I have 5 tuya Plugs wich show me energy consumption in the app , but I m not able to add them to the energy dashboard in HAS…
I need some step by step help if possible…

Hello,
I had the same issue with an energy meter PC311.
I’m using Local Tuya (GitHub - rospogrigio/localtuya: local handling for Tuya devices).
To have the sensors in the energy dashboard, you just need to add the following to configuration.yaml.

homeassistant:
 name: Home
 unit_system: metric
  # etc

 customize:
  sensor.dp_forward_energy_total:
    state_class: total_increasing
  sensor.dp_forward_energy_circuit_1:
    state_class: total_increasing
  sensor.dp_forward_energy_circuit_2:
    state_class: total_increasing

Home Assistant tracks the min, max and mean value during the statistics period. The state_class property must be set to measurement , and the device_class must not be either of energy , gas , or monetary

With regards to this, I have a similar situation with the Energy Meters in My Office.
Office Total is a Kasa HS110, while Front Office is an Aussie Arlec Switch based on the Tuya Platform.
I have mine running under LocalTuya, with an Integration Helper to derive kWh’s.
Obviously the LocalTuya device does not have the required state_class to use it in the Statistical Graphs.

Looking at both devices in the Developer Tools it would appear as though I could add the required state there by adding an State_class: measurement there as per the Kasa device.

Is this correct or is it not that simple given other information I’ve read around the place.

The States for my two different devices.

Thanks

Phil.