Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya Integration Not Showing Devices #978

Open
blackshuck88 opened this issue Feb 17, 2024 · 2 comments
Open

Tuya Integration Not Showing Devices #978

blackshuck88 opened this issue Feb 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@blackshuck88
Copy link

Home Assistant Core: 2024.2.1
Supervisor 2024.01.1
Operating System 11.5
Frontend 20240207.1
Local Tuya: 5.2.1
Devices: Smart Bulbs

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 and they are linked properly to the SmartLife App. I tried to unlink and add again the SmartLife App at IoT Platform 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 can also 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


@blackshuck88 blackshuck88 added the bug Something isn't working label Feb 17, 2024
@blackshuck88
Copy link
Author

blackshuck88 commented Feb 17, 2024

I would also like to add that I can see all devices listed in diagnostics for integrations (config_entry-localtuya) but can't see them listed in the drop down menu when I try to add new device. And the Smart Life App is closed on all devices.
LocalTuya_Integration_Add Device

@blackshuck88
Copy link
Author

blackshuck88 commented Feb 20, 2024

I have finally found a solution by installing LocalTuya "fork from localtuya" provided by hass-localtuya
Here is detailed description.

To make it short. Here is the main installation guide:

1. Open HACS and navigate to Integrations Section.
2. Open the Overflow Menu (⋮) in the top right corner and click on Custom repositories.
3. Paste https://github.com/xZetsubou/localtuya into the input field and select Integration from the category dropdown then click ADD.
4. Now the integration should be added search in for it and install it!.

In my case the integration was already there. Just search for LocalTuya by xZetsubou. I didn't delete the previous version of LocalTuya.

I am impressed how stable this version is. Great job. Btw. This version uses the protocol 3.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant