Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There was an issue fetching that device. Make sure your account is linked and the ID is correct. #115

Open
chrisjshull opened this issue Mar 21, 2021 · 5 comments

Comments

@chrisjshull
Copy link

~> tuya-cli wizard
? The API key from tuya.com: xxx
? The API secret from tuya.com xxx
? Provide a 'virtual ID' of a device currently registered in the app: xxx
There was an issue fetching that device. Make sure your account is linked and the ID is correct.
~> tuya-cli -V
1.15.2

Have triple checked. I am sure I've followed the directions for the key / secret / virtual id.

@codetheweb
Copy link
Member

Please run DEBUG=* tuya-cli wizard and post the output.

@chrisjshull
Copy link
Author

bash-3.2$ DEBUG=* tuya-cli wizard
? The API key from tuya.com: xxx
? The API secret from tuya.com xxx
? Provide a 'virtual ID' of a device currently registered in the app: xxx
[
  Error: you don't have access to this API
      at OpenAPI._client.got_1.default.extend.hooks.afterResponse (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/openapi/dist/api.js:74:31)
      at EventEmitter.<anonymous> (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38)
      at processTicksAndRejections (node:internal/process/task_queues:94:5),
  Error: you don't have access to this API
      at OpenAPI._client.got_1.default.extend.hooks.afterResponse (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/openapi/dist/api.js:74:31)
      at EventEmitter.<anonymous> (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38)
      at processTicksAndRejections (node:internal/process/task_queues:94:5),
  Error: you don't have access to this API
      at OpenAPI._client.got_1.default.extend.hooks.afterResponse (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/openapi/dist/api.js:74:31)
      at EventEmitter.<anonymous> (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38)
      at processTicksAndRejections (node:internal/process/task_queues:94:5),
  Error: you don't have access to this API
      at OpenAPI._client.got_1.default.extend.hooks.afterResponse (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/openapi/dist/api.js:74:31)
      at EventEmitter.<anonymous> (/Users/chrisjshull/homebrew/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38)
      at processTicksAndRejections (node:internal/process/task_queues:94:5)
]
There was an issue fetching that device. Make sure your account is linked and the ID is correct.

@codetheweb
Copy link
Member

It looks like you might have missed step 5 here.

@chrisjshull
Copy link
Author

chrisjshull commented Mar 21, 2021

Aha! I missed the part in 5 about authorizing the project.

Anyway, should https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md#linking-a-tuya-device-with-smart-link be linked from the readme for this project?

And can a better error be output for this case than "There was an issue fetching that device. Make sure your account is linked and the ID is correct."?

@kingtao1024
Copy link

kingtao1024 commented Apr 14, 2022

I have the same error,could you please help me check the log as follow?thank you very much!

[Error: GET_TOKEN_FAILED 2007, your ip(1**.*..*0) cross-region access is not allowed
at TuyaOpenApiClient. (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuya/tuya-connector-nodejs/lib/core/client.js:123:35)
at step (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuya/tuya-connector-nodejs/lib/core/client.js:52:23)
at Object.next (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuya/tuya-connector-nodejs/lib/core/client.js:33:53)
at fulfilled (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuya/tuya-connector-nodejs/lib/core/client.js:24:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5),

There was an issue fetching that device. Make sure your account is linked and the ID is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants