localtuya icon indicating copy to clipboard operation
localtuya copied to clipboard

Error when adding ZigBee Smart Gateway

Open markfarina opened this issue 2 years ago • 3 comments

Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists.

markfarina avatar Oct 23 '22 06:10 markfarina

I am also experiencing this issue.

Gamrin avatar Oct 23 '22 17:10 Gamrin

I'm also: The connection to the device was successful but no datapoints were found, try again. Create a new issue and include debug logs if the problem persists

This is the log:

ERROR (MainThread) [custom_components.localtuya.pytuya] [bfa...k5t] Failed to get status: Traceback (most recent call last): File "/usr/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/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 "/home/homeassistant/.homeassistant/custom_components/localtuya/pytuya/init.py", line 574, in detect_available_dps data = await self.status() File "/home/homeassistant/.homeassistant/custom_components/localtuya/pytuya/init.py", line 507, in status status = await self.exchange(STATUS) File "/home/homeassistant/.homeassistant/custom_components/localtuya/pytuya/init.py", line 486, in exchange msg = await self.dispatcher.wait_for(seqno) File "/home/homeassistant/.homeassistant/custom_components/localtuya/pytuya/init.py", line 259, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/lib/python3.10/asyncio/tasks.py", line 458, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError

fco64 avatar Oct 25 '22 07:10 fco64

i am also experiencing this issue, often a reboot of home assitant fixes it temporaly

eimarfandino avatar Oct 29 '22 13:10 eimarfandino

What kind of data points your expecting on a zigbee bridge/gateway? Its a bridge/gateway for a reason.

Might as well just skip localtuya and grab a usb zigbee coordinator and use zha or z2m.

Localtuya's main job is to control or poll sensors and switches that wifi based tuya end devices.

remlei avatar Nov 25 '22 06:11 remlei

Same issue with Tuya Zigbee GW here with HA 2023.3.5 and LocalTuya v.5.1.0 . It works fine using cloud API (but recently got some Internet connection issues so I decided to switch to local). I have also this in HA logs:

Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
  File "/config/custom_components/localtuya/discovery.py", line 65, in datagram_received
    data = decrypt_udp(data)
  File "/config/custom_components/localtuya/discovery.py", line 30, in decrypt_udp
    return _unpad(decryptor.update(message) + decryptor.finalize()).decode()
  File "/usr/local/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 186, in finalize
    data = self._ctx.finalize()
  File "/usr/local/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 222, in finalize
    raise ValueError(
ValueError: The length of the provided data is not a multiple of the block length.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 1035, in _read_ready
    self._protocol.datagram_received(data, addr)
  File "/config/custom_components/localtuya/discovery.py", line 67, in datagram_received
    data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 13: invalid start byte

TomHejret avatar Mar 20 '23 21:03 TomHejret

I have introduced Zigbee support in PR #1493, if anybody wants to test it and provide feedback, please comment in the PR.

rospogrigio avatar Sep 14 '23 12:09 rospogrigio