TuyaAPI / cli

🔧 A CLI for Tuya devices
MIT License
261 stars 44 forks source link

Invalid signing due to updated algorithm on Tuya backend as of 1st July 2021 #128

Closed XeSSiV closed 3 years ago

XeSSiV commented 3 years ago

I've encountered this message in the IoT Platform: To better secure your cloud development, Tuya will upgrade the signature algorithm. Projects created after June 30, 2021 are subject to signature verification with the new algorithm Link to further documentation is here:

I believe this is causing the wizard, link, and possibly get commands via CLI to fail, though I have no way of confirming this because I do not have a project created that uses the older signing method.

I was able to obtain a local key from a device by installing Smart Life 3.12.6 and downloading the cert via QR code with proxy, and have added the device into Home Assistant, but I'm needing to decipher what the dps for the device are, and it's proving quite difficult without assistance from the CLI features which I am unable to use.

See debug details below

C:\Users\User>set DEBUG=* & tuya-cli wizard ? The API key from tuya.com: xxxxxxxxxxxx ? The API secret from tuya.com xxxxxxxxxxxxxxx ? Provide a 'virtual ID' of a device currently registered in the app: xxxxxxxxxxxxxx [ Error: sign invalid at OpenAPI._client.got_1.default.extend.hooks.afterResponse (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\@tuyapi\openapi\dist\api.js:74:31) at EventEmitter. (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\got\dist\source\as-promise.js:87:38) at processTicksAndRejections (internal/process/task_queues.js:95:5), Error: sign invalid at OpenAPI._client.got_1.default.extend.hooks.afterResponse (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\@tuyapi\openapi\dist\api.js:74:31) at EventEmitter. (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\got\dist\source\as-promise.js:87:38) at processTicksAndRejections (internal/process/task_queues.js:95:5), Error: sign invalid at OpenAPI._client.got_1.default.extend.hooks.afterResponse (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\@tuyapi\openapi\dist\api.js:74:31) at EventEmitter. (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\got\dist\source\as-promise.js:87:38) at processTicksAndRejections (internal/process/task_queues.js:95:5), Error: sign invalid at OpenAPI._client.got_1.default.extend.hooks.afterResponse (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\@tuyapi\openapi\dist\api.js:74:31) at EventEmitter. (C:\Users\User\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\got\dist\source\as-promise.js:87:38) at processTicksAndRejections (internal/process/task_queues.js:95:5) ] There was an issue fetching that device. Make sure your account is linked and the ID is correct.

codetheweb commented 3 years ago

Duplicate of https://github.com/codetheweb/tuyapi/issues/492, please track there.