Open BenoitVH opened 1 year ago
Hi @BenoitVH - thanks for opening this and your kind words! It is still working for me so I don't think they changed their API unless they updated their regional endpoints. A few questions:
python -m tinytuya version
@jasonacox
Please see my answers below:
I'm afraid I will have to re-create my "Cloud Project" :-( but I think will wait until I have purchased all my devices...
KR, Benoit
Nah, I don't think that will be necessary, this is a duplicate of #323, just upgrade TinyTuya to v1.12.3 or use the workaround in https://github.com/jasonacox/tinytuya/issues/323#issuecomment-1503794505 and it should work. If you installed with pip you can upgrade with pip install --upgrade tinytuya
@uzlonewolf , thanks for stepping in.
I installed latest version and tried the wizard again with same error (see below). I haven't tried the workaround in #323 yet. I'll keep you posted once I did that.
KR, Benoit
TinyTuya Setup Wizard [1.12.3]
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443 DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/token?grant_type=1 HTTP/1.1" 200 235 DEBUG:GET: URL=https://openapi.tuyaeu.com/v1.0/token?grant_type=1 HEADERS={'Content-type': 'application/json', 'Signature-Headers': 'Content-type', 'secret': '49ee6e415fb74d75a0be43f9177fe7d5', 'client_id': '5dy44y7n33arv7ngwepu', 'sign': 'E576BC1C0023209255168CE21A74AF60E14D7AF19C2E460CA8C60E76BCA1F0F8', 't': '1681652082771', 'sign_method': 'HMAC-SHA256', 'mode': 'cors'} response code=200 text={"result":{"access_token":"f10cb67ea6126fa197d0754d529cf148","expire_time":7175,"refresh_token":"ddc1093e139d233f3cddb6efbd18db04","uid":"bay1671210199361OQS3"},"success":true,"t":1681652082959,"tid":"71e7973edc5b11edbe55ce1a38a7d30c"} token=None DEBUG:server_time_offset: 0 DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443 DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-01/associated-users/devices?size=50 HTTP/1.1" 200 112 DEBUG:GET: URL=https://openapi.tuyaeu.com/v1.0/iot-01/associated-users/devices?size=50 HEADERS={'Content-type': 'application/json', 'Signature-Headers': 'Content-type', 'client_id': '5dy44y7n33arv7ngwepu', 'sign': '60B7D93F3BD60CE0398840EDB050175AFB34BD016394F9968667825663504835', 't': '1681652082991', 'sign_method': 'HMAC-SHA256', 'mode': 'cors', 'access_token': 'f10cb67ea6126fa197d0754d529cf148'} response code=200 text={"code":1106,"msg":"permission deny","success":false,"t":1681652083144,"tid":"7201e936dc5b11edbe55ce1a38a7d30c"} token=f10cb67ea6126fa197d0754d529cf148 DEBUG:Cloud response: DEBUG:{ "code": 1106, "msg": "permission deny", "success": false, "t": 1681652083144, "tid": "7201e936dc5b11edbe55ce1a38a7d30c" }
Device Listing
Saving list to devices.json 0 registered devices saved
This may be a long shot...
Run the scanner and grab a new Device ID that responds:
python -m tinytuya scan
Run the wizard again but re-enter all the settings data (say 'N' to 'Use existing credentials') and enter the Key, Secret and the new Device ID.
python -m tinytuya wizard
DEBUG:GET: URL=https://openapi.tuyaeu.com/v1.0/iot-01/associated-users/devices?size=50
Basically, Tuya has recently disabled access to this "associated-users" API endpoint. It's not just your account, no one can use it anymore. You're going to need to add a device ID to your configuration so it can use the old method of getting the device list.
@jasonacox What do you think of allowing a "scan" keyword as the Device ID to have it automatically scan for an ID to use? Edit: #331
Love it! Thanks @uzlonewolf ! 🙏
@jasonacox @uzlonewolf .
Sorry that it took a while to get back; but I absolutely owed you a response.
Since I had some issues earlier this year (documented above), I had postponed adding any new device until now, but I recently purchased more devices and could no longer wait... So I updated all possible system and pip libraries on my RaspBerryPi to the latest versions and then ran the tinytuya wizard from scratch and was very pleased to see it ran like a breeze ! :-)
Many thanks for your support and for the excellent tools!
PS: While cleaning my system, I did notice that the previous storage.json file contained a deviceID of a long gone/deleted device, perhaps this can be the cause of the troubles I had back then?
Thanks @BenoitVH ! We appreciate the kind words!
PS - Big credit to @uzlonewolf ! A lot of this project would not be possible without LW's help! 🙏
Discussed in https://github.com/jasonacox/tinytuya/discussions/329