Open Moridium opened 2 years ago
tuya documentation tuya source (message by IssueLinks)
Hey there @tuya, @zlinoliver, @metisu, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
Hi @Moridium , I just can confirm this is the case for original issue too (11.3 W SmartLife vs 114W HA) ;)
Do you take voltage from some kind of endpoint or sth? + What class of device do you have? (socket, switch)?
Hi @OldShaterhan
Thank you for confirming that the issues seam to be related.
Im using a smartplug
This is the latest log from the device:
Add Electricity seam not to be implemented in the integration though, im trying to use power as a workaround.
I wonder why in your case voltage is probably correct and in my case both voltage and power are 10x greater. Could you confirm if your current level seems to be fine?
I think this is Tuya API related, but I'm not that deep and I'm not sure...
Hi Yes my current seams to be ok This is my latest log and screenshot from HA Voltage hasn't changed, so didn't copy that again.
Btw. when you noticed that value got broken? I have my values (voltage, current, power) entities enabled since yesterday (earlier it was disabled by default by integration and I found it mainly due that.
I noticed this sometime around start of December, the energy prices exploded so i needed to analyse where the consumption where. I therefore bought these plugs on amazon, since they had lots of comments on working with HA. The Tuya app can present me with the values and since i'm new to HA i didn't know where to report it and i thought that this probably already was a known issue so i decided that i could wait till it got implemented in HA.
It seems potentially to be related to sth mentioned in Local Tuya: https://github.com/rospogrigio/localtuya#energy-monitoring-values . Also I tried to contact Tuya support, they suggest it works as intended... Not sure how this could be dealt.
From version 2022.2 onwards you will have a diagnostic tool that will provide you with the data needed to find the answer to this problem. Please, when you update your version can you export this information from your device (by going to the device and clicking the download diagnostics button) and post it here?
I have the same problem with one of my wall plugs.
This is the dignostics of a problematic device (shows ~1600W instead of ~160W)
Note that in the status field of the problematic device, both power and voltagage is multiplied by 10. But in the entity state, voltage is correct, but power is still x10,
This is the dignostics of a device that's working correctly (shows ~1200W which is correct)
Same issue here with Voltage & Current correct and Power displayed by factor of 10 out. Workaround is to use a template to divide power by 10, but would be nice to get correct scaling factor applied in the integration.
Relevant snips from diagnostics:
"status": {
"switch_1": true,
"switch_2": false,
"countdown_1": 0,
"countdown_2": 0,
"add_ele": 201,
"cur_current": 5466,
"cur_power": 11374,
"cur_voltage": 2396,
"test_bit": 2,
"voltage_coe": 0,
"electric_coe": 0,
"power_coe": 0,
"electricity_coe": 0,
"relay_status": "power_on",
"child_lock": false
}
Voltage & Current are scaled correctly, Power isn't scaled correctly
"home_assistant": {
...
"state": {
"entity_id": "sensor.6294ha_power",
"state": "11374.0",
...
"entity_id": "sensor.pool_current",
"state": "5.466",
...
"entity_id": "sensor.pool_voltage",
"state": "239.6",
Downloaded Diagnostic:
tuya-5f8e2d0c07ac2fa0e27008deadf407ac-6294HA-d812826aeed3155a16f834ec0142ab35.json.txt
Here is the upstream issue:
under status_range:
"status_range": {
...
"cur_current": {
"type": "Integer",
"value": {
"unit": "mA",
"min": 0,
"max": 30000,
"scale": 0,
"step": 1
}
},
"cur_power": {
"type": "Integer",
"value": {
"unit": "W",
"min": 0,
"max": 50000,
"scale": 0,
"step": 1
}
},
"cur_voltage": {
"type": "Integer",
"value": {
"unit": "V",
"min": 0,
"max": 5000,
"scale": 1,
"step": 1
}
},
How do we escalate upstream?
tuya-5f8e2d0c07ac2fa0e27008deadf407ac-6294HA-d812826aeed3155a16f834ec0142ab35.json.txt
How do we escalate upstream?
You can file a support ticket in the Tuya IoT environment=.
or, you guys could use the localtuya interface to change your scaling-factor, i.e 1 means 0.1 , if it don't apply for your device, find the right one by "tryNerror" ... if the "scaling-factor" in localtuya-integration don't work , you got a device-problem, i have 1 Tuya , 1 Deltaco and about 8 Nedis devices( linked to local-tuya, well not all with "sensors" but finding the right scaling-factor wasn't hard, though don't rely on tuya's "device specifications", if DP-17 addele, says "scale 3" you might find it showing right with scaling-factor 1 (not 0.1) most( if not all) most devices that telling you "scale 1" try 0.1 ... figure it out don't ask my why ... so as another asked above " it would be nice with the correct scaling factor" ... there seems to be no such thing, it's a device/manufacture thing it seems ... And when you find it showing "almost right" take a look at DP-22, 23, 24, 25 and 26
My diagnostics (I removed some custom components): tuya-db1ef1a689c9a3ea17cd7938838a9774-Pralka-689f12cd0c7964d3615b804d22693755.json.txt
or, you guys could use the localtuya interface to change your scaling-factor, i.e 1 means 0.1 , if it don't apply for your device, find the right one by "tryNerror" ... if the "scaling-factor" in localtuya-integration don't work , you got a device-problem, i have 1 Tuya , 1 Deltaco and about 8 Nedis devices( linked to local-tuya, well not all with "sensors" but finding the right scaling-factor wasn't hard, though don't rely on tuya's "device specifications", if DP-17 addele, says "scale 3" you might find it showing right with scaling-factor 1 (not 0.1) most( if not all) most devices that telling you "scale 1" try 0.1 ... figure it out don't ask my why ... so as another asked above " it would be nice with the correct scaling factor" ... there seems to be no such thing, it's a device/manufacture thing it seems ... And when you find it showing "almost right" take a look at DP-22, 23, 24, 25 and 26
@boheme61 I think it should be doable to have such possibility in the official integration, while this is a part of HA. I use localtuya but I don't find this is an issue.
@purcell-lab what do you mean as escalating upstream?
I was in contact with Tuya support, but contact with them didn't provide any senseful result:
if you are referring to official Tuya-integration, you might want to configure(set scaling) for your devices in yaml(as the documentation says n shows), if you use local tuya, you are better of :) ... and the tuya engineer did explained to you how you should get right result, as i did above
if you are referring to official Tuya-integration, you might want to configure(set scaling) for your devices in yaml(as the documentation says n shows), if you use local tuya, you are better of :) ... and the tuya engineer did explained to you how you should get right result, as i did above
@boheme61 yes being able to set scaling would be a good workaround. I couldn't find the documentation to make this change in yaml. Can you provide a link?
if you are referring to official Tuya-integration, you might want to configure(set scaling) for your devices in yaml(as the documentation says n shows), if you use local tuya, you are better of :) ... and the tuya engineer did explained to you how you should get right result, as i did above
I think I get your point, but as it is not available on Tuya IoT platform, it probably should be part of HA configuration, instead of creating additional templates and as result more entities. Scaling through yaml (if template-based) will also disconnect entity from the device if I'm not wrong (additional minus of such method).
Also I use localtuya, but as I mentioned - I don't think this is a resolution.
Btw. I still don't get why the SmartLife app shows proper values and here it's different. Shouldn't it take same values? I'm not good with understanding it - more explanation may help me understand better ;)
or, you guys could use the localtuya interface to change your scaling-factor, i.e 1 means 0.1 , if it don't apply for your device, find the right one by "tryNerror" ... if the "scaling-factor" in localtuya-integration don't work , you got a device-problem,
Thanks localtuya is certainly an option, but it is a workaround and the issue with the core-tuya integration still needs to be addressed.
I have seen reference to being able to change scaling factor in yaml for the tuya-core integration, but am unable to find any details on configuration.
I have same problem with Nedis WIFIPO120FWT. Shows correct values in tuya app but 10x in home assistant
, instead of creating additional templates and as result more entities.
Use this ( custom:template-entity-row )(download from github, or hacs), maybe other cards support something similar as below
@purcell-lab ... here you go
type: entities
entities:
- type: custom:template-entity-row
name: whateveryoulike
active: true
state: >
{{ states('your.sensor_here')|float(0) * 0.1 }}
PS: Sorry i haven't seen all commends(feedback) on my post :) , before now
And to those of you who still don't understand, 1 device, is different from another device, and other brands etc. etc. ... ex.My brand new ASUS Router's "Uptime_Sensor" reports uptime in seconds, 99DAYS, 23HOURS, 35MIN in seconds is =XXXMANY, so why has the developer of the integration not made sure that MY device, SHOWS what I WANT
The Other Day someone complained i HA, that his "Current-Sensor" showed "Value" in "mA" , (WHY, he wanted A, period) ... So People sit on their free time and make an APP/ ADD-ON/Integration, maybe because he/she need it, or think it's fun, or both, they maybe develop it around their "specific" Devices( Why Not ?), ... and eventually follow up on(Adapt to) HA's requirements for Add-ons / integrations, ... to give other People, who use HA for Free, can have benefits for/use this particular "Integration" , for Free ... And your focus seems more related to complains, and your opinions whether it's a Bug/FR, or why it shows different on your phone-app/connected to your free cloud service ... short answer,... im pretty sure it's not a BUG, what your Device/Cloud service gives you, i don't know( i do know Toya, don't really support other brands correct(as mentioned above), and even their own, DON'T report what you "see"(whether it's your/my cloud-service, that recon-ice thedevice and "correct it, to local circumstances, or what( i don't care ) ... i do know a device is hardly ever capable of satisfies everyones need, support every possible measurement_unit( an enduser want), and in many case they have an "internal" process( as my Router above ) that requires other measurement specification,( and sensor therefore shows) that ANY enduser would want to see "Uptime in Seconds", Temperature-Sensors capable of 5-6 digit i.e 1.235644 C. who wants to see that ? ... sure they sell them as "Very Sensible/Correct" sensors ... Who Cares, i want only 2 digits.
I think I get your point, but as it is not available on Tuya IoT platform
And i think the commends here proves that it is actually "present" at Tuya.iot 1 of my devices shows "scale: 3" ( at Tuya.iot ) when i actually had to use 1 ( for add_ele ) purcell-lab: had only problem with cur_power, heard others where only Power showed wrong. etc. If i would have used Official-Tuya(Cloud-service) , i think my 1 of, if not all add_ele would have showed wrong( i don't know) , but i do have full spec. of my devices from Tuya( as Tuya sees them ), and yes in most(only most) cases it seems that it's power and Volt, that needs "re-calculated" , why 1 of my devices showed "scale 3", for add-ele, when the other 3 (add_ele) showed "scale 1"(scaling factor 0.1) , i really don't know, and i don't intend to ask Tuya, as it's Nedis and Deltaco devices :)
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Issue still happens.
A few things I noted when (redoing) setup of my iBBQ-4T which uses Tuya. The Probe temps defaulted to 100x the actual temp, so 84.40 was really 8440. So, I redid the integration and used ºF for the unit of measurement (only way I could enter the degree symbol was copy/paste), this resulted in 8440 ºF. Then I tried to enter 0.01 for a scaling factor and could not do it, the GUI would not take 0,01 as soon as you enter the second "0" it makes the whole thing zero. Cut/paste came to the rescue and I took a text editor and put in my "0.01" and pasted it into the scaling factor. Now my probes show this:
I am having the same problem with a lot of gosund smart plugs. They all show a 10 times higher power consumption reading :(
A few things I noted when (redoing) setup of my iBBQ-4T which uses Tuya. The Probe temps defaulted to 100x the actual temp, so 84.40 was really 8440. So, I redid the integration and used ºF for the unit of measurement (only way I could enter the degree symbol was copy/paste), this resulted in 8440 ºF. Then I tried to enter 0.01 for a scaling factor and could not do it, the GUI would not take 0,01 as soon as you enter the second "0" it makes the whole thing zero. Cut/paste came to the rescue and I took a text editor and put in my "0.01" and pasted it into the scaling factor. Now my probes show this:
Where you added scaling factor? I believe this is impossible to do within official integration or you mean localtuya?
In localtuya.
Same "power*10" problem with Aqara Smartplug.
Gosund EP-2 plugs also report wrong in Home Assistant: Current: OK Power: x10 Voltage: x10
Same here. I have 4 different brands of Tuya Plugs and the same problem everywhere.
Same here, Gosund EP-2 plugs report wrongly in Home Assistant: Current: x10 Power: x10 Voltage: OK
Other Tuya plugs work well.
Chiming in, same here with 3 gosund plugs connected via Tuya app.
Just to get the obvious thing out of the way, because you know, stupid things happen: Is there an issue with the localization, like mixing up .
and ,
?
gosund sockets as well. Voltage and Power are 10x the normal. All values are ok in the Tuya app.
Chiming in, same here with 3 gosund plugs connected via Tuya app.
Just to get the obvious thing out of the way, because you know, stupid things happen: Is there an issue with the localization, like mixing up
.
and,
?
No, it's not, it's the way it is coming from API
You're right.
Is there a guide how to workaround that issue until the api got fixed?
I already created virtual sensors for Gree climate attributes of local temperature. The same works for this too. I count the power as voltage*current (voltage is false, should be divided by 10). It would be (should) the same to use power/10, but I found it more interesting.
Is there a guide how to workaround that issue until the api got fixed?
My solution to create another (correct) sensor/entity from the device provided values. Sorry for the native names and comments, I hope it is still usefull
sensor:
- platform: template
sensors:
dolgozo_real_power:
value_template: "{{ states('sensor.dolgozo_futes_current')|float * states('sensor.dolgozo_futes_voltage')|float / 10 }}"
unit_of_measurement: 'W'
friendly_name: 'Dolgozo futes pillanatnyi teljesitmeny'
device_class: power
zuhany_real_power:
value_template: "{{ states('sensor.ep2_ar_current')|float * states('sensor.ep2_ar_voltage')|float / 10 }}"
unit_of_measurement: 'W'
friendly_name: 'Zuhany futes pillanatnyi teljesitmeny'
device_class: power
...
- platform: integration
source: sensor.dolgozo_real_power
name: Dolgozo futes energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.zuhany_real_power
name: Zuhany futes energy
unit_prefix: k
round: 2
any update on this? still showing 10x the power for my tuya plugs in version 2023.1.4
Gosund EP-2 plugs also report wrong in Home Assistant: Current: OK Power: x10 Voltage: x10
I have same problem with my Gosund EP-2 sockets (Blitzwolf reports well)
I have this too!
Same problem here 🙋♂️
Just switched the integration from the default cloud-based tuya to tuya-local (NOT localtuya) - the measured values are ok now.
Check your devices on the supported devices list first! I have got a bw-shp6, and two Gosund sockets. BW required a manual IP address and protocol override, but Gosunds were detected after providing the device_id and the local key
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
It's still the case here
Problem still existing and should be an easy to solve bug
Please fix this bug - It's more than a year old and still present ...
Here, have a workaround... I wouldn't expect changes on this issue soon.
- platform: template
sensors:
# Copy this Block for every power sensor
plug_pc_power_real:
value_template: "{{ states('sensor.plug_pc_power') | float / 10 }}"
unit_of_measurement: "W"
friendly_name: "plug PC Power (Real)"
device_class: power
# Copy this Block for every voltage sensor
plug_pc_voltage_real:
value_template: "{{ states('sensor.plug_pc_voltage') | float / 10 }}"
unit_of_measurement: "V"
friendly_name: "plug PC Voltage (Real)"
device_class: voltage
# Copy this block for every metric
- platform: integration
source: sensor.plug_pc_power_real
name: plug PC Power spent
unit_prefix: k
round: 2
@max06 Thanks, I also thought of using templates to "fix" this issue, however it feels unsatifying since its just a workaround and does'nt fix the actual issue.
It was easier than waiting for something... 😂
Hi, same issue here, for me only 1 of 7 have the scale issue in HA (no issue in smart-life app), The only one which has false scale is firmware 1.0.4, the others (fw 1.0.0 and 1.1.0) are ok. The Custom sensor workaround is ok
Tuya app, says that fw are up-to-date, anyones knows how to update tuya fw ?
The problem
Hi! I’m having a 10x multiplier error with my Tuya integrated smart plug. I noticed another issue about this #63949, but the differens is that for me the error is for the power sensor part not the voltage. Instead of 117,0 W as shown in the Tuya app HA presents this as 1170,0W
This error also makes my function for calculating kWh useless. (Using Integration - Riemann sum integral) since kWh doesn’t seam to integrated from the Tuya app where its presented.
What version of Home Assistant Core has the issue?
Home Assistant 2021.12.9
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
Tuya
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tuya
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response