rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.72k stars 532 forks source link

ZY-M201-WIFI datapoint missing #1686

Open botfixer opened 3 months ago

botfixer commented 3 months ago

The problem

i am using a tuya presence sensor ZY-M201-Wifi. It´s working great. But i cannot configure the datapoint for changing the sensivity of the sensor. It´s DP 2. When i try to add, it´s not listed in the configuration dialog.

Environment

Steps to reproduce

Try to configure additional Datapoint especially DP2 is not listed, but it´s listed in the properties from the tuya API Explorer.

DP dump

{ "result": { "properties": [ { "code": "presence_state", "custom_name": "", "dp_id": 1, "time": 1710072243967, "value": "move" }, { "code": "sensitivity", "custom_name": "", "dp_id": 2, "time": 1710071379919, "value": 4 }, { "code": "far_detection", "custom_name": "", "dp_id": 4, "time": 1709535959098, "value": 350 }, { "code": "target_dis_closest", "custom_name": "", "dp_id": 9, "time": 1710072604780, "value": 150 }, { "code": "man_state", "custom_name": "", "dp_id": 101, "time": 1710071909118, "value": "exist" }, { "code": "fading_time", "custom_name": "", "dp_id": 102, "time": 1709617634144, "value": 20 }, { "code": "illuminance_value", "custom_name": "", "dp_id": 104, "time": 1710072678285, "value": 208 }, { "code": "presence_sensitivity", "custom_name": "", "dp_id": 111, "time": 1710071379895, "value": 6 } ] }, "success": true, "t": 1710072690991, "tid": "5457cbd2ded711ee9db8d22de6f619e9" }

Additional information

Some Screenshots: 1 Picture shows the configured an working datapoint, Picture 2 shows the datapoint which are listed, but DP2 an DP111 is missing.

Picture 1:

picture_1

Picture 2:

picture_2
marrakeshn commented 3 months ago

my is ZG-205W, working great via Tuya cloud, but not locally (always clear state)(( here's my entities:

image image image
marrakeshn commented 3 months ago

Second same sensor has got much more entities to choose but also not working((

image
botfixer commented 3 months ago

Sometimes the values ​​returned by a tuya device are different.

The best thing to do is to get a tuya developer account. There you can link your existing Tuya User account and all the devices it contains in a project.

There is an API Explorer. This allows you to retrieve the values ​​that a sensor supplies under "Device Control (Standard Instruction Set).

Here is an example from the ZY-M100. There the data point for motion supplies, for example, "none" and "presence". If you put the wrong values in tuya local, it can have an effect like you describe.

{ "result": { "category": "hps", "functions": [ { "code": "sensitivity", "desc": "{\"min\":0,\"max\":9,\"scale\":0,\"step\":1}", "name": "灵敏度", "type": "Integer", "values": "{\"min\":0,\"max\":9,\"scale\":0,\"step\":1}" }, { "code": "near_detection", "desc": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}", "name": "最近距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" }, { "code": "far_detection", "desc": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}", "name": "最远距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" } ], "status": [ { "code": "presence_state", "name": "存在状态", "type": "Enum", "values": "{\"range\":[\"none\",\"presence\"]}" }, { "code": "sensitivity", "name": "灵敏度", "type": "Integer", "values": "{\"min\":0,\"max\":9,\"scale\":0,\"step\":1}" }, { "code": "near_detection", "name": "最近距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" }, { "code": "far_detection", "name": "最远距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" }, { "code": "checking_result", "name": "设备自检结果", "type": "Enum", "values": "{\"range\":[\"checking\",\"check_success\",\"check_failure\",\"others\",\"comm_fault\",\"radar_fault\"]}" }, { "code": "target_dis_closest", "name": "目标物最近距离", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":1}" } ] }, "success": true, "t": 1711030258211, "tid": "d6bd47abe78c11eeb8e44adb5c011a40" }

marrakeshn commented 3 months ago

Sometimes the values ​​returned by a tuya device are different.

The best thing to do is to get a tuya developer account. There you can link your existing Tuya User account and all the devices it contains in a project.

There is an API Explorer. This allows you to retrieve the values ​​that a sensor supplies under "Device Control (Standard Instruction Set).

Here is an example from the ZY-M100. There the data point for motion supplies, for example, "none" and "presence". If you put the wrong values in tuya local, it can have an effect like you describe.

{ "result": { "category": "hps", "functions": [ { "code": "sensitivity", "desc": "{\"min\":0,\"max\":9,\"scale\":0,\"step\":1}", "name": "灵敏度", "type": "Integer", "values": "{\"min\":0,\"max\":9,\"scale\":0,\"step\":1}" }, { "code": "near_detection", "desc": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}", "name": "最近距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" }, { "code": "far_detection", "desc": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}", "name": "最远距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" } ], "status": [ { "code": "presence_state", "name": "存在状态", "type": "Enum", "values": "{\"range\":[\"none\",\"presence\"]}" }, { "code": "sensitivity", "name": "灵敏度", "type": "Integer", "values": "{\"min\":0,\"max\":9,\"scale\":0,\"step\":1}" }, { "code": "near_detection", "name": "最近距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" }, { "code": "far_detection", "name": "最远距离检测", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}" }, { "code": "checking_result", "name": "设备自检结果", "type": "Enum", "values": "{\"range\":[\"checking\",\"check_success\",\"check_failure\",\"others\",\"comm_fault\",\"radar_fault\"]}" }, { "code": "target_dis_closest", "name": "目标物最近距离", "type": "Integer", "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":1}" } ] }, "success": true, "t": 1711030258211, "tid": "d6bd47abe78c11eeb8e44adb5c011a40" }

I already use tuyaiot website, also I use tinytuya python script, nothing helps. Could u help me with last form pls

image image
botfixer commented 3 months ago

Can´t give any help without Information about Device Information.

Log in into Tuya IoT account and dump the Instruction from the device with API Explorer:

Login into Tuya Developer account.

Klick on "Cloud" (from left Navigation Pane) -> API Explorer -> Open your Project ("Open Project" link on the right side)

Click on Devices Tab and grab the Device ID from your ZY-M201

Click again on Cloud and choose API Explorer:

Under "Device Control (Standard Instruction Set)" put in the Device ID, and klick on "submit request" (you need to scroll down for the submit button):

grafik

Post the output here.