tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
871 stars 206 forks source link

No power usage sensors available in HA #767

Open ameran opened 2 years ago

ameran commented 2 years ago

Power sensors are not available in Home Assistant. Smartlife app shows electric usage, current, power, and voltage readings.

Device normal info

Device info (please complete the following information, which can be found in log): like this:

{
"active_time": 1642493871,
"biz_type": 18,
"category": "cz",
"create_time": 1642493871,
"icon": "smart/icon/ay153323666394154UBr/db271b143a83f40a9c398aa6fc35b300.png",
"id": "bf869b46e5672efc73yeyc",
"ip": "***",
"lat": "***",
"local_key": "***",
"lon": "***",
"model": "CC-P1003",
"name": "Washing Machine",
"online": true,
"owner_id": "33372134",
"product_id": "z8t1elmgmvnrqzf8",
"product_name": "Smart Wi-Fi 3 Pin Plug ",
"status": [
{
"code": "switch_1",
"value": true
}
],
"sub": false,
"time_zone": "+02:00",
"uid": "***",
"update_time": 1642502588,
"uuid": "bb5731687479d296"
},
{
"active_time": 1642494168,
"biz_type": 18,
"category": "cz",
"create_time": 1642494168,
"icon": "smart/icon/ay153323666394154UBr/db271b143a83f40a9c398aa6fc35b300.png",
"id": "bf0008bb5cd9740f2daasw",
"ip": "***",
"lat": "***",
"local_key": "***",
"lon": "***",
"model": "CC-P1003",
"name": "Dishwasher ",
"online": true,
"owner_id": "33372134",
"product_id": "z8t1elmgmvnrqzf8",
"product_name": "Smart Wi-Fi 3 Pin Plug ",
"status": [
{
"code": "switch_1",
"value": true
}
],
"sub": false,
"time_zone": "+02:00",
"uid": "***",
"update_time": 1642502585,
"uuid": "0c9cecb43a5d9d44"
},

