close
Skip to content

Holman WX1 Tap Timer won't Add to configuration #1951

Description

@jeeshofone

Describe the bug
When adding the WX1 Tap Timer to Home Assistant via either cloud or manual mechanisms the device does not add. I am adding the device via the hub after it is paired to Tuya. I can control the device with Tuya Cloud App. I am not leaving the IP address blank.
To Reproduce
Steps to reproduce the behavior including the device the issue was observed with:

  • Reset Device and remove from Tuya
  • Re:Pair To Tuya and close app
  • Use python -m tinytuya wizard to get devices
  • Use python -m tinytuya scan to get device details (device id, IP(static mapped in Opnsense), local key, version
  • Add to home assistant filling out all fields for the hub (device, ip, local key, version) the Sub device ID (tested with and without the sub device id)

Receive error:

Unable to connect to your device with those details. It could be an intermittent issue, or they may be incorrect.

Screenshot 2024-05-26 at 8 05 24 PM
Screenshot 2024-05-26 at 9 06 47 PM

  • reset device and try again (this was me testing for an issue in escaping keys with ',"_{ etc

Expected behavior
A clear and concise description of what you expected to happen.

  • I expected to be able to add the device as it is in the supported device list

Additional context
Add any other context about the problem here.
Discussed in #1309

TinyTuya Setup Wizard [1.13.2]

    Existing settings:
        API Key=<redacted>
        Secret=<redacted>
        DeviceID=<redacted>
        Region=eu

    Use existing credentials (Y/n):

Download DP Name mappings? (Y/n):


Device Listing

[
    {
        "name": "WX1 Tap Timer",
        "id": "<redacted>",
        "key": "<redacted>",
        "mac": "",
        "category": "kg",
        "product_name": "WX1 Tap Timer",
        "product_id": "zrsgzc8jktsricjj",
        "biz_type": 0,
        "model": "WX1TT",
        "sub": true,
        "icon": "https://images.tuyaeu.com/smart/icon/ay1556838860681oKmdO/ab17f6e4e677bba7d3868a7a57cfe5b7.png",
        "uuid": "<redacted>",
        "node_id": "111",
        "mapping": {},
        "parent": "<redacted>"
    },
    {
        "name": "Wi-Fi Socket",
        "id": "<redacted>",
        "key": "<redacted>",
        "mac": "",
        "category": "cz",
        "product_name": "Wi-Fi Socket",
        "product_id": "hzsl8cxxtpd0x56b",
        "biz_type": 0,
        "model": "Emate Socket",
        "sub": true,
        "icon": "https://images.tuyaeu.com/smart/icon/ay1556838860681oKmdO/a475d09a86f87279a5fb63d3e8bcba84.png",
        "uuid": "<redacted>",
        "node_id": "11B",
        "mapping": {
            "1": {
                "code": "switch_1",
                "type": "Boolean",
                "values": {}
            }
        },
        "parent": "<redacted>"
    },
    {
        "name": "Wi-Fi Hub",
        "id": "<redacted>",
        "key": "<redacted>",
        "mac": "7c:f6:66:c9:09:68",
        "uuid": "ec6019439941fa66",
        "sn": "1000376290074E",
        "category": "wg2",
        "product_name": "Wi-Fi Hub",
        "product_id": "lzjw7vgzngzrzy74",
        "biz_type": 0,
        "model": "EMateGateWay",
        "sub": false,
        "icon": "https://images.tuyaeu.com/smart/icon/ay1556838860681oKmdO/e47c08d07b3801b3ea8890b3f548bc7f.png",
        "mapping": {}
    },
    <other devices redacted>
]

>> Saving list to devices.json
    6 registered devices saved

>> Saving raw TuyaPlatform response to tuya-raw.json

Poll local devices? (Y/n):

Scanning local network for Tuya devices...
    2 local devices discovered

Polling local devices...
    [Gwen                     ] 10.10.0.118        - No Response
    [Kogan Bladeless Purifier ] 10.40.0.13         - [On]  - DPS: {'1': True, '2': '1', '3': 'close', '8': True, '9': 23, '10': 20, '11': '0', '12': 0, '13': 0, '102': False, '103': False, '106': '2', '107': False}
    [Kogan Smart Portable Air ] Error: No IP found
    [WX1 Tap Timer            ] Error: No IP found
    [Wi-Fi Hub                ] 10.40.0.180        - No Response
    [Wi-Fi Socket             ] Error: No IP found

>> Saving device snapshot data to snapshot.json


>> Saving IP addresses to devices.json
    3 device IP addresses found

Done.

(tiny) will@Wills-MacBook-Pro-4 tiny % python -m tinytuya scan

TinyTuya (Tuya device scanner) [1.13.2]

[Loaded devices.json - 6 devices]

Scanning on UDP ports 6666 and 6667 and 7000 for devices for 18 seconds...

Kogan Bladeless Purifier Fan Heater   Product ID = 3permbmoa6lq7zvu  [Valid Broadcast]:
    Address = 10.40.0.13   Device ID = <redacted> (len:22)  Local Key = <redacted>  Version = 3.3  Type = default, MAC = 50:8a:06:f0:15:c1
    Status: {'1': True, '2': '1', '3': 'close', '8': True, '9': 23, '10': 20, '11': '0', '12': 0, '13': 0, '102': False, '103': False, '106': '2', '107': False}
Wi-Fi Hub   Product ID = keyth3n5me5jqu95  [Valid Broadcast]:
    Address = 10.40.0.180   Device ID = <redacted> (len:22)  Local Key = <redacted>  Version = 3.3  Type = default, MAC = 7c:f6:66:c9:09:68
    Access rejected by 10.40.0.180 (check key): Invalid JSON Response from Device: devid not found
Scan completed in 18.055 seconds

Scan Complete!  Found 2 devices.
Broadcasted: 2
Versions: 3.3: 2

>> Saving device snapshot data to snapshot.json

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

  • can't do this as the device does not add.
    Please check if there are messages from Tuya Local in the Home
    Assistant log (Settings / System / Logs), and include those too.
2024-05-26 21:14:31.158 DEBUG (MainThread) [custom_components.tuya_local.device] Refreshing device state for Test
2024-05-26 21:14:31.158 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3
2024-05-26 21:14:31.235 DEBUG (MainThread) [custom_components.tuya_local.device] Retrying after exception <class 'AttributeError'> Network Error: Device Unreachable (0/3)
2024-05-26 21:14:31.235 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Bedroom Air Conditioner to 3.4
2024-05-26 21:14:31.287 DEBUG (SyncWorker_11) [custom_components.tuya_local.device] Test refreshed device state: {"Error": "Invalid JSON Response from Device", "Err": "900", "Payload": "devid not found"}
2024-05-26 21:14:31.287 WARNING (SyncWorker_11) [custom_components.tuya_local.device] Test protocol error 900: Invalid JSON Response from Device

Additionally:

2024-05-26 19:35:17.437 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Hub count: 0
2024-05-26 19:35:20.114 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Scanning network to get IP address for bfbd1b453049b3af8fvcvd.
2024-05-26 19:35:20.116 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  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 88, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp_session/__init__.py", line 199, in factory
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 295, 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 71, 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 73, 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 414, 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 375, in async_step_search
    local_device = await self.hass.async_add_executor_job(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tuya_local/config_flow.py", line 603, in scan_for_device
    return tinytuya.find_device(dev_id=id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tinytuya/core.py", line 641, in find_device
    client.bind(("", UDPPORT))
OSError: [Errno 98] Address in use```

however this issue is with the cloud add is gone once i uninstalled rospogrigio/localtuya

If applicable, add screenshots to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions