rospogrigio / localtuya

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

Failed to get status #698

Open akeslo opened 2 years ago

akeslo commented 2 years ago

The problem

Cannot get passed the "Add Tuya Device" screen. The following error is displayed:

"An unknown error occurred. See log for details."

MacMini-ScreenShot-2022-01-08

Environment

Steps to reproduce

  1. Go to setup screen, use auto discover
  2. Enter configuration details
  3. Click to add tuya device

Configuration configuration.yaml or config_flow

I have no yaml specific to localtuya

DP dump

''' INFO:localtuya:localtuya version 1.0.0 INFO:localtuya:Python 3.9.9 (main, Nov 21 2021, 03:16:13) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin INFO:localtuya:Using pytuya version '8.1.0' INFO:localtuya:Detecting list of available DPS of device eb010bbc92f26a28d3imc8 [192.168.5.5], protocol 3.3. DEBUG:localtuya.pytuya:Sending command status (device type: type_0a) DEBUG:localtuya.pytuya:paylod=b'{"gwId":"eb010bbc92f26a28d3imc8","devId":"eb010bbc92f26a28d3imc8"}' DEBUG:localtuya.pytuya:DATA RECEIVED! DEBUG:localtuya.pytuya:decode payload=b"\xf1\xbd\xdes\x91\xe4l\xcf\xa7\xcc?\xdc\xc2\xf1458\xef\x9b]\xe6\x8b1'~\x1e\xb6n\xd6B(\x100\x9dE\x1c\xa1\xbf\xb6\x81\x0eL\xa0!,\xb0,TJ\xce\xa1\xc3\xa7^s\x15E\x1c\xb9_nB\xa0\xd4" DEBUG:localtuya.pytuya:decrypted result='{"dps":{"1":true,"3":2,"13":false,"15":false,"22":"cancel"}}' AVAILABLE DPS ARE [{'1': True, '3': 2, '13': False, '15': False, '22': 'cancel'}] INFO:localtuya:COMPLETE response from device eb010bbc92f26a28d3imc8 [192.168.5.5].

deviceInfo returned OK

TuyaDebug (Tuya DPs dump) [1.0.0]

Device eb010bbc92f26a28d3imc8 at 192.168.5.5 key protocol 3.3 dev_type type_0a: DPS [1] VALUE [True] DPS [3] VALUE [2] DPS [13] VALUE [False] DPS [15] VALUE [False] DPS [22] VALUE [cancel] '''

Provide Home Assistant taceback/logs

''' Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:247 Integration: LocalTuya (documentation, issues) First occurred: 11:25:11 PM (1 occurrences) Last logged: 11:25:11 PM

[eb0...mc8] Failed to get status: Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/locks.py", line 413, in acquire await fut asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for fut.result() asyncio.exceptions.CancelledError

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

Traceback (most recent call last): File "/config/custom_components/localtuya/pytuya/init.py", line 539, in detect_available_dps data = await self.status() File "/config/custom_components/localtuya/pytuya/init.py", line 481, in status status = await self.exchange(STATUS) File "/config/custom_components/localtuya/pytuya/init.py", line 460, in exchange msg = await self.dispatcher.wait_for(seqno) File "/config/custom_components/localtuya/pytuya/init.py", line 247, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.9/asyncio/tasks.py", line 494, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError ''' ... Logger: custom_components.localtuya.config_flow Source: custom_components/localtuya/pytuya/init.py:247 Integration: LocalTuya (documentation, issues) First occurred: 11:25:11 PM (1 occurrences) Last logged: 11:25:11 PM

Unexpected exception Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/locks.py", line 413, in acquire await fut asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for fut.result() 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 283, in async_step_basic_info self.dps_strings = await validate_input(self.hass, user_input) File "/config/custom_components/localtuya/config_flow.py", line 196, in validate_input detected_dps = await interface.detect_available_dps() File "/config/custom_components/localtuya/pytuya/init.py", line 539, in detect_available_dps data = await self.status() File "/config/custom_components/localtuya/pytuya/init.py", line 481, in status status = await self.exchange(STATUS) File "/config/custom_components/localtuya/pytuya/init.py", line 460, in exchange msg = await self.dispatcher.wait_for(seqno) File "/config/custom_components/localtuya/pytuya/init.py", line 247, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.9/asyncio/tasks.py", line 494, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError '''

Additional information

ScorpN commented 2 years ago

does this problem have a solution? I have a similar situation when adding a second device.