home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.75k stars 28.91k forks source link

Tuya Integration Not Showing Devices #110702

Closed blackshuck88 closed 4 months ago

blackshuck88 commented 4 months ago

The problem

Home Assistant Core: 2024.2.1 Supervisor 2024.01.1 Operating System 11.5 Frontend 20240207.1

Local Tuya: 5.2.1

Hi guys,

I don't see any devices listed in LocalTuya integration. My subscription at IoT Platform is valid. I see all my devices there. I tried to unlink and add again the SmartLife App but without success.

Then I tried to add a device manually but receive always the same error message: "Connection to device succeeded but no datapoints found, please try again."

I have all needed device details (Name, Host, Device ID and Local key) and tried with all shown protocols (3.1, 3.2, 3.3, 3.4)

I also can ping all devices from the HA terminal.

Thank you in advance for your support!

Here are two errors that I see in HA logs:

Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:863 Integration: LocalTuya integration (documentation, issues) First occurred: 08:08:21 (1 occurrences) Last logged: 08:08:21

[bf5...eva] Failed to get status: Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/locks.py", line 386, 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/pytuya/init.py", line 863, in detect_available_dps data = await self.status() ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 795, in status status = await self.exchange(DP_QUERY) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 769, in exchange msg = await self.dispatcher.wait_for(seqno, payload.cmd) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 450, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError


Logger: homeassistant Source: custom_components/localtuya/discovery.py:67 Integration: LocalTuya integration (documentation, issues) First occurred: 08:06:46 (240 occurrences) Last logged: 08:13:22

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.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 184, in finalize data = self._ctx.finalize() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 223, 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.12/asyncio/events.py", line 84, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1234, 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 0xf6 in position 0: invalid start byte


What version of Home Assistant Core has the issue?

2024.2.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Local Tuya

Link to integration documentation on our website

No response

Diagnostics information


Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:863 Integration: LocalTuya integration (documentation, issues) First occurred: 08:08:21 (1 occurrences) Last logged: 08:08:21

[bf5...eva] Failed to get status: Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/locks.py", line 386, 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/pytuya/init.py", line 863, in detect_available_dps data = await self.status() ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 795, in status status = await self.exchange(DP_QUERY) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 769, in exchange msg = await self.dispatcher.wait_for(seqno, payload.cmd) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/pytuya/init.py", line 450, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError


Logger: homeassistant Source: custom_components/localtuya/discovery.py:67 Integration: LocalTuya integration (documentation, issues) First occurred: 08:06:46 (240 occurrences) Last logged: 08:13:22

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.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 184, in finalize data = self._ctx.finalize() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 223, 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.12/asyncio/events.py", line 84, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1234, 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 0xf6 in position 0: invalid start byte


Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mib1185 commented 4 months ago

LocalTuya is a custom component, which is not maintained by the HA core project. Please report your issue to the maintainer or in the source repository of this custom component. Thx 👍