Configure Gosund Consumer for Energy Dashboard

Hello,

I have 5 smart plugs, all of them added via Tuya, 4 of them are Nous, one Gosund.
To get them to appear in the consumers section of Energy I created helpers with Riemann sum integral sensor.

My problem is that Gosund values are x10, which is not what one would want since it would mess the energy tab.

To try to workaround this I have created custom sensors that divide by ten, the power one being:

    gosund_power:
      friendly_name: Gosund Power
      unit_of_measurement: W
      value_template: >-
        {{ (states('sensor.prizagen_power') | float / 10) | round(2) }}
      icon_template: mdi:power-socket

Now, if I create a helper from my custom sensor, even if it does have the right value, does not appear in the Energy Dash to be added.

Anyway how to fix the Gosund values?

Hey, I’m really new to Home Assistant, so take it with a grain of salt… But I also tried to integrate energy tracking for Gosund WiFi sockets (EP2), via Riemann sum and custom sensors that divide by 10. And it works fine on my side (at least I could add the corresponding energy sensors to the energy dashboard).

I wonder if your custom sensor definition misses state_class: measurement or device_class: power, that probably have effect on availability of the derived sensor in energy monitoring.

Here’s an example of my setup for the custom sensor (that divides by 10) (bear in mind that it uses “modern” way to configure the sensors):

- name: Attic Power
  device_class: power
  state_class: measurement
  unique_id: sensor.template.attic_power.scaled
  state: "{{ (states('sensor.attic_power') | int(0) / 10) }}"
  unit_of_measurement: 'W'

hi,

thanks for the reply

device_class: power did the trick.
state_class: measurement resulted in an invalid config file