rospogrigio / localtuya

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

Can't add temperature and humidity alarm: Connection to device succeeded but no datapoints found, please try again. #1110

Open r14n opened 2 years ago

r14n commented 2 years ago

The problem

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

When adding my temperature and humidity sensor https://amzn.to/3Nju4E9

Environment

Steps to reproduce

  1. Try to add
  2. Default settings (same error with either protocol version)
  3. Error

Configuration configuration.yaml or config_flow

image

(not sure what a config_flow is... but i redacted localkey as instructed from screenshot)

DP dump

[Temperature and humidity alarm] - 192.168.100.181 - Off - DPS: {'1': 264, '2': 451, '4': 78, '9': 'f', '10': 500, '11': -10, '12': 900, '13': 100, '14': 'cancel', '15': 'cancel', '16': 88, '17': 30, '18': 30, '21': False, '23': 0, '24': 0}

Provide Home Assistant taceback/logs

Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/__init__.py:259 
Integration: LocalTuya ([documentation](https://github.com/rospogrigio/localtuya/), [issues](https://github.com/rospogrigio/localtuya/issues)) 
First occurred: 11:55:15 AM (5 occurrences) 
Last logged: 12:45:32 PM

[eb3...c5w] 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

Additional information

MicheleMercuri commented 2 years ago

try to remove that device from tuya app, then reinstall it, then try to integrate in HA by local tuya.

r14n commented 2 years ago

try to remove that device from tuya app, then reinstall it, then try to integrate in HA by local tuya.

I just tried that, but unfortunately the same error occurs

indothai commented 2 years ago

Same thing is happening to me with the Tuya Single/3-phase power clamp. Was working fine 3 weeks ago and stopped getting data about 2 weeks ago.

Getting below errors:

Screenshot 2022-11-12 120358

r14n commented 2 years ago

Same thing is happening to me with the Tuya Single/3-phase power clamp. Was working fine 3 weeks ago and stopped getting data about 2 weeks ago.

I don't think it's the same issue, my device can never be added to localtuya and has never worked

indothai commented 2 years ago

Hi, I finally fixed my problem that had the same error message. Hope the following will help. I found out that the local_key has been changed. Found this out by going to tuya.com and going into the "Get Device Information" and entering the device_id. After I applied the new local_key, I'm able to add the device and view the information normally.

r14n commented 2 years ago

Thank you, that is an interesting one. When I try to get the info, I get an error message. Any ideas?

External Error Code1106 Subordinate Error Code82000004 Error DescriptionA device is not bound with an asset. Recommended SolutionPlease check if all devices are bound with the assets.

On Wed, Nov 16, 2022 at 12:21 AM indothai @.***> wrote:

Hi, I finally fixed my problem that had the same error message. Hope the following will help. I found out that the local_key has been changed. Found this out by going to tuya.com and going into the "Get Device Information" and entering the device_id. After I applied the new local_key, I'm able to add the device and view the information normally.

— Reply to this email directly, view it on GitHub https://github.com/rospogrigio/localtuya/issues/1110#issuecomment-1316369361, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDZDFRRHRKNNG5FUBA5KF3WIRVMDANCNFSM6AAAAAARTIRTGM . You are receiving this because you authored the thread.Message ID: @.***>

indothai commented 2 years ago

I've never had that error message, but did recall that error message from other user posts. I think the general problem is that your device is not linked to a Tuya account (either mobile or developer accounts). A quick search on google returned a link from Reddit. You may want to give it a try:

Below from Reddit: https://www.reddit.com/r/homeassistant/comments/w6qfpk/problems_connecting_localtuya_to_tuya_smart_light/

Below is the excerpt from the Reddit post: A tell tale sign is if you try debugging these devices in iot.tuya and it gives a permission denied error for 'get device details' - the sub error is ' Error Description : A device is not bound with an asset. '

The fix is to;

  1. Go to your Smart home app.
  2. make sure device is powered! >Select Device on home screen> hit '3 dots'>scroll down and remove device> disconnect (NOT disconnect and wipe data!!!)
  3. (if it's a light) it will go immediately into 'pairing mode'
  4. immediately add device and rediscover your device. All original settings are remembered
  5. you can now re-add to relevant location if you like
  6. If there are other devices reset - repeat 1-5
r14n commented 2 years ago

Unfortunately that does not work.

But I think my device might be 3.4 firmware, which is not yet supported.

jms92100 commented 1 year ago

same problem, impossible to add the device even manually entering dps any idea of the integration date ?