Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Moridium opened this issue Jan 12, 2022 · 71 comments
Open

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

Moridium opened this issue Jan 12, 2022 · 71 comments

Comments

@Moridium
Copy link

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
Copy link

tuya documentation
tuya source
(message by IssueLinks)

@probot-home-assistant
Copy link

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
Copy link
Contributor

OldShaterhan commented Jan 12, 2022

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

Hexagon commented Feb 2, 2022

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
{
  "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
{
  "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
Copy link
Contributor

purcell-lab commented Feb 4, 2022

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
Copy link
Contributor

Here is the upstream issue:

under status_range:

  • cur_current: unit: mA, scale:0 CORRECT
  • cur_power: unit: kW, scale:0 INCORRECT
  • voltage: unit: V, scale:1 CORRECT
    "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
Copy link
Member

frenck commented Feb 4, 2022

How do we escalate upstream?

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

@boheme61
Copy link

boheme61 commented Feb 7, 2022

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
Copy link
Contributor

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
Copy link

boheme61 commented Feb 8, 2022

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

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

@boheme61
Copy link

boheme61 commented Mar 24, 2022

, 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
Copy link

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.

@github-actions github-actions bot added the stale label Jun 23, 2022
@OldShaterhan
Copy link
Contributor

Issue still happens.

@github-actions github-actions bot removed the stale label Jun 23, 2022
@kbrown01
Copy link

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
Copy link

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

@max06
Copy link

max06 commented Jun 19, 2023

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
Copy link

@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
Copy link

max06 commented Jun 19, 2023

It was easier than waiting for something... 😂

@Tank86
Copy link

Tank86 commented Jun 25, 2023

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 ?

@OldShaterhan
Copy link
Contributor

tuya/tuya-home-assistant#938 - reported here as well.

@Szaki-dev
Copy link

Szaki-dev commented Oct 8, 2023

Hi, I had the same problem but I modified the tuya integration and imported it as a custom component in HACS. The mod just removes the scaling on the output.
I created a repo for it: https://github.com/Szaki-dev/tuya_fix

@panosru
Copy link

panosru commented Nov 1, 2023

Thank you @Szaki-dev, I installed your fork and it works great!

@dcarosone
Copy link

I have the same problem. Just starting with HA. This is the first device I added.

@xvisionbelgium
Copy link

Got the same problem. It could be solved by the maintainer of this integration by providing a scaling field on every sensor like the localtuya has... avoiding the ping-pong game between the manufacturer-Tuya-HA...

@dcarosone
Copy link

I solved the problem (and several others) by simply switching to localtuya.

@rogales
Copy link

rogales commented May 19, 2024

Hi, I had the same problem but I modified the tuya integration and imported it as a custom component in HACS. The mod just removes the scaling on the output. I created a repo for it: https://github.com/Szaki-dev/tuya_fix

Can I talk with You about this fix?
I've installed Your repo, but it still shows 10x greater measures.

@Szaki-dev
Copy link

Hi, I had the same problem but I modified the tuya integration and imported it as a custom component in HACS. The mod just removes the scaling on the output. I created a repo for it: https://github.com/Szaki-dev/tuya_fix

Can I talk with You about this fix? I've installed Your repo, but it still shows 10x greater measures.

Hi, Make sure you run the latest version of HA. Try removing then reinstalling the devices. If the error still persists DM me on discord (szakidev).

@issue-triage-workflows
Copy link

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.

@catch-33
Copy link

Issue still persists for me.
My Tuya-based smart plug still reports e.g. 1500 Watts instead of 150

@Saxtus
Copy link

Saxtus commented Aug 19, 2024

Same here. The problem persists with the latest version.

@olekdata
Copy link

olekdata commented Aug 22, 2024

Set Scaling Factor to 0.1
image

image

Use LocalTuya integration

@OldShaterhan
Copy link
Contributor

@olekdata , problem is that it requires localtuya - HomeAssistant built-in integration has no option to do so.

@JaySea77
Copy link

For me the problem is local guys. The normal integration has correct values

@issue-triage-workflows
Copy link

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
Copy link
Contributor

Still valid.

@pwwukpw
Copy link

pwwukpw commented Jan 4, 2025

I've got the same issue on my Tekin Sockets .. shows power as 10x actually watts shown in SL app.

@feardriven
Copy link

Still a thing in 2025 ...

@genNighty
Copy link

Same thing on two different Gosund sockets.

Image
Image

@ikea2000
Copy link

ikea2000 commented Feb 5, 2025

Still have the issue on 2025.2 as of today.

Tuya EP2-AR socket.

Diagnostics attached.

tuya-01JCH0BE7T147KYR4MXM7TVPST-EP2-AR-bbddcc5395729930c8a1964fbaf60dcf.json

@jwende
Copy link

jwende commented Feb 8, 2025

Same issue here - with EP2-AR as well.
J.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests