home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.46k stars 29.39k forks source link

Tuya integration - power value is 10x to high #63978

Open Moridium opened 2 years ago

Moridium commented 2 years ago

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 image

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

probot-home-assistant[bot] commented 2 years ago

tuya documentation tuya source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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)

OldShaterhan commented 2 years ago

Hi @Moridium , I just can confirm this is the case for original issue too (11.3 W SmartLife vs 114W HA) ;) image

Do you take voltage from some kind of endpoint or sth? + What class of device do you have? (socket, switch)?

Moridium commented 2 years ago

Hi @OldShaterhan
Thank you for confirming that the issues seam to be related. Im using a smartplug image 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. image

OldShaterhan commented 2 years ago

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...

Moridium commented 2 years ago

Hi Yes my current seams to be ok This is my latest log and screenshot from HA image image Voltage hasn't changed, so didn't copy that again.

OldShaterhan commented 2 years ago

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.

Moridium commented 2 years ago

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.

OldShaterhan commented 2 years ago

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.

dougiteixeira commented 2 years ago

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?

image

Hexagon commented 2 years ago

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,

Diagnostics JSON of problematic device ```json { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2022.2.0b6", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.9.7", "docker": true, "arch": "x86_64", "timezone": "Europe/Stockholm", "os_name": "Linux", "os_version": "5.4.0-96-generic", "run_as_root": true }, "custom_components": {}, "integration_manifest": { "domain": "tuya", "name": "Tuya", "documentation": "https://www.home-assistant.io/integrations/tuya", "requirements": [ "tuya-iot-py-sdk==0.6.6" ], "dependencies": [ "ffmpeg" ], "codeowners": [ "@Tuya", "@zlinoliver", "@METISU", "@frenck" ], "config_flow": true, "iot_class": "cloud_push", "dhcp": ['snip'], "is_built_in": true }, "data": { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "46", "app_type": "smartlife", "mqtt_connected": true, "disabled_by": null, "disabled_polling": false, "name": "V\u00e4rmelampa", "model": "FK-PW802EC-F", "category": "cz", "product_id": "ipabufmlmodje1ws", "product_name": "", "online": true, "sub": false, "time_zone": "+01:00", "active_time": "2022-01-22T12:55:50+00:00", "create_time": "2022-01-21T20:32:42+00:00", "update_time": "2022-01-22T12:55:53+00:00", "function": { "switch_1": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "add_ele": { "type": "Integer", "value": { "unit": "kwh", "min": 0, "max": 50000, "scale": 3, "step": 100 } } }, "status_range": { "switch_1": { "type": "Boolean", "value": {} }, "add_ele": { "type": "Integer", "value": { "unit": "kwh", "min": 0, "max": 50000, "scale": 3, "step": 100 } }, "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 } }, "test_bit": { "type": "Integer", "value": { "unit": "", "min": 0, "max": 5, "scale": 0, "step": 1 } }, "voltage_coe": { "type": "Integer", "value": { "unit": "", "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electric_coe": { "type": "Integer", "value": { "unit": "", "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "power_coe": { "type": "Integer", "value": { "unit": "", "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electricity_coe": { "type": "Integer", "value": { "unit": "", "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } } }, "status": { "switch_1": true, "countdown_1": 0, "add_ele": 82, "cur_current": 435, "cur_power": 1642, "cur_voltage": 2246, "test_bit": 1, "voltage_coe": 632, "electric_coe": 10795, "power_coe": 10197, "electricity_coe": 4090 }, "home_assistant": { "name": "V\u00e4rmelampa", "name_by_user": null, "disabled": false, "disabled_by": null, "entities": [ { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": "current", "original_device_class": "current", "icon": null, "original_icon": null, "unit_of_measurement": "A", "state": { "entity_id": "sensor.varmelampa_current", "state": "0.435", "attributes": { "state_class": "measurement", "unit_of_measurement": "A", "device_class": "current", "friendly_name": "V\u00e4rmelampa Current" }, "last_changed": "2022-02-02T14:11:07.866079+00:00", "last_updated": "2022-02-02T14:11:07.866079+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": "voltage", "original_device_class": "voltage", "icon": null, "original_icon": null, "unit_of_measurement": "V", "state": { "entity_id": "sensor.varmelampa_voltage", "state": "224.6", "attributes": { "state_class": "measurement", "unit_of_measurement": "V", "device_class": "voltage", "friendly_name": "V\u00e4rmelampa Voltage" }, "last_changed": "2022-02-02T14:39:52.873138+00:00", "last_updated": "2022-02-02T14:39:52.873138+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": "outlet", "original_device_class": "outlet", "icon": null, "original_icon": null, "unit_of_measurement": null, "state": { "entity_id": "switch.honshus_varmelampa", "state": "on", "attributes": { "device_class": "outlet", "friendly_name": "H\u00f6nshus V\u00e4rmelampa" }, "last_changed": "2022-02-02T12:51:16.096748+00:00", "last_updated": "2022-02-02T12:51:16.096748+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": "power", "original_device_class": "power", "icon": null, "original_icon": null, "unit_of_measurement": "W", "state": { "entity_id": "sensor.honshus_varmelampa_power", "state": "1642.0", "attributes": { "state_class": "measurement", "unit_of_measurement": "W", "device_class": "power", "friendly_name": "H\u00f6nshus V\u00e4rmelampa Power" }, "last_changed": "2022-02-02T14:39:52.872745+00:00", "last_updated": "2022-02-02T14:39:52.872745+00:00" } } ] } } } ```

