tuya-local icon indicating copy to clipboard operation
tuya-local copied to clipboard

ZY-M100-WIFI24G - not recognized as ZY-M100 in tuya local

Open Motya-HA opened this issue 1 year ago • 8 comments
trafficstars

This form is for reporting bugs. If you have encountered a bug, you should generally have some log messages or device diagnostics to show something is going wrong. If your problem is more of a question or a request for help, then Discussions is probably a more suitable venue.

Describe the bug For some reason Tuya presence sensor ZY-M100-WIFI is not recognized as such during new device addition

To Reproduce During "add device" process, ZY-M100-WIFI24G presence sensor device has following options:

Screenshot 2024-05-12 at 4 19 57 PM

Expected behavior Expected device been recognized as ZY-M100_WIFI

Additional context Parameters results from Tuya IoT platform

{ "result": [ { "active_time": 1715474703, "bind_space_id": "166925674", "category": "hps", "create_time": 1715474703, "custom_name": "Laundry Entry Presence Sensor ", "icon": "smart/icon/ay15431316572284AcPZ/bc0c8e066c89476de379df5cf1538fee.png", "id": "ebed371ad78c7473e84uu4", "ip": "xxxxxxxxxx", "is_online": true, "lat": "", "local_key": "xxxxxxxxxxxx", "lon": "", "model": "1.0.1", "name": "ZY-M100-WIFI24G存在传感器", "product_id": "4cjzlliucdjaanvl", "product_name": "ZY-M100-WIFI24G存在传感器", "sub": false, "time_zone": "-07:00", "update_time": 1715474751, "uuid": "11a9664989c658a4" } ], "success": true, "t": 1715555227412, "tid": "5aafb1a110b411efa6ed16994efa91b4" }

If the bug involves a device, then please include device diagnostics from Settings / Devices & Services / Tuya Local (your device) / "1 device"

Please check if there are messages from Tuya Local in the Home Assistant log (Settings / System / Logs), and include those too.

If applicable, add screenshots to help explain your problem.

Motya-HA avatar May 12 '24 23:05 Motya-HA

I cannot diagnose the issue without logs or diagnostics

make-all avatar May 12 '24 23:05 make-all

But I can't get logs or diagnostics if I can't add the device? What you would suggest to do?

Motya-HA avatar May 13 '24 00:05 Motya-HA

Ok Found something:

2024-05-12 15:29:07.365 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches yueqingcombo_yet848pc_curtain with quality of 33%. DPS: {"updated_at": 1715552943.5815408, "1": "none", "2": 4, "3": 150, "4": 300, "9": 27, "102": 6, "103": 1, "104": "nobody", "105": 20} 2024-05-12 15:29:07.365 WARNING (MainThread) [custom_components.tuya_local.config_flow] Report this to https://github.com/make-all/tuya-local/issues/

Motya-HA avatar May 13 '24 00:05 Motya-HA

this is another log:This error originated from a custom integration.

Logger: custom_components.tuya_local.config_flow Source: custom_components/tuya_local/config_flow.py:103 integration: Tuya Local (documentation, issues) First occurred: 3:29:07 PM (3 occurrences) Last logged: 4:19:37 PM

Report this to https://github.com/make-all/tuya-local/issues/

Motya-HA avatar May 13 '24 01:05 Motya-HA

This device does not appear to be compatible with the existing config for a device with a similar name.

Please also provide the details of the dps mappings from iot.tuya.com (the QueryThingsDataModel API result for your device)

make-all avatar May 13 '24 11:05 make-all

{
  "result": {
    "model": "{\"modelId\":\"f2pb7w\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[
{\"abilityId\":1,\"accessMode\":\"ro\",\"code\":\"presence_state\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-renxingyidong\",\"attribute\":\"1664\"},\"name\":\"感应状态\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"none\",\"presence\",\"move\"]}},
{\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"sensitivity\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1152\"},\"name\":\"运动灵敏度\",\"typeSpec\":{\"type\":\"value\",\"max\":10,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":3,\"accessMode\":\"rw\",\"code\":\"near_detection\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-gongneng\",\"attribute\":\"1152\"},\"name\":\"最近检测距离\",\"typeSpec\":{\"type\":\"value\",\"max\":900,\"min\":150,\"scale\":2,\"step\":75,\"unit\":\"M\"}},
{\"abilityId\":4,\"accessMode\":\"rw\",\"code\":\"far_detection\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-gongneng\",\"attribute\":\"1152\"},\"name\":\"最远检测距离\",\"typeSpec\":{\"type\":\"value\",\"max\":975,\"min\":150,\"scale\":2,\"step\":75,\"unit\":\"M\"}},
{\"abilityId\":9,\"accessMode\":\"ro\",\"code\":\"target_dis_closest\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_direction\",\"attribute\":\"1152\"},\"name\":\"目标距离\",\"typeSpec\":{\"type\":\"value\",\"max\":100,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"M\"}},
{\"abilityId\":102,\"accessMode\":\"rw\",\"code\":\"presence_sensitivity\",\"description\":\"\",\"name\":\"静止灵敏度\",\"typeSpec\":{\"type\":\"value\",\"max\":10,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"\"}},
{\"abilityId\":103,\"accessMode\":\"ro\",\"code\":\"illuminance_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-liangdu\",\"attribute\":\"4096\"},\"name\":\"光照度\",\"typeSpec\":{\"type\":\"value\",\"max\":10000,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"lux\"}},
{\"abilityId\":104,\"accessMode\":\"ro\",\"code\":\"man_state\",\"description\":\"\",\"name\":\"有无人状态\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"nobody\",\"exist\"]}},
{\"abilityId\":105,\"accessMode\":\"rw\",\"code\":\"delay_time\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"4096\"},\"name\":\"无人延迟时间\",\"typeSpec\":{\"type\":\"value\",\"max\":15000,\"min\":5,\"scale\":0,\"step\":1,\"unit\":\"S\"}}]}]}"
  },
  "success": true,
  "t": 1715636215990,
  "tid": "eb9a50e6117011efa6a242e5904d8239"
}

I hope this is what you need

Motya-HA avatar May 13 '24 21:05 Motya-HA

is anything still required from my side? I am just wondering what the next step will be

Motya-HA avatar May 17 '24 01:05 Motya-HA

No, nothing further is currently required, but don't expect too quick a response, as the queue is currently long and I do not have a lot of time to work on this.

make-all avatar May 17 '24 02:05 make-all

Hello I have updated to a new rev Tuya-local, but still the best fit for this sensor is PIR sensor:

This error originated from a custom integration.

Logger: custom_components.tuya_local.config_flow Source: custom_components/tuya_local/config_flow.py:483 integration: Tuya Local (documentation, issues) First occurred: 8:53:10 AM (3 occurrences) Last logged: 9:00:38 AM

Device matches pir_sensor with quality of 29%. DPS: {"updated_at": 1721058776.6194644, "1": "none", "3": 150, "4": 300, "9": 19, "103": 3, "104": "nobody", "105": 20} Device matches pir_sensor with quality of 29%. DPS: {"updated_at": 1721058871.0117857, "1": "none", "3": 150, "4": 300, "9": 19, "103": 3, "104": "nobody", "105": 20} Device matches pir_sensor with quality of 29%. DPS: {"updated_at": 1721059227.461468, "1": "presence", "3": 75, "4": 600, "9": 12, "103": 13, "104": "exist", "105": 5}

another warning I am getting: Logger: homeassistant.util.loop Source: util/loop.py:136 First occurred: 8:52:56 AM (3 occurrences) Last logged: 8:52:56 AM

Detected blocking call to walk with args ('/config/custom_components/tuya_local/devices',) inside the event loop by custom integration 'tuya_local' at custom_components/tuya_local/helpers/device_config.py, line 978: for path, dirs, files in walk(_CONFIG_DIR): (offender: /config/custom_components/tuya_local/helpers/device_config.py, line 978: for path, dirs, files in walk(_CONFIG_DIR):), please create a bug report at https://github.com/make-all/tuya-local/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#walk Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/config/custom_components/tuya_local/config_flow.py", line 436, in async_step_local return await self.async_step_select_type() File "/config/custom_components/tuya_local/config_flow.py", line 474, in async_step_select_type async for type in self.device.async_possible_types(): File "/config/custom_components/tuya_local/device.py", line 360, in async_possible_types for match in possible_matches(cached_state): File "/config/custom_components/tuya_local/helpers/device_config.py", line 986, in possible_matches for cfg in available_configs(): File "/config/custom_components/tuya_local/helpers/device_config.py", line 978, in available_configs for path, dirs, files in walk(_CONFIG_DIR): Detected blocking call to scandir with args ('/config/custom_components/tuya_local/devices',) inside the event loop by custom integration 'tuya_local' at custom_components/tuya_local/helpers/device_config.py, line 978: for path, dirs, files in walk(_CONFIG_DIR): (offender: , line 366: ?), please create a bug report at https://github.com/make-all/tuya-local/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#scandir Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/config/custom_components/tuya_local/config_flow.py", line 436, in async_step_local return await self.async_step_select_type() File "/config/custom_components/tuya_local/config_flow.py", line 474, in async_step_select_type async for type in self.device.async_possible_types(): File "/config/custom_components/tuya_local/device.py", line 360, in async_possible_types for match in possible_matches(cached_state): File "/config/custom_components/tuya_local/helpers/device_config.py", line 986, in possible_matches for cfg in available_configs(): File "/config/custom_components/tuya_local/helpers/device_config.py", line 978, in available_configs for path, dirs, files in walk(_CONFIG_DIR): Detected blocking call to open with args ('/config/custom_components/tuya_local/devices/9in1_airquality_monitor.yaml',) inside the event loop by custom integration 'tuya_local' at custom_components/tuya_local/helpers/device_config.py, line 101: self._config = load_yaml(filename) (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 226: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/make-all/tuya-local/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/config/custom_components/tuya_local/config_flow.py", line 436, in async_step_local return await self.async_step_select_type() File "/config/custom_components/tuya_local/config_flow.py", line 474, in async_step_select_type async for type in self.device.async_possible_types(): File "/config/custom_components/tuya_local/device.py", line 360, in async_possible_types for match in possible_matches(cached_state): File "/config/custom_components/tuya_local/helpers/device_config.py", line 987, in possible_matches parsed = TuyaDeviceConfig(cfg) File "/config/custom_components/tuya_local/helpers/device_config.py", line 101, in init self._config = load_yaml(filename)

Motya-HA avatar Jul 15 '24 16:07 Motya-HA