**Device specifications (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-home-assistant/wiki/How-to-get-the-log)):**
Same device's id, like this:
2022-01-18 13:43:19 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bf869b46e5672efc73yeyc/specifications, params = None, body = None, t = 1642506199558
2022-01-18 13:43:19 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
]
},
"success": true,
"t": 1642506199706
}
2022-01-18 13:43:19 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bf3cc6c6504da5b7e0l8pj/specifications, params = None, body = None, t = 1642506199808
2022-01-18 13:43:19 DEBUG (Thread-6) [tuya iot] _on_log: Received SUBACK
2022-01-18 13:43:19 DEBUG (Thread-6) [tuya iot] _on_subscribe: 1
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "kg",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
},
{
"code": "add_ele",
"type": "Integer",
"values": "{\"unit\":\"kwh\",\"min\":0,\"max\":50000,\"scale\":3,\"step\":100}"
},
{
"code": "cur_current",
"type": "Integer",
"values": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":3,\"step\":100}"
},
{
"code": "cur_voltage",
"type": "Integer",
"values": "{\"unit\":\"V\",\"min\":0,\"max\":2850,\"scale\":1,\"step\":1}"
},
{
"code": "cur_power",
"type": "Integer",
"values": "{\"unit\":\"W\",\"min\":0,\"max\":85500,\"scale\":1,\"step\":1}"
}
]
},
"success": true,
"t": 1642506199957
}
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfc5a49ca585a285e51ybg/specifications, params = None, body = None, t = 1642506200067
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "relay_status",
"type": "Enum",
"values": "{\"range\":[\"power_off\",\"power_on\",\"last\"]}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "add_ele",
"type": "Integer",
"values": "{\"unit\":\"kwh\",\"min\":0,\"max\":50000,\"scale\":3,\"step\":100}"
},
{
"code": "cur_current",
"type": "Integer",
"values": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":0,\"step\":1}"
},
{
"code": "cur_power",
"type": "Integer",
"values": "{\"unit\":\"W\",\"min\":0,\"max\":50000,\"scale\":1,\"step\":1}"
},
{
"code": "cur_voltage",
"type": "Integer",
"values": "{\"unit\":\"V\",\"min\":0,\"max\":5000,\"scale\":1,\"step\":1}"
},
{
"code": "relay_status",
"type": "Enum",
"values": "{\"range\":[\"power_off\",\"power_on\",\"last\"]}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
}
]
},
"success": true,
"t": 1642506200195
}
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bf3043d32fb5889f523vhp/specifications, params = None, body = None, t = 1642506200306
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "relay_status",
"type": "Enum",
"values": "{\"range\":[\"power_off\",\"power_on\",\"last\"]}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "add_ele",
"type": "Integer",
"values": "{\"unit\":\"kwh\",\"min\":0,\"max\":50000,\"scale\":3,\"step\":100}"
},
{
"code": "cur_current",
"type": "Integer",
"values": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":0,\"step\":1}"
},
{
"code": "cur_power",
"type": "Integer",
"values": "{\"unit\":\"W\",\"min\":0,\"max\":50000,\"scale\":1,\"step\":1}"
},
{
"code": "cur_voltage",
"type": "Integer",
"values": "{\"unit\":\"V\",\"min\":0,\"max\":5000,\"scale\":1,\"step\":1}"
},
{
"code": "relay_status",
"type": "Enum",
"values": "{\"range\":[\"power_off\",\"power_on\",\"last\"]}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
}
]
},
"success": true,
"t": 1642506200475
}
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfc0844cf2735d2396w3lt/specifications, params = None, body = None, t = 1642506200584
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
]
},
"success": true,
"t": 1642506200727
}
2022-01-18 13:43:20 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfccd92fda82824434ax34/specifications, params = None, body = None, t = 1642506200826
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "dj",
"functions": [
{
"code": "switch_led",
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "bright_value_v2",
"type": "Integer",
"values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "temp_value_v2",
"type": "Integer",
"values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "colour_data_v2",
"type": "Json",
"values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}"
},
{
"code": "scene_data_v2",
"type": "Json",
"values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "control_data",
"type": "Json",
"values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "rhythm_mode",
"type": "Raw",
"values": "{\"maxlen\":255}"
}
],
"status": [
{
"code": "switch_led",
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "bright_value_v2",
"type": "Integer",
"values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "temp_value_v2",
"type": "Integer",
"values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "colour_data_v2",
"type": "Json",
"values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}"
},
{
"code": "scene_data_v2",
"type": "Json",
"values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "control_data",
"type": "Json",
"values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "rhythm_mode",
"type": "Raw",
"values": "{\"maxlen\":\"255\"}"
}
]
},
"success": true,
"t": 1642506201000
}
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bf0008bb5cd9740f2daasw/specifications, params = None, body = None, t = 1642506201110
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
]
},
"success": true,
"t": 1642506201259
}
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bf71aa0c7da3a44f46kayl/specifications, params = None, body = None, t = 1642506201367
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "relay_status",
"type": "Enum",
"values": "{\"range\":[\"power_off\",\"power_on\",\"last\"]}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "add_ele",
"type": "Integer",
"values": "{\"unit\":\"kwh\",\"min\":0,\"max\":50000,\"scale\":3,\"step\":100}"
},
{
"code": "cur_current",
"type": "Integer",
"values": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":0,\"step\":1}"
},
{
"code": "cur_power",
"type": "Integer",
"values": "{\"unit\":\"W\",\"min\":0,\"max\":50000,\"scale\":1,\"step\":1}"
},
{
"code": "cur_voltage",
"type": "Integer",
"values": "{\"unit\":\"V\",\"min\":0,\"max\":5000,\"scale\":1,\"step\":1}"
},
{
"code": "relay_status",
"type": "Enum",
"values": "{\"range\":[\"power_off\",\"power_on\",\"last\"]}"
},
{
"code": "cycle_time",
"type": "String",
"values": "{}"
},
{
"code": "random_time",
"type": "String",
"values": "{}"
}
]
},
"success": true,
"t": 1642506201505
}
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfbf9bc4b8e01a2680r4cp/specifications, params = None, body = None, t = 1642506201617
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "cz",
"functions": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "switch_1",
"type": "Boolean",
"values": "{}"
}
]
},
"success": true,
"t": 1642506201742
}
2022-01-18 13:43:21 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfb60163b5827b2c6e9c79/specifications, params = None, body = None, t = 1642506201844
2022-01-18 13:43:22 DEBUG (SyncWorker_2) [tuya iot] Response: {
"result": {
"category": "dj",
"functions": [
{
"code": "switch_led",
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "bright_value_v2",
"type": "Integer",
"values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "temp_value_v2",
"type": "Integer",
"values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "colour_data_v2",
"type": "Json",
"values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}"
},
{
"code": "scene_data_v2",
"type": "Json",
"values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "control_data",
"type": "Json",
"values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "rhythm_mode",
"type": "Raw",
"values": "{\"maxlen\":255}"
}
],
"status": [
{
"code": "switch_led",
"type": "Boolean",
"values": "{}"
},
{
"code": "work_mode",
"type": "Enum",
"values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
},
{
"code": "bright_value_v2",
"type": "Integer",
"values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "temp_value_v2",
"type": "Integer",
"values": "{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
},
{
"code": "colour_data_v2",
"type": "Json",
"values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}"
},
{
"code": "scene_data_v2",
"type": "Json",
"values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}"
},
{
"code": "countdown_1",
"type": "Integer",
"values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
},
{
"code": "control_data",
"type": "Json",
"values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
},
{
"code": "rhythm_mode",
"type": "Raw",
"values": "{\"maxlen\":\"255\"}"
}
]
},
"success": true,
"t": 1642506201984
}
jmcollin78 commented 2 years ago

