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

add support for wenzhi wz-m100-w human presence sensor #2776

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

salbr
Copy link

@salbr salbr commented Jan 13, 2025

This device is not correctly identified by Tuya Local, as you can see in the logs:

2025-01-13 13:19:07.412 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Loaded device config zyhps01_human_presence_sensor.yaml
2025-01-13 13:19:07.412 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Not match for Human presence sensor, missing required DPs: [{'101': 'str'}, {'107': 'int'}, {'109': 'int'}, {'110': 'int'}, {'111': 'int'}, {'112': 'int'}]
2025-01-13 13:19:07.414 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Loaded device config zym100_presence_sensor.yaml
2025-01-13 13:19:07.414 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, missing required DPs: [{'101': 'int'}, {'102': 'int'}]
2025-01-13 13:19:07.416 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Loaded device config zym100w_presence_sensor.yaml
2025-01-13 13:19:07.416 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, DPs have incorrect type: [{'104': 'str'}]
2025-01-13 13:19:07.417 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Loaded device config zym201_presence_sensor.yaml
2025-01-13 13:19:07.417 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Not match for mmWave presence sensor, missing required DPs: [{'101': 'str'}, {'102': 'int'}]
2025-01-13 13:19:07.418 WARNING (MainThread) [custom_components.tuya_local.config_flow] Adding WiFi Human Presence Sensor device with product id wcd9lxpvhfvqx1qw
2025-01-13 13:19:07.418 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches inkbird_ipt2ch_thermostat with quality of 44%. DPS: {"updated_at": 1736770745.4653544, "1": "none", "2": 7, "3": 60, "4": 600, "9": 0, "103": 420, "104": 5, "105": 1, "106": 100}
2025-01-13 13:19:07.418 WARNING (MainThread) [custom_components.tuya_local.config_flow] Include the previous log messages with any new device request to https://github.com/make-all/tuya-local/issues/

It nearly matches the device config in zym100w_presence_sensor.yaml, but is wrongly detected as a thermostat.

I had to change the original scaling for near_detection, far_detection, target_dis_closest. Also illuminance_value was off by a factor of 10.

The interval_time data point does not show up in the tuya app, but i added it nonetheless.

Data from the device:

{
  "result": {
    "category": "hps",
    "model": "WZ-M100-W",
    "name": "WiFi Human Presence Sensor",
    "product_id": "wcd9lxpvhfvqx1qw",
    "product_name": "WiFi Human Presence Sensor"
  },
  "success": true,
  "t": 1736769218310,
  "tid": "069cade9d1a511ef9e5f9e9247cde4aa"
}

dps info:

{
  "result": {
    "properties": [
      {
        "code": "presence_state",
        "custom_name": "",
        "dp_id": 1,
        "time": 1736764971975,
        "type": "enum",
        "value": "none"
      },
      {
        "code": "sensitivity",
        "custom_name": "",
        "dp_id": 2,
        "time": 1736764658905,
        "type": "value",
        "value": 1
      },
      {
        "code": "near_detection",
        "custom_name": "",
        "dp_id": 3,
        "time": 1736764658927,
        "type": "value",
        "value": 20
      },
      {
        "code": "far_detection",
        "custom_name": "",
        "dp_id": 4,
        "time": 1736764658961,
        "type": "value",
        "value": 410
      },
      {
        "code": "target_dis_closest",
        "custom_name": "",
        "dp_id": 9,
        "time": 1736764971996,
        "type": "value",
        "value": 0
      },
      {
        "code": "illuminance_value",
        "custom_name": "",
        "dp_id": 103,
        "time": 1736769283410,
        "type": "value",
        "value": 2000
      },
      {
        "code": "interval_time",
        "custom_name": "",
        "dp_id": 104,
        "time": 1736764659105,
        "type": "value",
        "value": 3
      },
      {
        "code": "detection_delay",
        "custom_name": "",
        "dp_id": 105,
        "time": 1736764659079,
        "type": "value",
        "value": 1
      },
      {
        "code": "fading_time",
        "custom_name": "",
        "dp_id": 106,
        "time": 1736764659092,
        "type": "value",
        "value": 150
      }
    ]
  },
  "success": true,
  "t": 1736769381706,
  "tid": "68038eacd1a511ef9e5f9e9247cde4aa"
}
{
  "result": {
    "category": "hps",
    "functions": [
      {
        "code": "sensitivity",
        "desc": "{\"unit\":\"Lv\",\"min\":0,\"max\":9,\"scale\":0,\"step\":1}",
        "name": "灵敏度",
        "type": "Integer",
        "values": "{\"unit\":\"Lv\",\"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": "{\"unit\":\"Lv\",\"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": "target_dis_closest",
        "name": "目标物最近距离",
        "type": "Integer",
        "values": "{\"unit\":\"M\",\"min\":0,\"max\":1000,\"scale\":2,\"step\":10}"
      },
      {
        "code": "illuminance_value",
        "name": "光照度",
        "type": "Integer",
        "values": "{\"unit\":\"Lux\",\"min\":0,\"max\":10000,\"scale\":0,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": 1736769467835,
  "tid": "9b561c42d1a511efbbc9c2b21b10ca93"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

1 participant