This is the dignostics of a device that's working correctly (shows ~1200W which is correct)

Diagnostics JSON of working device ```json { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2022.2.0b6", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.9.7", "docker": true, "arch": "x86_64", "timezone": "Europe/Stockholm", "os_name": "Linux", "os_version": "5.4.0-96-generic", "run_as_root": true }, "custom_components": {}, "integration_manifest": { "domain": "tuya", "name": "Tuya", "documentation": "https://www.home-assistant.io/integrations/tuya", "requirements": [ "tuya-iot-py-sdk==0.6.6" ], "dependencies": [ "ffmpeg" ], "codeowners": [ "@Tuya", "@zlinoliver", "@METISU", "@frenck" ], "config_flow": true, "iot_class": "cloud_push", "dhcp": ['snip'], "is_built_in": true }, "data": { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "46", "app_type": "smartlife", "mqtt_connected": true, "disabled_by": null, "disabled_polling": false, "name": "Spa", "model": "JLCZ8266", "category": "cz", "product_id": "fencxse0bnut96ig", "product_name": "smart plug", "online": true, "sub": false, "time_zone": "+01:00", "active_time": "2022-01-28T07:32:38+00:00", "create_time": "2022-01-28T07:32:38+00:00", "update_time": "2022-01-28T07:32:52+00:00", "function": { "switch_1": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } } }, "status_range": { "switch_1": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "add_ele": { "type": "Integer", "value": { "unit": "kwh", "min": 0, "max": 50000, "scale": 3, "step": 100 } }, "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": 1, "step": 1 } }, "cur_voltage": { "type": "Integer", "value": { "unit": "V", "min": 0, "max": 5000, "scale": 1, "step": 1 } } }, "status": { "switch_1": true, "countdown_1": 0, "add_ele": 203, "cur_current": 5404, "cur_power": 12018, "cur_voltage": 2381 }, "home_assistant": { "name": "Spa", "name_by_user": "Spa Str\u00f6mbrytare", "disabled": false, "disabled_by": null, "entities": [ { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "outlet", "icon": null, "original_icon": null, "unit_of_measurement": null, "state": { "entity_id": "switch.spa_strombrytare_socket_1", "state": "on", "attributes": { "device_class": "outlet", "friendly_name": "Spa Socket 1" }, "last_changed": "2022-02-02T12:51:16.096404+00:00", "last_updated": "2022-02-02T12:51:16.096404+00:00" } }, { "disabled": true, "disabled_by": "integration", "entity_category": null, "device_class": null, "original_device_class": "current", "icon": null, "original_icon": null, "unit_of_measurement": "A", "state": null }, { "disabled": true, "disabled_by": "integration", "entity_category": null, "device_class": null, "original_device_class": "voltage", "icon": null, "original_icon": null, "unit_of_measurement": "V", "state": null }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": "power", "original_device_class": "power", "icon": null, "original_icon": null, "unit_of_measurement": "W", "state": { "entity_id": "sensor.spa_strombrytare_stromforbrukning", "state": "1201.8", "attributes": { "state_class": "measurement", "unit_of_measurement": "W", "device_class": "power", "friendly_name": "Spa Str\u00f6mf\u00f6rbrukning" }, "last_changed": "2022-02-02T14:18:33.958088+00:00", "last_updated": "2022-02-02T14:18:33.958088+00:00" } } ] } } } ```
purcell-lab commented 2 years ago

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.