Same problem here with the BSeed Tuya Socket with power monitoring. The product can be seen here: https://fr.aliexpress.com/item/1005003121810293.html?gatewayAdapt=glo2fra&spm=a2g0o.9042311.0.0.1f716c374GWKuD

Here are the logs. We can see that power is disabled by integration:

 "data": {
    "endpoint": "https://openapi.tuyaeu.com",
    "auth_type": 0,
    "country_code": "33",
    "app_type": "smartlife",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "devices": [
      {
        "name": "Prise t\u00e9l\u00e9",
        "model": "",
        "category": "cz",
        "product_id": "uvbhl96dsubgimll",
        "product_name": "Measure Socket(WIFI+BLE)",
        "online": true,
        "sub": false,
        "time_zone": "+01:00",
        "active_time": "2022-02-19T15:50:08+00:00",
        "create_time": "2022-02-19T15:50:08+00:00",
        "update_time": "2022-02-19T15:50:32+00:00",
        "function": {
          "switch_1": {
            "type": "Boolean",
            "value": {}
          },
          "countdown_1": {
            "type": "Integer",
            "value": {
              "unit": "s",
              "min": 0,
              "max": 86400,
              "scale": 0,
              "step": 1
            }
          },
          "relay_status": {
            "type": "Enum",
            "value": {
              "range": [
                "power_off",
                "power_on",
                "last"
              ]
            }
          },
          "light_mode": {
            "type": "Enum",
            "value": {
              "range": [
                "relay",
                "pos",
                "none"
              ]
            }
          },
          "child_lock": {
            "type": "Boolean",
            "value": {}
          },
          "cycle_time": {
            "type": "String",
            "value": {}
          },
          "random_time": {
            "type": "String",
            "value": {}
          }
        },
        "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": {
              "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": 80000,
              "scale": 1,
              "step": 1
            }
          },
          "cur_voltage": {
            "type": "Integer",
            "value": {
              "unit": "V",
              "min": 0,
              "max": 5000,
              "scale": 1,
              "step": 1
            }
          },
          "relay_status": {
            "type": "Enum",
            "value": {
              "range": [
                "power_off",
                "power_on",
                "last"
              ]
            }
          },
          "light_mode": {
            "type": "Enum",
            "value": {
              "range": [
                "relay",
                "pos",
                "none"
              ]
            }
          },
          "child_lock": {
            "type": "Boolean",
            "value": {}
          },
          "cycle_time": {
            "type": "String",
            "value": {}
          },
          "random_time": {
            "type": "String",
            "value": {}
          }
        },
        "status": {
          "switch_1": true,
          "countdown_1": 0,
          "add_ele": 27,
          "cur_current": 359,
          "cur_power": 724,
          "cur_voltage": 2483,
          "relay_status": "last",
          "light_mode": "relay",
          "child_lock": false,
          "cycle_time": "",
          "random_time": ""
        },
        "home_assistant": {
          "name": "Prise t\u00e9l\u00e9",
          "name_by_user": null,
          "disabled": false,
          "disabled_by": null,
          "entities": [
            {
              "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": "config",
              "device_class": null,
              "original_device_class": null,
              "icon": null,
              "original_icon": "mdi:account-lock",
              "unit_of_measurement": null,
              "state": {
                "entity_id": "switch.measure_socket_wifi_ble_2_child_lock",
                "state": "off",
                "attributes": {
                  "icon": "mdi:account-lock",
                  "friendly_name": "Prise t\u00e9l\u00e9 Child Lock"
                },
                "last_changed": "2022-02-19T16:27:36.115308+00:00",
                "last_updated": "2022-02-19T16:27:36.115308+00:00"
              }
            },
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": "config",
              "device_class": null,
              "original_device_class": "tuya__light_mode",
              "icon": null,
              "original_icon": null,
              "unit_of_measurement": null,
              "state": {
                "entity_id": "select.measure_socket_wifi_ble_2_indicator_light_mode",
                "state": "relay",
                "attributes": {
                  "options": [
                    "relay",
                    "pos",
                    "none"
                  ],
                  "device_class": "tuya__light_mode",
                  "friendly_name": "Prise t\u00e9l\u00e9 Indicator Light Mode"
                },
                "last_changed": "2022-02-19T16:27:36.291460+00:00",
                "last_updated": "2022-02-19T16:27:36.291460+00:00"
              }
            },
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": null,
              "device_class": "outlet",
              "original_device_class": "outlet",
              "icon": "mdi:television-box",
              "original_icon": null,
              "unit_of_measurement": null,
              "state": {
                "entity_id": "switch.prise_tele",
                "state": "on",
                "attributes": {
                  "device_class": "outlet",
                  "icon": "mdi:television-box",
                  "friendly_name": "Prise T\u00e9l\u00e9"
                },
                "last_changed": "2022-02-19T16:27:36.115490+00:00",
                "last_updated": "2022-02-19T16:27:36.115490+00:00"
              }
            },
            {
              "disabled": true,
              "disabled_by": "integration",
              "entity_category": null,
              "device_class": "power",
              "original_device_class": "power",
              "icon": "mdi:lightning-bolt",
              "original_icon": null,
              "unit_of_measurement": "W",
              "state": null
            },
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": "config",
              "device_class": "tuya__relay_status",
              "original_device_class": "tuya__relay_status",
              "icon": null,
              "original_icon": null,
              "unit_of_measurement": null,
              "state": {
                "entity_id": "select.prise_tele_power_on_behavior",
                "state": "last",
                "attributes": {
                  "options": [
                    "power_off",
                    "power_on",
                    "last"
                  ],
                  "device_class": "tuya__relay_status",
                  "friendly_name": "Prise t\u00e9l\u00e9 Power on Behavior"
                },
                "last_changed": "2022-02-19T16:27:36.291245+00:00",
                "last_updated": "2022-02-19T16:27:36.291245+00:00"
              }
            }
          ]
        }
      },
