That’s doable, also with Tuya. Problem is just that the Tuya integration does not deliver the cumulated power consumption, but only the momentary power, current and voltage. Luckily, this can easily be added using the “Integration - Riemann-Summen…” integration (sorry, all in German in my case):
In the next step you select the “Power” sensor of the socket, give it a name and some optional parameters:
And there you go - it’s showing up in the list of devices in the Energy Dashboard configuration:
Note that in my case I found that for my Tuya-based sockets the ootb values for voltage and power have some scaling issues (factor 0.1), which is why I created an additional “…_leistung” sensor that fixes this. If you need this correction, too, add something like this to your configuration.yaml:
template:
- sensor:
- name: 3D Drucker Leistung
state: >
{{ states('sensor.3d_drucker_power')|float(0) * 0.1 }}
unit_of_measurement: W
device_class: power
icon: mdi:flash
- sensor:
- name: 3D Drucker Spannung
state: >
{{ states('sensor.3d_drucker_voltage')|float(0) * 0.1 }}
unit_of_measurement: V
device_class: current
icon: mdi:sine-wave
Hope that helps