Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
redlingg opened this issue Sep 19, 2022 · 36 comments
Open
Labels
bug Something isn't working

Comments

@redlingg
Copy link

Hello
What does this mean?
I reinstalled local tuya and since then I am not able to add the devices.
thanks

@redlingg redlingg added the bug Something isn't working label Sep 19, 2022
@1mseba
Copy link

1mseba commented Sep 19, 2022

I have the same, only does anyone support this project?

@SergeantPup
Copy link

I received the same when adding devices I already had added to another instance of HA and Local Tuya. They are the atomi string lights. I cannot add these lights to Local Tuya anymore.

@SergeantPup
Copy link

To confirm this isn't me, I copied the settings directly from the edit screen in my older/established instance and pasted them into the newer version and I got the same results as above. Something has definitely changed where it's not allowing these devices to establish the connection now.

@SergeantPup
Copy link

You can force it through it you play with the DPS's. I got the settings to expose on the next screen and they're pretty close to what I need, but I couldn't quite make it work. I'm sure if I try every combination, I'll eventually get it. I'm copying the settings from my old HA instance.

@kevvar
Copy link

kevvar commented Sep 26, 2022

You can force it through it you play with the DPS's. I got the settings to expose on the next screen and they're pretty close to what I need, but I couldn't quite make it work. I'm sure if I try every combination, I'll eventually get it. I'm copying the settings from my old HA instance.

Did you get it work??

@redlingg
Copy link
Author

redlingg commented Sep 26, 2022 via email

@kevvar
Copy link

kevvar commented Sep 26, 2022