isabido commented 2 years ago

The exact same thing happens to me with this device.

https://www.koogeek.com/p-klsp1-1.html KLSP1-Smart plug

It does not show the 3 sensors available. With the integration of LOCAL TUYA it works correctly.

Kedryn commented 2 years ago

Same here, with tuya smart plugs

geeneo commented 1 year ago

Same here Connex plug.

Kedryn commented 1 year ago

you have to ACTIVATE them, dunno why they start dractivated i searched for days for the same problem, then someone in a telegram chat told me to enable them (all 3) and reboot HA (wasn't really needed). After few minutes, they appeared.

geeneo commented 1 year ago

I do not see any deactivated devices.

image

ziki77 commented 1 year ago

you have to ACTIVATE them, dunno why they start dractivated i searched for days for the same problem, then someone in a telegram chat told me to enable them (all 3) and reboot HA (wasn't really needed). After few minutes, they appeared.

Hi, where I can enable them? Which file I have to edit? Thanks

louispires commented 1 year ago

I also do not see any Power Entities - None are even disabled...

Connex Connect - CC-P1003 image

SauRoNZA commented 1 year ago

you have to ACTIVATE them, dunno why they start dractivated i searched for days for the same problem, then someone in a telegram chat told me to enable them (all 3) and reboot HA (wasn't really needed). After few minutes, they appeared.

Unfortunately not the case for this particular chipset.

It seems support needs to be added to the integration.