Added Tuya smart plugs - where is the energy monitoring?

my question: is the data saved in the HA database and is it about to fill my device disk or download data from the tuya cloud?
at the beginning i had 0 now growing

For those who are still not able to pull in the power usage metrics with the standard Tuya integration, have a look at Local Tuya (where you are able to monitor your devices locally instead of over the cloud) plus it has the added benefit of configuring the state_attr (consumption, voltage, current) - GitHub - rospogrigio/localtuya: local handling for Tuya devices

Here is a screenshot where I hooked up my Connex Connect Smart plug (installed and added with the Tuya app on iOS)

I hope this helps someone.

I have just set up 9 of these power monitoring plugs from different manufacturers on Local Tuya, and all plugs are based on Tuya protocol 3.3.

When configuring the plug initially in the Local Tuya Integration, note that the switched socket is listed as ā€˜switchā€™, and then the other entities for Current, Power and Voltage are noted as ā€˜sensorā€™. When choosing which attribute to assign from a drop-down list taken directly from the type of plugā€¦ (in my case there were numerous items, with a value noted afterwards) which was very confusing at first, but I came to the conclusion after doing the first two that the items in the list correspond to different figures produced by the plug i.e. kWh, total kWh, current, voltage etc

Based on Tuya protocol 3.3, they were:-

  • 18 = power
  • 19 = current
  • 20 = voltage

The list of attributes from the plug extended well into the 20ā€™s with some much longer figures after the item number - I suspect these are kWh, and Total kWh figures calculated by the plugs - but I may be wrong. I didnā€™t get as far as including these as entities (I presumed that HA could calculate these if needed) so couldnā€™t compare to the Tuya phone app.

I hope this helps somebody when installing their own power monitoring plugs. :+1:t2:

5 Likes

18 - current mA
19 - power W
20 - voltage V (1 decimal)
23 - total kWh (0.0ā€¦)
25 - today kWh (0.0ā€¦)

8 Likes

same situation here.

Iā€™m using S-Link SWAPP SL-03 model smart plugs which has power meter function and I can monitor power consumption on Tuya app, (and also in Tuya IOT platform as logs too) but canā€™t see any entity in Home Assistant even if itā€™s disabled.

Is there any option that I can do or did you find any solution?

Even I couldnā€™t find those sensors with local tuya custom integration too :frowning:

finally made it by this part:

1 Like

can u share your yamls for that?

Hi, How do you retrieve IDs 23 and 25 using localtuya?

@Muddy_Boots is this the way i need to fill it in?

because when I enter it like this I get the message not plugged in.

Apologies for the delay. I note you have selected ā€˜binary sensorā€™ for this entity, it should be just ā€˜sensorā€™ - a binary sensor is used for a switch which is just on or off (as I understand it) and will require different values.

Hello everyone, Iā€™ve a similar problem with my tuya device:
WiFi Din Rail Switch with metering (jdj6ccklup7btq3a)

Iā€™ve already searched for a disabled entity but is all enabled, so the ā€œfamilyā€ dlq is the same of another tuya device that works fine, so I donā€™t understand where is the problem why I canā€™t see any power metering from this device?

In tuya developer page Iā€™ve found this parameters:

cur_current Integer
{
ā€œunitā€: ā€œmAā€,
ā€œminā€: 0,
ā€œmaxā€: 100000,
ā€œscaleā€: 0,
ā€œstepā€: 1
}
cur_power Integer
{
ā€œunitā€: ā€œWā€,
ā€œminā€: 0,
ā€œmaxā€: 99999,
ā€œscaleā€: 1,
ā€œstepā€: 1
}
cur_voltage Integer
{
ā€œunitā€: ā€œVā€,
ā€œminā€: 0,
ā€œmaxā€: 5000,
ā€œscaleā€: 1,
ā€œstepā€: 1
}

Are they correct to work fine in HA tuya integration?

This is the device page on HA:
image

Thanks in advance
Best Regards

That was actually super helpful my friend!

1 Like

these 23 and 25 are not total kWh and today kWh, 22-25 are calibration coefficients Function Definition-Tuya IoT Development Platform-Tuya Developer


2 Likes

Exactly same happened here.
Took some time to find out :slight_smile:

Hallo Luca, did you manage to solve this?

Hello everyone,
Iā€™m currently developing a custom_component to do just that ā€¦

Itā€™s working for my tuya devices so if you want to use it you can find the code here:
https://github.com/azerty9971/xtend_tuya

The README details the installation steps.

Hopes this helps!

Azerty9971

11 Likes

Thanks for the integration and help. Are the energy data you get in HA the same as in the tuya mobile app?

Hey, thanks a million for this. Having waisted a couple of hours trying to flash some unflashable smart plugs I found this thread and downloaded your patch.

Itā€™s working great at the moment.