not yet…. :( What is the DPS??? Az iPademről küldve

2022. szept. 26. dátummal, 6:51 időpontban kevvar @.***> írta:  You can force it through it you play with the DPS's. I got the settings to expose on the next screen and they're pretty close to what I need, but I couldn't quite make it work. I'm sure if I try every combination, I'll eventually get it. I'm copying the settings from my old HA instance. Did you get it work?? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

A guy made it work in this thread I'm waiting his response, maybe you can follow it

@iosoft
Copy link

iosoft commented Oct 4, 2022

I am also facing the same issue after I bought a brand new simple wifi switch.

From SmartLife App, it is working fine.
But, when I try to add it in HA+localTuya, it is giving me this error -

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

Tested with both 3.1 and 3.3 Protocols but no success.

I found this Error Log entry -

Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/init.py:259
Integration: LocalTuya (documentation, issues)
First occurred: 1:11:40 PM (4 occurrences)
Last logged: 1:13:23 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

Please suggest how to fix this stupid issue.
Thanks and regards

@balbulator
Copy link

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

Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/init.py:259
Integration: LocalTuya integration (documentation, issues)
First occurred: 21 жовтня 2022 р. о 23:56:44 (3 occurrences)
Last logged: 00:16:19

[638...ad0] 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

@jim-downie
Copy link

I experienced the same issue. Only way to add devices cleanly was to restart HA after each device is added. This may be down to variables not being reset between adding devices (restarting HA ensures everything is torn down).

@rospogrigio
Copy link
Owner

Some of these devices might not work because they are using the 3.4 protocol.
I have now published a PR that provides support for 3.4: #1222 .
Can you test it and provide feedback?
Thank you, enjoy.

@kevvar
Copy link

kevvar commented Jan 9, 2023

Some of these devices might not work because they are using the 3.4 protocol. I have now published a PR that provides support for 3.4: #1222 . Can you test it and provide feedback? Thank you, enjoy.

Greate news @rospogrigio, how can I try it? just downloading the add-on?

@rospogrigio
Copy link
Owner

Well there are several ways to do it, the simplest is to just download the pytuya/__init__.py file you find in the PR and replace the one you find in your installation, then restart HA of course.

@kevvar
Copy link

kevvar commented Jan 9, 2023

Thanks @rospogrigio I'll try it, and provide some feedback

@kevvar
Copy link

kevvar commented Jan 9, 2023

Well there are several ways to do it, the simplest is to just download the pytuya/__init__.py file you find in the PR and replace the one you find in your installation, then restart HA of course.

I replaced the file pytuya/__init__.py in my HA instance, restart, but doesn't show the 3.4 protocol. Maybe I did something wrong?
image

@kevvar
Copy link

kevvar commented Jan 9, 2023

My bad @rospogrigio I did not replace the localtuya/config_flow.py. Once the file was replaced I can see the new protocol:
image
I'm configuring my devices, I got the DPS without issues.

EDIT: All my tuya switches are working @rospogrigio thanks buddy your work is amazing. Blessings

@rospogrigio
Copy link
Owner

Yes, sorry I forgot that also config_flow.py had changed. Let me know how it goes...

@kevvar
Copy link

kevvar commented Jan 9, 2023

Yes, sorry I forgot that also config_flow.py had changed. Let me know how it goes...

Sure @rospogrigio I edited my last comment. All my switches are working!! thanks a lot!!

@dimyard
Copy link

dimyard commented Jan 9, 2023

Wow! It works!
@rospogrigio thanks!

@1mseba
Copy link

1mseba commented Jan 9, 2023

After changing the files:
_localtuya/config_flow.py
pytuya/__init__.py_
I have the following:

_```
Logger: homeassistant.loader
Source: custom_components/localtuya/common.py:26
Integration: LocalTuya integration (documentation, issues)
First occurred: 21:36:09 (1 occurrences)
Last logged: 21:36:09

Unexpected exception importing component custom_components.localtuya
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 725, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/localtuya/__init__.py", line 31, in <module>
    from .common import TuyaDevice, async_config_entry_by_device_id
  File "/config/custom_components/localtuya/common.py", line 26, in <module>
    from . import pytuya
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 71
    <title>localtuya/__init__.py at protocol_3.4 · rospogrigio/localtuya · GitHub</title>
                                             ^

SyntaxError: invalid character '·' (U+00B7)

Logger: homeassistant.setup
Source: setup.py:210
First occurred: 21:36:09 (1 occurrences)
Last logged: 21:36:09

Setup failed for custom integration localtuya: Unable to import component: Exception importing custom_components.localtuya


What am I doing wrong ?

@kevvar
Copy link

kevvar commented Jan 9, 2023

After changing the files: localtuya/config_flow.py pytuya/init.py

Maybe the file name? The correct one is
__init__.py, take care of the underscore lines

@1mseba
Copy link

1mseba commented Jan 9, 2023

Sure, I changed the underscore file "__init__.py".
The browser must have changed something while saving.

After changing back HA shows no errors.

@milandzuris
Copy link

milandzuris commented Jan 9, 2023

@rospogrigio
image
image

@kevvar
Copy link

kevvar commented Jan 9, 2023

@milandzuris did you change the 2 files?
pytuya/__init__.py
localtuya/config_flow.py

@milandzuris
Copy link

@milandzuriszmenil si 2 súbory? pytuya/__init__.py localtuya/config_flow.py

yes

@rospogrigio
Copy link
Owner

@milandzuris screenshots are not useful at all, you need to provide debug messages to allow me to understand what's going wrong.

@kevvar
Copy link

kevvar commented Jan 9, 2023

@milandzuriszmenil si 2 súbory? pytuya/__init__.py localtuya/config_flow.py

yes

Check the files code with the code on the pull request, maybe there are differences, when I downloaded the files the browser did a weird thing and changed the code in the files, so I had to copy and paste the code manually

@milandzuris
Copy link

@milandzurissnímky obrazovky nie sú vôbec užitočné, musíte poskytnúť ladiace správy, aby som pochopil, čo sa deje.

This error originated from a custom integration.

Logger: homeassistant.loader
Source: custom_components/localtuya/common.py:26
Integration: LocalTuya (documentation, issues)
First occurred: 22:37:19 (1 occurrences)
Last logged: 22:37:19

Unexpected exception importing component custom_components.localtuya
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 725, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/localtuya/init.py", line 31, in
from .common import TuyaDevice, async_config_entry_by_device_id
File "/config/custom_components/localtuya/common.py", line 26, in
from . import pytuya
File "/config/custom_components/localtuya/pytuya/init.py", line 2

^^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

@milandzuris
Copy link

milandzuris commented Jan 9, 2023

fixed, thx for work @rospogrigio

@rospogrigio
Copy link
Owner

Glad to read that @milandzuris . Just for other people who might end in the same situation, what was your problem and how did you solve it? Thank you for your feedback.

@milandzuris
Copy link

Glad to read that @milandzuris . Just for other people who might end in the same situation, what was your problem and how did you solve it? Thank you for your feedback.

copy code from github and edit file in vscode

@srtxema
Copy link

srtxema commented Oct 11, 2023

You won´t believe my solution.
After a lot of days losted and reading forums with "no datapoints found" problem, I have solve the problem only closing tuya and smartlife apps and after it adding normally to local tuya in HA

@sarunasr
Copy link

sarunasr commented Nov 1, 2023

The same for me, I'm trying to integrate temperature sensor TH01CB3S.

@milandzuris
Copy link

If someone need Data Points for Setup here: https://github.com/DzurisHome/Tuya-Data-Points

@srtxema
Copy link

srtxema commented Nov 11, 2023

very interesting. Thanks!

@shorvit
Copy link

shorvit commented Jun 6, 2024

Thank you Chema and Dzuris, after putting 1 and 1 into DP fields and also closing Smartlife app in my phone, my switch was finally linked into Home Assistant - local Tuya integration. Not sure which of the solutions worked though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests