rospogrigio / localtuya

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

Connection to device succeeded but no datapoints found #1396

Open adishani opened 1 year ago

adishani commented 1 year ago

The problem

While adding a new switch using local tuya, I recieve "Connection to device succeeded but no datapoints"

Logs:

Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:450 Integration: LocalTuya integration (documentation, issues) Last logged: 07:29:01

[bf1...5gl] Failed to get status: [006...cd7] Failed to get status: 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/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 790, in exchange return await self.exchange(command, dps) 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.10/asyncio/tasks.py", line 458, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError

aechile commented 1 year ago

Same error since the last update of "addon_a0d7b954_home-panel_2.6.0"

jckriplr commented 1 year ago

I faced with same issue on HA Core 2023.6.0 (installed with HASSOS) and LocalTuya 5.2.1. All devices were lost in configuration and it seems I'm unable to re-add them for this error. Furthermore, during configuration, even with Cloud API configured, the local_keys weren't retrieved.

man55 commented 1 year ago

Have the same issue. Any suggestions?

darhooloo commented 1 year ago

Me too, HAOS(X86),2023.6,2 ;Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists.

Steve2017 commented 1 year ago

I just installed my 4th PC191HA (Arlec smart plug) and it doesn’t show the DPs for current, power and voltage, The previous three plugs (installed months ago) work fine.

The data is there in the attributes and I can see it in the Tuya/Arlec app. It also shows up in the Tuya integration, but not TuyaLocal. I’ll just have to create template sensors from the attributes if this can’t be fixed.

AlmostInteractive commented 1 year ago

I faced with same issue on HA Core 2023.6.0 (installed with HASSOS) and LocalTuya 5.2.1. All devices were lost in configuration and it seems I'm unable to re-add them for this error. Furthermore, during configuration, even with Cloud API configured, the local_keys weren't retrieved.

This exact thing is happening to me. It won't pull down any devices from the cloud and when I add them manually: image Connection to the device succeeded but no datapoints found, please try again.

josh-unwin commented 1 year ago

Same thing happening for me too

alanblake commented 1 year ago

Add me to the list also.

nathbullen commented 1 year ago

Running into this as well - I accidentaly reset the integration and had to add everything back. All my exisitng devices went in fine but a new one I was trying to add refuses to add, showing the same error as above.

Manually setting the DPs to override discovery worked, but then the entity was just continuously unavailable and all the DPs reported; "-1" as their state during setup.

cralwalker commented 1 year ago

Me too

Tosche71 commented 1 year ago

same issue for me, I've tried several things but still same issue (log included hereafter)

This error originated from a custom integration.

Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:450 Integration: LocalTuya (documentation, issues) First occurred: 14:40:26 (5 occurrences) Last logged: 14:58:12

[bfd...1c4] Failed to get status: Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/tasks.py", line 490, in wait_for return fut.result() ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/locks.py", line 387, 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.11/asyncio/tasks.py", line 492, in wait_for raise exceptions.TimeoutError() from exc TimeoutError

Forge36 commented 10 months ago

I did some debugging/trial and error.

It looks like this occurs after a device is added. If I restart home assistant the problem is goes away until the next device is added.