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.
18 - current mA
19 - power W
20 - voltage V (1 decimal)
23 - total kWh (0.0ā¦)
25 - today kWh (0.0ā¦)
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
can u share your yamls for that?
Hi, How do you retrieve IDs 23 and 25 using localtuya?
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:
Thanks in advance
Best Regards
That was actually super helpful my friend!
these 23 and 25 are not total kWh and today kWh, 22-25 are calibration coefficients Function Definition-Tuya IoT Development Platform-Tuya Developer
Exactly same happened here.
Took some time to find out
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
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.