rospogrigio / localtuya

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

Error when adding device #997

Open alfwro13 opened 2 years ago

alfwro13 commented 2 years ago

I'm trying to add Aubess Smart Switch with EM - it fails with error: An unknown error occurred. See log for details. Log file below

Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:247 Integration: LocalTuya integration (documentation, issues) First occurred: 20:07:52 (8 occurrences) Last logged: 20:11:27

[bf9...cai] Failed to get status: Traceback (most recent call last): File "/usr/local/lib/python3.10/asyncio/locks.py", line 390, 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.10/asyncio/tasks.py", line 456, in wait_for return 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.10/asyncio/tasks.py", line 458, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError

Merril-r commented 2 years ago

I get the same error when trying to add device.

I am not sure if it is related, the local key also does not pull through. I have reconfigured the cloud API account. Still does not pull it through.

Should I log this as a separate issue?

nicodeur commented 2 years ago

I get the same problem.

Local key seems bad, it is separated by point like : aiu...k2p . Impossible to get the local key on tuya Iot platform

remlei commented 2 years ago

I also get this error, the only fix is make sure that Home Assistant have internet access and doesnt block connection to tuya IP and domains, same with the tuya device as well and when you query with Tuya API when getting the localkey, make sure that its status it queried is set to online, if its offline, you will have this issue.

Merril-r commented 2 years ago

I also get this error, the only fix is make sure that Home Assistant have internet access and doesnt block connection to tuya IP and domains, same with the tuya device as well and when you query with Tuya API when getting the localkey, make sure that its status it queried is set to online, if its offline, you will have this issue.

Could you explain what you mean by having it set online.

My instance does have internet. When I select the device I want to add no local is returned. So you manually enter it. Then when I have entered all the details and want to add I get error.

This the first time I am adding devices since I upgrade to version 4.0

jamieFL commented 2 years ago

I am getting the identical error with a MHCOZY (1-433) wifi relay. I can switch the relay from the Smartlife app, with Alexa, and also the HA Cloud based Integration...all while connected to wifi. I've verified that my device and secret keys are good.

The funny thing is that I have the same relays, but with the double version (2-RF), and they work fine with Local Tuya.

The 2-RF is using firmware version 1.1.5. The 1-433 is on V1.2.1.

Pazh02 commented 1 year ago

Aubess Smart Switch

I also have 2 this switches with new revision

Old revision have protocol Tuya 3.3 and work with localtuya But new revision have protocol Tuya 3.4 and can't be added to localtuya now because localtuya support only version 3.1 and 3.3

See https://github.com/rospogrigio/localtuya/issues/927#issuecomment-1186381604 or https://github.com/rospogrigio/localtuya/issues/983#issuecomment-1240435465