image

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

purcell-lab commented 2 years ago

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

frenck commented 2 years ago

How do we escalate upstream?

You can file a support ticket in the Tuya IoT environment=.

boheme61 commented 2 years ago

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

OldShaterhan commented 2 years ago

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:

image image image

boheme61 commented 2 years ago

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

purcell-lab commented 2 years ago

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?

OldShaterhan commented 2 years ago

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 ;)

purcell-lab commented 2 years ago

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.

TombaDude commented 2 years ago

I have same problem with Nedis WIFIPO120FWT. Shows correct values in tuya app but 10x in home assistant

boheme61 commented 2 years ago

, 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 :)

github-actions[bot] commented 2 years ago

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.

OldShaterhan commented 2 years ago

Issue still happens.

kbrown01 commented 2 years ago

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:

image

peregrines2 commented 2 years ago

I am having the same problem with a lot of gosund smart plugs. They all show a 10 times higher power consumption reading :(

OldShaterhan commented 2 years ago

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:

image

Where you added scaling factor? I believe this is impossible to do within official integration or you mean localtuya?

kbrown01 commented 2 years ago

In localtuya.

burningsquirrel-de commented 1 year ago

Same "power*10" problem with Aqara Smartplug.

nashaden commented 1 year ago

Gosund EP-2 plugs also report wrong in Home Assistant: Current: OK Power: x10 Voltage: x10

kasik96 commented 1 year ago

Same here. I have 4 different brands of Tuya Plugs and the same problem everywhere.

nicknol commented 1 year ago

Same here, Gosund EP-2 plugs report wrongly in Home Assistant: Current: x10 Power: x10 Voltage: OK

Other Tuya plugs work well.

max06 commented 1 year ago

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 ,?

heidricha commented 1 year ago

gosund sockets as well. Voltage and Power are 10x the normal. All values are ok in the Tuya app.

OldShaterhan commented 1 year ago

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

max06 commented 1 year ago

You're right. image

Is there a guide how to workaround that issue until the api got fixed?

heidricha commented 1 year ago

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
catch-33 commented 1 year ago

any update on this? still showing 10x the power for my tuya plugs in version 2023.1.4

kenand1970 commented 1 year ago

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)

probablypablito commented 1 year ago

I have this too!

hugoheinzson commented 1 year ago

Same problem here 🙋‍♂️

heidricha commented 1 year ago

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

issue-triage-workflows[bot] commented 1 year ago

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.

OldShaterhan commented 1 year ago

It's still the case here

hugoheinzson commented 1 year ago

Problem still existing and should be an easy to solve bug

Triple-S commented 1 year ago

Please fix this bug - It's more than a year old and still present ...

max06 commented 1 year ago

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
Triple-S commented 1 year ago

@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.

max06 commented 1 year ago

It was easier than waiting for something... 😂

Tank86 commented 1 year ago

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 ?