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
73.51k stars 30.71k forks source link

Tuya Smart Plug Power/Voltage/Current Sensors Unavailable #82646

Closed StephenMilner closed 1 year ago

StephenMilner commented 1 year ago

The problem

I have recently added a new Tuya Smart Plug to the App and it has appeared in HA as expected under the Tuya integration.

When I check on the device, under Sensors, it states 3 hidden entities not shown. When I show them there are entries for Power, Current and Voltage. Clicking any of them shows that they are Unavailable

Plug is described as : Smart Plug (bmu9fgvgvo61cv1s) There are no adapts available for this device

What version of Home Assistant Core has the issue?

Home Assistant 2022.11.2 Frontend 20221108.0 - latest

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya

Diagnostics information

{ "home_assistant": { "installation_type": "Home Assistant Container", "version": "2022.11.2", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "aarch64", "timezone": "Europe/London", "os_name": "Linux", "os_version": "4.4.18-g8bcbd8a-dirty", "run_as_root": true }, "custom_components": { "sonoff": { "version": "3.3.1", "requirements": [ "pycryptodome>=3.6.6" ] }, "dyson_local": { "version": "0.16.4-4", "requirements": [ "libdyson==0.8.11" ] }, "dyson_cloud": { "version": "0.15.0", "requirements": [ "libdyson==0.8.7" ] }, "hacs": { "version": "1.28.3", "requirements": [ "aiogithubapi>=22.2.4" ] }, "weatherbit": { "version": "1.0.17", "requirements": [ "pyweatherbitdata==1.0.15" ] }, "var": { "version": "0.15.0", "requirements": [] }, "pod_point": { "version": "0.4.1", "requirements": [ "podpointclient==0.3.0", "StrEnum>=0.4,<0.5" ] } }, "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", "@frenck" ], "config_flow": true, "iot_class": "cloud_push", "dhcp": [ { "macaddress": "105A17" }, { "macaddress": "10D561" }, { "macaddress": "1869D8" }, { "macaddress": "381F8D" }, { "macaddress": "508A06" }, { "macaddress": "68572D" }, { "macaddress": "708976" }, { "macaddress": "7CF666" }, { "macaddress": "84E342" }, { "macaddress": "D4A651" }, { "macaddress": "D81F12*" } ], "integration_type": "hub", "loggers": [ "tuya_iot" ], "is_built_in": true }, "data": { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "44", "app_type": "smartlife", "mqtt_connected": true, "disabled_by": null, "disabled_polling": false, "name": "Entertainment System", "model": "U1R BL-13A -JX", "category": "cz", "product_id": "bmu9fgvgvo61cv1s", "product_name": "Smart Plug", "online": true, "sub": false, "time_zone": "+00:00", "active_time": "2022-11-13T11:58:35+00:00", "create_time": "2022-11-13T11:58:35+00:00", "update_time": "2022-11-16T19:55:21+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": false, "countdown_1": 0, "add_ele": 30, "cur_current": 0, "cur_power": 0, "cur_voltage": 2358 }, "home_assistant": { "name": "Entertainment System", "name_by_user": "Entertainment System", "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.entertainment_system_socket_1", "state": "off", "attributes": { "device_class": "outlet", "friendly_name": "Entertainment System Socket 1" }, "last_changed": "2022-11-24T00:10:09.722087+00:00", "last_updated": "2022-11-24T00:10:09.722087+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": "power", "icon": null, "original_icon": null, "unit_of_measurement": "W", "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 } ] } } }

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @tuya, @zlinoliver, @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!

Code owner commands Code owners of `tuya` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tuya` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

frenck commented 1 year ago

@StephenMilner I'm not entirely sure what the bug is you are trying to report? Could you clarify what is wrong?

StephenMilner commented 1 year ago

Thanks frenck

I'm trying to use an automation based on the plug's current power, but the sensors for the device for power, voltage and current are unavailable.

If I should be using another method then by all means let me know.

Screenshot 2022-11-24 at 15 50 58

frenck commented 1 year ago

They are disabled, feel free to enable them in the advanced settings.

StephenMilner commented 1 year ago

Blimey - Sorry - being stupid!

frenck commented 1 year ago

I do think it is a UX problem a bit though, it isn't super clear. Nevertheless, I'm glad you've found it! 👍