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

Unable to add Multimode Gateway #86

Open
NicolaP8 opened this issue Jan 9, 2024 · 5 comments
Open

Unable to add Multimode Gateway #86

NicolaP8 opened this issue Jan 9, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@NicolaP8
Copy link

NicolaP8 commented Jan 9, 2024

I'm trying to add a Moes Multimode Gateway (ZigBee+BLE, WiFi + Ethernet) but I get an "unkown" error.
I followed instructions and found IDs and keys. The "Local Key" is in the new format: ".>XL:@n7>TwN1[" (excluded the quotes).

This error originated from a custom integration.

Logger: custom_components.localtuya.config_flow
Source: custom_components/localtuya/config_flow.py:386
Integration: LocalTuya integration (documentation, issues)
First occurred: 19:34:08 (3 occurrences)
Last logged: 20:02:06

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 500, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/locks.py", line 387, in acquire
    await fut
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/localtuya/config_flow.py", line 386, in async_step_basic_info
    self.dps_strings = await validate_input(self.hass, user_input)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/config_flow.py", line 292, in validate_input
    detected_dps = await interface.detect_available_dps()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 702, in detect_available_dps
    status = await self.status()
             ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 602, in status
    status = await self.exchange(ACTION_STATUS)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 563, in exchange
    msg = await self.dispatcher.wait_for(seqno)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 325, in wait_for
    await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout)
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 502, in wait_for
    raise exceptions.TimeoutError() from exc
TimeoutError

@NicolaP8 NicolaP8 added the bug Something isn't working label Jan 9, 2024
@vshijiav
Copy link

I have the same error

@nigam-sa
Copy link

I am also having the same error while adding multimode gateway. Was able to add just the zigbee gateway without any issues.

@nigam-sa
Copy link

I enabled the debug trace and added the Multimode (Zigbee + Bluetooth) gateway via configuration.yaml and see following in the trace so its clear that reaching the device successfully but something in the localtuya code is causing it to disconnect.

2024-01-27 13:58:24.384 DEBUG (MainThread) [custom_components.localtuya] Device bf1xxxxxxxxxx5b1b9l4wu found with IP 192.168.68.97
2024-01-27 13:58:24.385 DEBUG (MainThread) [custom_components.localtuya.common] [bf1...4wu] Connecting to gateway 192.168.68.97
2024-01-27 13:58:24.474 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf1...4wu] Started heartbeat loop
2024-01-27 13:58:24.475 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf1...4wu] Sending command heartbeat (device type: type_0d)
2024-01-27 13:58:24.475 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf1...4wu] Send payload: b'{}'
2024-01-27 13:58:24.479 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf1...4wu] Waiting for sequence number -100
2024-01-27 13:58:24.481 DEBUG (MainThread) [custom_components.localtuya.common] [bf1...4wu] Connected to gateway 192.168.68.97 successfully
2024-01-27 13:58:24.481 DEBUG (MainThread) [custom_components.localtuya.common] [bf1...4wu] Attempting to reconnect 0 subdevices
2024-01-27 13:58:24.565 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf1...4wu] Connection lost: [Errno 104] Connection reset by peer
2024-01-27 13:58:24.566 DEBUG (MainThread) [custom_components.localtuya.common] [bf1...4wu] Sending event_disconnected to 0 subdevices
2024-01-27 13:58:24.566 DEBUG (MainThread) [custom_components.localtuya.common] [bf1...4wu] Disconnected (TuyaGatewayDevice) - waiting for discovery broadcast
2024-01-27 13:58:24.570 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf1...4wu] Heartbeat failed due to timeout, disconnecting

@tangobones
Copy link

I'm getting the same error. Any idea of how to make it work?

@nigam-sa
Copy link

@leeyuentuen - please can you look into this. this is being outstanding for a while now. If you need any traces or help in reproducing pls. let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants