-
Notifications
You must be signed in to change notification settings - Fork 566
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
Cannot Add Devices to LocalTuya #1840
Comments
I am also getting this error. Not sure if you want me to create a new issue or just add to this one though. Happy to create a new issue if that's preferred. The problemWhile trying to add a new device the following happens:
EnvironmentLocaltuya version: 5.2.1 (installed from HACS) Does the device work using the Home Assistant Tuya Cloud component? Yes
Are you using the Tuya/SmartLife App in parallel ? The Tuya app is installed and working on my phone. Steps to reproduce
Logs
|
I have the same problem with python3.12, v5.2.2
|
I have the same problem:
|
I have same Problem
|
Same here! Newly added devices are not showing up in the list and can't even be configured manually. This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/localtuya/discovery.py:67
integration: LocalTuya (documentation, issues)
First occurred: 5:08:06 PM (12 occurrences)
Last logged: 5:09:01 PM
Error doing job: Exception in callback _SelectorDatagramTransport._read_ready() (None)
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()
^^^^^^^^^^^^^^^^^^^^
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 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1238, 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 0xfb in position 0: invalid start byte |
I have solved the problem following this comment in another tread (using another fork of localtuya) #1452 (comment) |
Perfect! Thank you that solved the issue for me. Thank you so much. |
Definitely works. Thanks! However, I still have trouble discovering devices. Did you manage to get it working or just added everything manually? |
Like you not all my devices were discovered (just one was missing) but I added it manually and it worked. Even not discovering the device after entering the initial information (IP, Local Key, device ID) this forked version of local tuya was able to map the dp_ids. So far so good! |
The problem
While trying to add a new device the following happens:
The latter happens when using protocol v3.3. Any other protocol does not display an error but also doesn't add the device.
Environment
Steps to reproduce
DP dump
Provide Home Assistant traceback/logs
I also get
Device status: {'Error': 'Unexpected Payload from Device', 'Err': '904', 'Payload': None}
when running the following example from TinyTuya:One of the problems might be that tinytuya is considering an IP range for which the devices are not there.
The text was updated successfully, but these errors were encountered: