codetheweb / tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.06k stars 339 forks source link

No permissions. This API is not subscribed #485

Closed Apacelus closed 2 years ago

Apacelus commented 3 years ago

I have the same issue as in this, except that my output is like this:

✖ Device(s) failed to be registered!
Error: No permissions. This API is not subscribed.
    at OpenAPI._client.got_1.default.extend.hooks.afterResponse.response (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/link/node_modules/@tuyapi/openapi/dist/api.js:68:31)
    at EventEmitter.emitter.on (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38)
    at process._tickCallback (internal/process/next_tick.js:68:7)

I tried this solution: but that didnt help either. I followed all the steps in the setup instructions. I am trying to run this off a raspberry pi, is that the problem?

codetheweb commented 3 years ago

The setup instructions were recently updated; can you double-check that everything looks good there?

The Raspberry Pi should not be the problem.

VossenTech commented 3 years ago

Looks like another update to the instructions may be required, I also needed to follow the instructions from this comment:

https://github.com/codetheweb/tuyapi/issues/475#issuecomment-858373769

cj922 commented 3 years ago

Looks like another update to the instructions may be required, I also needed to follow the instructions from this comment:

https://github.com/codetheweb/tuyapi/issues/475#issuecomment-858373769

I was having issues as well until following the referenced comment - copied here in list form:

codetheweb commented 3 years ago

@cj922 mind making a PR for that? :)

cj922 commented 3 years ago

@cj922 mind making a PR for that? :)

Done! https://github.com/codetheweb/tuyapi/pull/491

kalyway101 commented 3 years ago

I set this up using the new directions but I am still getting the error:

tuya-cli link --api-key <API_KEY> --api-secret <API_SECRET> --schema comlocaltoy --ssid OrderNow --password <REDACTED> --region us
✖ Device(s) failed to be registered!
Error: No permissions. This API is not subscribed.
    at OpenAPI._client.got_1.default.extend.hooks.afterResponse (/home/kalyway/.nvm/versions/node/v14.17.1/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/link/node_modules/@tuyapi/openapi/dist/api.js:68:31)
    at EventEmitter.<anonymous> (/home/kalyway/.nvm/versions/node/v14.17.1/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Edit: This solution worked for me and I didn't need to utilize ANY commands or worry about installing npm since it's all done via the Web interface and was super easy.

https://github.com/rospogrigio/localtuya/issues/490#issuecomment-869245627

del13r commented 3 years ago

Thanks @kalyway101

Please go to https://community.home-assistant.io/t/inkbird-ibs-m1-with-ibs-p01/255050/20?u=del13r for how I was able to get the local key after the command line app was not working for me.

xmax000 commented 3 years ago

I have the same issue :/ ...any idea? I used the guide.

1 2 3

codetheweb commented 3 years ago

@xmax000 can you please double-check you covered everything in the setup guide?

del13r commented 3 years ago

go to https://iot.tuya.com/cloud/

image

Click on your project

Then devices

Link Tuya App Account

image

Then go to all devices to get your device id and copy it

image

Then go to https://iot.tuya.com/cloud/explorer

Get Device Details

DataCenter dropdown : Europe

then paste in your device id

image to get your local key

xmax000 commented 3 years ago

I can not use the app linking method because I am using a thridparty tuya plug from LEDVANCE. The LEDVANCE App does not support qr scanning and the tuya smart Life App blocks my device.

Screenshot_20210721-110741_Smart Life

del13r commented 3 years ago

If Smart Life does not recognise it, then is it even a Tuya device?

image

On Wed, 21 Jul 2021 at 19:11, xmax000 @.***> wrote:

I can not use the app linking method because I am using a thridparty tuya plug from LEDVANCE. The LEDVANCE App does not support qr scanning and the tuya smart Life App blocks my device.

[image: Screenshot_20210721-110741_Smart Life] https://user-images.githubusercontent.com/22222285/126463289-2a047497-3a9b-42f6-98c6-13c24dc961c4.jpg

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/codetheweb/tuyapi/issues/485#issuecomment-884026710, or unsubscribe https://github.com/notifications/unsubscribe-auth/AURGUU7YCWR37KN4WJXQCRTTY2FK3ANCNFSM464BQYGA .

-- Regards

Nathan Deller

xmax000 commented 3 years ago

Yes it is. I can see that the plug is connecting to tuya servers and the LEDVANCE App is similar to the Tuya smart life app.

codetheweb commented 3 years ago

If the official Tuya app blocks your device it's unlikely to work with TuyAPI. Sorry.

ry-dgel commented 3 years ago

I was having the same issue despite being certain I followed the Setup guide. I started randomly adding other relevant APIs to my Cloud project, and it seems like either the 'Smart Home Family Management' or 'Authorization' API was needed for everything to work.

joschi36 commented 3 years ago

I was having the same issue despite being certain I followed the Setup guide. I started randomly adding other relevant APIs to my Cloud project, and it seems like either the 'Smart Home Family Management' or 'Authorization' API was needed for everything to work.

I can confirm, after adding both you mentioned it worked for me as well.

del13r commented 3 years ago

mentioned

When you say it worked, was it the cli or the GUI method that worked?

RomMuc commented 2 years ago

Hi,

I have the same issue when using Home Assistant, although all APIs are properly subscribed to...

2021-09-19 17:53:26 DEBUG (MainThread) [tuya iot] start 2021-09-19 17:53:26 DEBUG (Thread-43) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/iot-03/open-hub/access-config, params = None, body = {'uid': '', 'link_id': '', 'link_type': 'mqtt', 'topics': 'device', 'msg_encrypted_version': '1.0'}, t = 1632066806513 2021-09-19 17:53:26 DEBUG (SyncWorker_0) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/users/euXXXXXXXXXXXXXXXXXX/devices, params = None, body = None, t = 1632066806522 2021-09-19 17:53:26 DEBUG (SyncWorker_0) [tuya iot] Response: { "code": 28841101, "msg": "No permissions. This API is not subscribed.", "success": false, "t": 1632066806575 }

image

Any hint?

Many thanks, Romain.

del13r commented 2 years ago

Hi,

I have the same issue when using Home Assistant, although all APIs are properly subscribed to...

2021-09-19 17:53:26 DEBUG (MainThread) [tuya iot] start 2021-09-19 17:53:26 DEBUG (Thread-43) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/iot-03/open-hub/access-config, params = None, body = {'uid': '_', 'link_id': '_', 'link_type': 'mqtt', 'topics': 'device', 'msg_encrypted_version': '1.0'}, t = 1632066806513 2021-09-19 17:53:26 DEBUG (SyncWorker_0) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/users/euXXXXXXXXXXXXXXXXXX/devices, params = None, body = None, t = 1632066806522 2021-09-19 17:53:26 DEBUG (SyncWorker_0) [tuya iot] Response: { "code": 28841101, "msg": "No permissions. This API is not subscribed.", "success": false, "t": 1632066806575 }

image

Any hint?

Many thanks, Romain.

Try this as an alternative https://github.com/codetheweb/tuyapi/issues/485#issuecomment-883830486

RomMuc commented 2 years ago

Hi,

thanks for the tip, but I get the same result. I tried to unsubscrive the Smart Home Device Management API to subscribe again, but now it is not even possible to subscribe to it anymore as it says I already have it :-(

Might have to ask for a complete reinit of my account with the tuya platform I guess...

del13r commented 2 years ago

Hi,

thanks for the tip, but I get the same result. I tried to unsubscrive the Smart Home Device Management API to subscribe again, but now it is not even possible to subscribe to it anymore as it says I already have it :-(

Might have to ask for a complete reinit of my account with the tuya platform I guess...

Hi, what I offered wasn’t a solution to get the command line app working. I was offering an alternative method/workaround to get local tuya working as the command line app just gets the local keys for you. My method also does that via the tuya website

RomMuc commented 2 years ago

Hi,

clear. From what I see, it is more an issue with the API authorizations with the tuya platform itself. If I find a solution without creating a new account, I´ll post it here :-)

Romain.

ground-creative commented 2 years ago

Perhaps this php client can help debug the problems:

https://github.com/ifsale/tuyapiphp

RomMuc commented 2 years ago

For the record, the guys from tuya fixed my issue on the tuya platform, very fast support. No new account needed, something with the subscription to an API which was not properly configured.