rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.95k stars 563 forks source link

Log Persistent Error #1754

Open JoshC1994 opened 3 months ago

JoshC1994 commented 3 months ago

Receiving a Persistent Log Error

ERROR As shown in HA Log Below

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/localtuya/discovery.py:67 integration: LocalTuya (documentation, issues) First occurred: 5:52:40 PM (290 occurrences) Last logged: 5:58:43 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() ^^^^^^^^^^^^^^^^^^^^ 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 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 0xc7 in position 1: invalid continuation byte

image

martinw72 commented 3 months ago

There a more threads at the moment with the same or similar problems. The log lines are always the same. ...in addition I realized that it is not possible to add any new devices after this error occures. If you remove an existing device and add it again, this will work, but now new one's.

martinw72 commented 3 months ago

there are at least 3 related bug report: 1754, 1748, 1744...

corgan2222 commented 3 months ago

same issue here.. This error emerges every few seconds and I can only see half of my devices in the "add new device list".

sdekker90 commented 2 months ago

Same issues as described above here. I'm on HA Core 2024.9.0 and Localtuya 5.2.1