rospogrigio / localtuya

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

OHLUX GU24 Smart Bulb Connection to device succeeded but no datapoints found #1748

Open seeshaughnessy opened 1 month ago

seeshaughnessy commented 1 month ago

The problem

I'm trying to add two OHLUX GU24 smart bulbs (https://a.co/d/07JN8T2z), but they don't show up on the configuration list, and manually adding them shows the error:

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

Environment

Steps to reproduce

  1. In local tuya, press "CONFIGURE"
  2. "Add New Device"
  3. Select the "..."
  4. Filled out Device details and submitted.

Provide Home Assistant traceback/logs

Logger: homeassistant
Source: custom_components/localtuya/discovery.py:67
integration: LocalTuya (documentation, issues)
First occurred: 1:55:56 PM (104 occurrences)
Last logged: 2:00:11 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 0xc2 in position 0: invalid continuation byte

and

Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/__init__.py:863
integration: LocalTuya (documentation, issues)
First occurred: 2:00:01 PM (1 occurrences)
Last logged: 2:00:01 PM

[eb2...uqp] 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

Additional information

2rym commented 1 month ago

I'm struggling with this exact problem

thannerfabian commented 1 month ago

I have the same problem, but for switches only. For humidity and temperature sensors, it worked.

martinw72 commented 1 month ago

the same here, started with HA 2024.7.2!

thannerfabian commented 1 month ago

@martinw72 can you confirm that it worked with the version before 2024.7.2?

martinw72 commented 1 month ago

@thannerfabian I'm not sure, because I've not change my configuration, but get 10000 times the exact same entry I've not seen before 2024.7.2. But maybe my update and the flooded error logs are Independent of each other. My experience tells me that there is a connection between this two!

thannerfabian commented 4 weeks ago

@martinw72 did you already update to 2024.7.3?

martinw72 commented 4 weeks ago

Yes, I’m on 2024.7.3!

Am 25.07.2024 um 20:17 schrieb Fabian Thanner @.***>:

@martinw72 https://github.com/martinw72 did you already update to 2024.7.3?

— Reply to this email directly, view it on GitHub https://github.com/rospogrigio/localtuya/issues/1748#issuecomment-2251128868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTVMQ6S423LUDJYIE4EF5TZOE6J5AVCNFSM6AAAAABKVS4YQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJRGEZDQOBWHA. You are receiving this because you were mentioned.

regevbr commented 4 days ago

Exact same issue for me

[bf6...nxy] 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