Hey friends, this is one of my favorite integrations because I was dumb enough to buy 45 Tuya wifi overhead lights.
I’m getting a Failed to Set DP error. Everything worked fine for about 3-5 months until recently (maybe after an update?)
Now, some of my devices disconnect and become unavailable until I restart HASS or sometimes reload LocalTuya and then restart HASS. Here’s the error:
Logger: custom_components.localtuya.common
Source: custom_components/localtuya/pytuya/__init__.py:259
Integration: LocalTuya (documentation, issues)
First occurred: 2:35:47 AM (88 occurrences)
Last logged: 3:08:11 AM
[eb0...8jz] Failed to set DPs {20: True, 22: 40, 21: 'white', 23: 230}
[eb4...m7m] Failed to set DPs {1: True, 3: 46, 2: 'white'}
[eb6...1yb] Failed to set DPs {1: True, 3: 46, 2: 'white'}
[ebd...v1m] Failed to set DPs {1: True, 3: 46, 2: 'white'}
[ebe...7ha] Failed to set DPs {20: True, 22: 46, 21: 'white'}
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/locks.py", line 390, in acquire
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
return fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/localtuya/common.py", line 332, in set_dps
await self._interface.set_dps(states)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 557, in set_dps
return await self.exchange(SET, dps)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 486, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/__init__.py", line 259, in wait_for
await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout)
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
P.S. Watching closely, I noticed that sometimes the lights just go unavailable for a few seconds after I change a scene, then come back – until at some point they just won’t come back. (I.e. I change the scene, some of the lights go offline for about 5 seconds, but then can be controlled again.)