tinytuya icon indicating copy to clipboard operation
tinytuya copied to clipboard

TinyTuya error

Open grampasso-lento opened this issue 3 years ago • 3 comments

Hi, after configuring the Tuya account and website (all my devices are listed there) i am running °python -m tinytuya wizard -nocolor° but I get the following output:

Traceback (most recent call last): File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python39\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Python39\lib\site-packages\tinytuya_main.py", line 64, in wizard.wizard(color=color, forcescan=force) File "C:\Python39\lib\site-packages\tinytuya\wizard.py", line 223, in wizard tuyadevices = cloud.filter_devices( json_data['result'], ip_list ) KeyError: 'result'

Also, running "python -m tinytuya scan" I only get 2 of my devices listed there. Any help? Thanks in advance. Giovanni

grampasso-lento avatar Oct 11 '22 15:10 grampasso-lento

I was able to reproduce this with a correct key and secret, but wrong region and/or device id. Double-check to make sure both the Region and Device ID are correct. I'll see if we can detect this like we do for bad keys/secrets and add a better error message when encountered.

uzlonewolf avatar Oct 12 '22 14:10 uzlonewolf

Hi, tried with all the region codes (all the same except cn which gives a cross-region access error). Also tried with the two devices which are detected in the snapshot.json. I take the opportunity to inform you that there might be a typo error in this file, "ablilty" should be "ability" maybe? thanks

grampasso-lento avatar Oct 12 '22 15:10 grampasso-lento

That "ablilty" is directly from the device itself, there is nothing we can do about it.

Are you sure those devices are linked to your developer account? The Region must also match what is set in your developer account. The only way to get that backtrace is if Tuya's servers are rejecting the device list request.

uzlonewolf avatar Oct 12 '22 15:10 uzlonewolf