localtuya icon indicating copy to clipboard operation
localtuya copied to clipboard

Connection to device succeeded but no datapoints found, please try again.

Open milandzuris opened this issue 1 year ago • 98 comments

The problem

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

This error originated from a custom integration.

Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:259 Integration: LocalTuya (documentation, issues) First occurred: 21:58:29 (5 occurrences) Last logged: 22:02:00

[bf4...igc] Failed to get status: [bf5...nqh] 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 574, in detect_available_dps data = await self.status() File "/config/custom_components/localtuya/pytuya/init.py", line 507, in status status = await self.exchange(STATUS) 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

Environment

core 9.0.4 tuya newest

milandzuris avatar Sep 21 '22 20:09 milandzuris

I have the same issue. it's recent because my older local tuya setup (with the most recent version) is supporting a light that I can't get loaded into a new instance of local tuya.

SergeantPup avatar Sep 22 '22 00:09 SergeantPup

Same issue here, adding devices in a clean install


Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/__init__.py:259
Integration: LocalTuya integration ([documentation](https://github.com/rospogrigio/localtuya/), [issues](https://github.com/rospogrigio/localtuya/issues))
First occurred: 10:09:16 p. m. (2 occurrences)
Last logged: 10:12:10 p. m.

[bf9...7oy] 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 574, in detect_available_dps
    data = await self.status()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 507, in status
    status = await self.exchange(STATUS)
  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

kevvar avatar Sep 22 '22 04:09 kevvar

same error

Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:259 Integration: LocalTuya integration (documentation, issues) First occurred: 2022. szeptember 22. 19:54:40 (6 occurrences) Last logged: 07:37:42

[202...4dd] 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 574, in detect_available_dps data = await self.status() File "/config/custom_components/localtuya/pytuya/init.py", line 507, in status status = await self.exchange(STATUS) 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

azsak79 avatar Sep 23 '22 05:09 azsak79

please fix this

milandzuris avatar Sep 23 '22 19:09 milandzuris

Amendment: Worked round by setting DPIDs. All good after that.

Original: Precisely the same issue here. No issues previously - a fix would be great as just bought a load of new sockets, not foreseeing a problem.

Odinlistening avatar Sep 26 '22 09:09 Odinlistening

Amendment: Worked round by setting DPIDs. All good after that.

How do you get that info and where to configure it?. I'm sorry I'm newby in this things Thanks

kevvar avatar Sep 26 '22 12:09 kevvar

Amendment: Worked round by setting DPIDs. All good after that.

How do you get that info and where to configure it?. I'm sorry I'm newby in this things Thanks

I managed to find the original instructions to get these into local tuya: https://community.home-assistant.io/t/tuya-local/237963/116 This contains the DPS information you need.

Go into local tuya, add a new device, fill in the name, and local key. In the second to last field, in manual DPS, enter a 1. Click submit and wait. When the box pops up, change it to light.

Now you have to fill in the DPS values. If you follow the DPS schema from the hyperlink above, the lights will work. I just did this for two separate lights and I have them in now.

SergeantPup avatar Sep 27 '22 02:09 SergeantPup

@SergeantPup Thanks bro, but my device is a switch like this one I'll keep trying combinations

kevvar avatar Sep 27 '22 03:09 kevvar

Then this should be even easier. Put in a manual dps of 1, submit, wait, select the platform as switch, make the ID 1, then fill in the rest. Do you need the tuya cross walk for DPSs? I found it in my searches yesterday and its how I found the settings for the lights

SergeantPup avatar Sep 27 '22 13:09 SergeantPup

I think that device isn't compatible, I set the DPS as ID 1, and select switch but localtuya doesn't bring back the correct DPS state (I have all of them), I mean just show me "-1" value instead "0, 1, 2" as relay status and other values. The reason I think is not compatible is because the DPS names in my device doesn't match on any devices provided by local tuya

kevvar avatar Sep 27 '22 13:09 kevvar

I ran into that a few times too. I think it has to do with removing the device and trying to readd it without a restart. I got that on both of my lights that I got working last night but every time I did a restart, I saw the actual DPS settings in local tuya and got them saved and working.

SergeantPup avatar Sep 27 '22 14:09 SergeantPup

@SergeantPup when you say restart, do you mean restart all the home assistant instance?

kevvar avatar Sep 27 '22 15:09 kevvar

Yes because if you just try to reload local tuya, it will tell you you need a restart to finish the application reload process. After I restarted, when I added the lights, it wash showing me the correct corresponding dps values for the devices.

SergeantPup avatar Sep 27 '22 16:09 SergeantPup

Thanks bro @SergeantPup I'll try your advice

kevvar avatar Sep 27 '22 16:09 kevvar

I ran into that a few times too. I think it has to do with removing the device and trying to readd it without a restart. I got that on both of my lights that I got working last night but every time I did a restart, I saw the actual DPS settings in local tuya and got them saved and working.

So to add the device do I have to delete it, reboot and try to add it again?

matteoopc avatar Sep 29 '22 11:09 matteoopc

Have the same issue with this mini switch. image Tried:

  1. Add device manually, enter all details + DPS with value 1. Result: it adds a switch but status is unavailable
  2. Add device with DPS = 1, remove device, add this device again with DPS = 1. Result: same as before
  3. Add device with DPS = 1, remove device, add this device again without DPS. Result: Connection to device succeeded but no datapoints found, please try again.

Does anyone have solution? Normal tuya integration is working fine

CyanoFresh avatar Sep 29 '22 22:09 CyanoFresh

That's mine too, I've couldn't find a solution yet. I'm searching for it

kevvar avatar Sep 29 '22 22:09 kevvar

@rospogrigio

milandzuris avatar Sep 30 '22 01:09 milandzuris

I really don't know how to help guys, I'm sorry... Maybe this device is using a newer protocol like 3.4 instead of 3.3? It's hard to debug without owning the device. Did you try the tuyadebug script you find in the tools folder?

rospogrigio avatar Oct 01 '22 11:10 rospogrigio

I really don't know how to help guys, I'm sorry... Maybe this device is using a newer protocol like 3.4 instead of 3.3? It's hard to debug without owning the device. Did you try the tuyadebug script you find in the tools folder?

Can you please give a step-by-step guide? Or a similar instruction. I've just started with tuya and have little expertise with it

CyanoFresh avatar Oct 01 '22 18:10 CyanoFresh

is hard make local tuya for 3.4 protocol? @rospogrigio

milandzuris avatar Oct 02 '22 04:10 milandzuris

Why the hell was this DP introduced. Everthing was ok until this.. Some devices can be added others no. Then the local tuya integration becomes unavailable. When I restart HA, the integration comes back but some devices are still in zombie mode... :(

redlingg avatar Oct 02 '22 10:10 redlingg

I have found the problem for my devices; in practice, once installed it asks me to update it, if I don't do it it works otherwise there is no way to make it go! moreover I add it without adding any number.

matteoopc avatar Oct 02 '22 16:10 matteoopc

I am also experiencing this issue with an Wifi LED Controller (Hama) is there any progress on this?

#595 #196 #194 #979 all seem to be related to this issue

derkrasseleo avatar Oct 03 '22 12:10 derkrasseleo

My Error Log -

Logger: custom_components.localtuya.pytuya Source: custom_components/localtuya/pytuya/init.py:259 Integration: LocalTuya (documentation, issues) First occurred: 1:11:40 PM (8 occurrences) Last logged: 1:35:29 PM

[d78...jry] 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 574, in detect_available_dps data = await self.status() File "/config/custom_components/localtuya/pytuya/init.py", line 507, in status status = await self.exchange(STATUS) 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

iosoft avatar Oct 04 '22 08:10 iosoft

Is there something we as users can do to help solve this issue?

derkrasseleo avatar Oct 04 '22 08:10 derkrasseleo

@sibowler can you please try to provide some support? I suspect this is something that originated after we merged PR #956. Can you please check? Thank you

rospogrigio avatar Oct 04 '22 08:10 rospogrigio

Hi all - if it's related to #956, can you try the fixes in PR #1022 to see if that changes anything?

In theory the changes introduced in #956 shouldn't impact the default detect_available_dps routine. What the change added was a retry with a RESET in between if no DPS were detected.

There seem to be a few different issues raised in this thread, so hard to know if they're all related. If i focus on just the folks who are having the error @milandzuris , @iosoft , @azsak79 , @kevvar - Do you find that these devices work fine on V4.0 of localtuya?

sibowler avatar Oct 04 '22 09:10 sibowler

localtuya 4.0.0:

This error originated from a custom integration.

Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/__init__.py:247
Integration: LocalTuya (documentation, issues)
First occurred: 12:49:44 (1 occurrences)
Last logged: 12:49:44

[bf5...sng] 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 539, in detect_available_dps
    data = await self.status()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 481, in status
    status = await self.exchange(STATUS)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 460, in exchange
    msg = await self.dispatcher.wait_for(seqno)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 247, 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

This error originated from a custom integration.

Logger: custom_components.localtuya.config_flow
Source: custom_components/localtuya/pytuya/__init__.py:247
Integration: LocalTuya (documentation, issues)
First occurred: 12:49:44 (1 occurrences)
Last logged: 12:49:44

Unexpected exception
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/config_flow.py", line 533, in async_step_configure_device
    self.dps_strings = await validate_input(self.hass, user_input)
  File "/config/custom_components/localtuya/config_flow.py", line 242, in validate_input
    detected_dps = await interface.detect_available_dps()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 539, in detect_available_dps
    data = await self.status()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 481, in status
    status = await self.exchange(STATUS)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 460, in exchange
    msg = await self.dispatcher.wait_for(seqno)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 247, 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

CyanoFresh avatar Oct 04 '22 09:10 CyanoFresh

Thanks @CyanoFresh - That would suggest it isn't related to the changes that were introduced in #956 (v4.1.0)... Did it work previously or have you always had this error with this device? If we can work out which version it last worked with that will help identify the issue.

sibowler avatar Oct 04 '22 10:10 sibowler