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

Error when extracting data #1

Open
arnauddomes opened this issue Sep 14, 2022 · 7 comments
Open

Error when extracting data #1

arnauddomes opened this issue Sep 14, 2022 · 7 comments

Comments

@arnauddomes
Copy link

hello

I try to use the extract tool to retrieve my FingerBot data and I get that:

Exception in thread Thread-1: Traceback (most recent call last): openapi <tuya_iot.openapi.TuyaOpenAPI object at 0x7f7c4ccb24c0> openmq <TuyaOpenMQ(Thread-1, started 140171782297344)> File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/home/arnaud/.local/lib/python3.8/site-packages/tuya_iot/openmq.py", line 158, in run self.__run_mqtt() File "/home/arnaud/.local/lib/python3.8/site-packages/tuya_iot/openmq.py", line 164, in __run_mqtt mq_config = self._get_mqtt_config() File "/home/arnaud/.local/lib/python3.8/site-packages/tuya_iot/openmq.py", line 67, in _get_mqtt_config "uid": self.api.token_info.uid, AttributeError: 'NoneType' object has no attribute 'uid' Traceback (most recent call last): File "./extract.py", line 31, in <module> device_manager.update_device_list_in_smart_home() File "/home/arnaud/.local/lib/python3.8/site-packages/tuya_iot/device.py", line 239, in update_device_list_in_smart_home response = self.api.get(f"/v1.0/users/{self.api.token_info.uid}/devices") AttributeError: 'NoneType' object has no attribute 'uid'

@TiddlyWiddly
Copy link

Same problem here

@lippenyit
Copy link

Same here:
AttributeError: 'NoneType' object has no attribute 'uid'

@TiddlyWiddly
Copy link

Same here:
AttributeError: 'NoneType' object has no attribute 'uid'

It’s been a while but I did figure this out, I just forgot to update. I believe this was an issue with the specific cloud. There are a few different cloud regions and for whatever reason they didn’t all behave the same way. Try recreating your project in all of the US regions.

@lippenyit
Copy link

As I figured it out, it's not working due to the replaced authentication method in Tuya API. I think that: it was an update period when not every region had the same version, but now it's not working globally.

@scana
Copy link

scana commented Dec 27, 2022

I got it working by selecting a proper country code in extract.py:
openapi.connect(EMAIL, PASSWORD, "48", "tuyaSmart")
You can grab yours from here https://countrycode.org/

@twhittock-disguise
Copy link

This happened to me when I used the incorrect password (using the IOT password instead of the app password.)

The error actually happens during the call to openapi.connect - it returns a response with a success value of false, but the script doesn't abort.

@marianri
Copy link

marianri commented Nov 23, 2023

@TiddlyWiddly is right, the error is related to cloud regions, for Europe try, in "config.py", replace:

ENDPOINT = 'https://openapi.tuyaeu.com'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants