Open Moustik2002 opened 2 years ago
A few steps using manual discovery.
When i try to add my Gateway through the information i've gathered with Tuya API Explorer :
i encounter the error message : An unknown error occurred. See log for details.
The log shows two errors :
Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/__init__.py:240
Integration: LocalTuya integration (documentation, issues)
First occurred: 16:33:08 (1 occurrences)
Last logged: 16:33:08
[bfb...vuk] 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 510, in detect_available_dps
data = await self.status()
File "/config/custom_components/localtuya/pytuya/__init__.py", line 472, in status
status = await self.exchange(STATUS)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 451, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 240, 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
and
Logger: custom_components.localtuya.config_flow
Source: custom_components/localtuya/pytuya/init.py:240
Integration: localtuya (documentation, issues)
First occurred: 16:33:08 (1 occurrences)
Last logged: 16:33:08
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 279, in async_step_basic_info
self.dps_strings = await validate_input(self.hass, user_input)
File "/config/custom_components/localtuya/config_flow.py", line 192, in validate_input
detected_dps = await interface.detect_available_dps()
File "/config/custom_components/localtuya/pytuya/init.py", line 510, in detect_available_dps
data = await self.status()
File "/config/custom_components/localtuya/pytuya/init.py", line 472, in status
status = await self.exchange(STATUS)
File "/config/custom_components/localtuya/pytuya/init.py", line 451, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/init.py", line 240, 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
Any thought ?
I'm having the same problem on a fresh install on a raspberry pi 4 Buster. Home Assistant runs in a docker container (using the docker recommended image: ghcr.io/home-assistant/raspberrypi4-homeassistant:stable).
I have another system running Home Assistant OS. On that system localtuya detects tuya devices and I can set them up.
Is your system in docker or HAS OS?
If it's a docker issue, how do we get locatuya to work in docker?
So I tried to set up a device manually in configuration.yaml per the instructions...
localtuya:
- host: 172.23.167.171
device_id: xxxxx
local_key: xxxxx
friendly_name: Tuya Device
protocol_version: "3.3"
entities:
- platform: switch
friendly_name: Plug
id: 1
current: 18 # Optional
current_consumption: 19 # Optional
voltage: 20 # Optional
The device appears on the dashboard, but is grayed-out and doesn't work. I think this may be a network issue in docker, that it can't see the local network devices.
A little more info... I went into the container (docker exec -it homeassistant bash) and could ping and nmap all the devices on the local network. The container's network is "host" btw.
So maybe docker can see the devices, but something in localtuya can't see them when run via docker?
I hope I'm adding some useful info here and can get help to figure out what's wrong.
Thanks.
indeed i'm running HA through doker
Good to know. Hope we get a reply from someone who knows how to make this work.
Installing Home assistant OS VM to see if there is some change.
EDIT : Sadly same result on HA OS through VM what's your Core version on your VM @fivenote ?
If it's of any use, I'm seeing the same thing on a fresh install (PI 4, core-2021.11.4). My older VM instance (ova) is still working though (core-2021.10.6)
If it's of any use, I'm seeing the same thing on a fresh install (PI 4, core-2021.11.4). My older VM instance (ova) is still working though (core-2021.10.6)
Docker?
Installing Home assistant OS VM to see if there is some change.
EDIT : Sadly same result on HA OS through VM what's your Core version on your VM @fivenote ?
Latest… 2021.11.5
If it's of any use, I'm seeing the same thing on a fresh install (PI 4, core-2021.11.4). My older VM instance (ova) is still working though (core-2021.10.6)
Docker?
I'm a bit new to the core components of the HA setup.. the PI install is the 64bit image installation through the official docs. The old VM is just the OVA you can download from the site as well.
when I get into ssh and do docker --version
they both come back as version 20.10.9
Here's the log when I try to add a tuya device. I used the integration UI and manually entered the device id, local key and device IP.
2021-11-21 10:05:53 ERROR (MainThread) [custom_components.localtuya.pytuya] [121...0bd] 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 510, in detect_available_dps
data = await self.status()
File "/config/custom_components/localtuya/pytuya/__init__.py", line 472, in status
status = await self.exchange(STATUS)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 451, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 240, 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
2021-11-21 10:05:53 ERROR (MainThread) [custom_components.localtuya.config_flow] 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 279, in async_step_basic_info
self.dps_strings = await validate_input(self.hass, user_input)
File "/config/custom_components/localtuya/config_flow.py", line 192, in validate_input
detected_dps = await interface.detect_available_dps()
File "/config/custom_components/localtuya/pytuya/__init__.py", line 510, in detect_available_dps
data = await self.status()
File "/config/custom_components/localtuya/pytuya/__init__.py", line 472, in status
status = await self.exchange(STATUS)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 451, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 240, 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
yeah it's similar to my log error, seems to be bind to some timeout when integration would like to discover tuya devices on LAN from what i am understanding, or maybe it's trying to parse local id from tuya iot and can't. I'm an IT guy not a developper one, so i'm stuck.
Sadly there is no local tuya guys showing up so far, let's be patient... @mileperhour, @mrdarrengriffin are you there ?
nevermind the mention just above I've done a mistake ;) it is not related
Back to this subject, @fivenote and @paul-mulvihill are you using zigbee-hub for this purpose ? Maybe the root of my issue here so that why i wondering .
nevermind the mention just above I've done a mistake ;) it is not related
Back to this subject, @fivenote and @paul-mulvihill are you using zigbee-hub for this purpose ? Maybe the root of my issue here so that why i wondering .
Not using a zigbee-hub. I just have tuya bulbs and switches on my local subnet.
I may have figured out my problem. I made sure no smartlife app or Home Assistant instance was running and possibly connected to the devices. I also made sure the firewall lets in 6666/udp and 6667/udp. After that, localtuya detected all of them.
I thought I had done this before, but something must have still been connected to the devices. Tuya devices only allow one connection at a time and don’t seem to broadcast their presence when already connected.
Let me know if this helps any.
nevermind the mention just above I've done a mistake ;) it is not related
Back to this subject, @fivenote and @paul-mulvihill are you using zigbee-hub for this purpose ? Maybe the root of my issue here so that why i wondering .
Likewise no hub.. I have just done the same as @fivenote and it is working.. I didn't think the old instance would be maintaining the connection, blocking all else.
Tuya devices only allow one connection at a time and don’t seem to broadcast their presence when already connected.
Wow didn't expect this. I had to force close the Home Life app on my phone and the device connected instantly. No firewall rules needed on my end.
Same issue here. Running HA in Docker on an Unraid machine. Completely shut down my phone to try and get this to work and still get the same discovery screen as OP.
READ THIS FIRST:
The problem
Despite multiple tries to be able to browse my tuya devices on the pop up window to follow tutorial there is no way to show them, only "..."
Environment
Steps to reproduce
Created a dedicated Tuya IOT project, followed barely all tutorials speaking of it but sadly remained solution dried regardind my issue
Configuration
configuration.yaml
orconfig_flow
Provide Home Assistant taceback/logs
Additional information
I've followed among all tutos i remembered, Mark Watt Tech, reddit, TuyaApiKey guide ....
I use a Zigbee Hub and would like to know if there is specific process to be able to address my devices through it w/ local tuya
Thx in advance for the help you could provide !