jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
923 stars 165 forks source link

Cannot Link account - QR code has expired. #310

Closed Miniontoby closed 1 year ago

Miniontoby commented 1 year ago

I cannot link my account at Devices on the IOT: image

Idk if this has to do with the fact I use LSC Smart Connect app or not

And maybe this is not the correct place to ask this, but idk

uzlonewolf commented 1 year ago

Idk if this has to do with the fact I use LSC Smart Connect app or not

It does. AFAIK only the Smart Life app is supported, I have yet to see any other app link successfully.

Miniontoby commented 1 year ago

But it does tell my phone that "(CHINESE CHARACTERS)" wants to login.

and then I hit "Link" or whatever it actually says and then after I clicked that it then on the website says "QR code has expired."

uzlonewolf commented 1 year ago

I just installed that app and tried to link, but it's refusing with the error "Please use designated APP to scan the code to log in."

You're going to need to either move everything over to the Smart Life app, or try and find the app secret and use the alternate method of getting local keys.

uzlonewolf commented 1 year ago

Screenshot_20230324_072054_com lscsmartconnection smart

Miniontoby commented 1 year ago

I dont get that message, I just click "Confirm login" and then the app goes back to HOME and the website goes like 'QR Code has expired.'

Miniontoby commented 1 year ago

And yeah I don't want to have to install another app to just be able to use this API. I don't have that much space left and such.

So yeah if there is a way to do it with the "LSC Smart Connect" app, I would like to hear it.

Miniontoby commented 1 year ago

Hmm.

When I authorize the dev console's Network tab shows request with the following response:

{"t":1679673574199,"success":false,"errorCode":"PARAMS_ILLEGAL","status":"error","errorMsg":"Invalid parameters"}

Update: I just opened a ticket, I hope Tuya support might help me out. Will relay the response back.

Miniontoby commented 1 year ago

So I installed Tuya app and linked account, but I cannot find my device nor the local key.

I don't know what I could do

Also when trying the wizzard command I get this output:

TinyTuya Setup Wizard [1.10.3]

    Existing settings:
        API Key=********************
        Secret=***********************************
        DeviceID=******************************
        Region=eu

    Use existing credentials (Y/n): Y

Error from Tuya server: Error from Tuya Cloud: Code 1106: 'permission deny'
Check DeviceID and Region
Miniontoby commented 1 year ago

Oke, I fixed it by using the Mitm method that tuyapi 'suggests'. This in combination with an older version of the LSC Smart Connect app did the job for me! So now I can interact with my LED's using code.

jasonacox commented 1 year ago

Thanks for following up and posting the link!