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

accessToken #9

Closed
AndreXori opened this issue Sep 8, 2021 · 9 comments
Closed

accessToken #9

AndreXori opened this issue Sep 8, 2021 · 9 comments

Comments

@AndreXori
Copy link

Hey mate! Congrats for the code!

How/where do I get the accessToken? Didn't get that. In tuya's cloud I just have access ID and access Secret. Tried to use both with no luck.

Thanks

@Aymkdn
Copy link
Owner

Aymkdn commented Sep 8, 2021

No need for the access token. You need to provide your username and password:

$tuya = new TuyaCloud([
  "userName" => "email@domain.com", // username/email to access to SmartLife/Tuya app
  "password" => "MyPassword", // password to access to SmartLife/Tuya app
  "bizType" => "smart_life", // type ('tuya' or 'smart_life')
  "countryCode" => "33", // Country code (International dialing number), e.g. "33" for France or "1" for USA
  "region" => "eu" // region (az=Americas, ay=Asia, eu=Europe)
]);

@Aymkdn Aymkdn added the waiting-for-requestor Waiting for the requestor to provide more info label Sep 8, 2021
@AndreXori
Copy link
Author

Using just these information I got this error:

PHP Fatal error: Uncaught exception 'Exception' with message '[tuyacloud] Unable to login: ' in /home/bkdsdd9p/public_html/tuya/TuyaCloud.php:79
Stack trace:
#0 /home/bkdsdd9p/public_html/tuya/TuyaCloud.php(82): TuyaCloud->login(5)
#1 /home/bkdsdd9p/public_html/tuya/TuyaCloud.php(82): TuyaCloud->login(4)
#2 /home/bkdsdd9p/public_html/tuya/TuyaCloud.php(82): TuyaCloud->login(3)
#3 /home/bkdsdd9p/public_html/tuya/TuyaCloud.php(82): TuyaCloud->login(2)
#4 /home/bkdsdd9p/public_html/tuya/TuyaCloud.php(82): TuyaCloud->login(1)
#5 /home/bkdsdd9p/public_html/tuya/TuyaCloud.php(25): TuyaCloud->login()
#6 /home/bkdsdd9p/public_html/tuya/index.php(10): TuyaCloud->__construct(Array)
#7 {main}
thrown in /home/bkdsdd9p/public_html/tuya/TuyaCloud.php on line 79

@no-response no-response bot removed the waiting-for-requestor Waiting for the requestor to provide more info label Sep 8, 2021
@Aymkdn
Copy link
Owner

Aymkdn commented Sep 8, 2021

Your problem is probably different. Make sure you use the correct login information.

@Aymkdn Aymkdn added the waiting-for-requestor Waiting for the requestor to provide more info label Sep 8, 2021
@no-response
Copy link

no-response bot commented Sep 13, 2021

This issue has been automatically closed because the requestor didn't provide any additional comment.

@no-response no-response bot closed this as completed Sep 13, 2021
@cocobln
Copy link

cocobln commented Sep 29, 2021

Are there any news on that topic? I have the same issues and i can make sure the login data is correct.

I red Tuya changed the verification method. Maybe thats the reason.

@Aymkdn
Copy link
Owner

Aymkdn commented Sep 30, 2021

It works for me... So it might not be that.

@Thunderscreech
Copy link

For anyone drifting in here from Google, here was my finding. I had changed the countryCode and region to 1/az (for USA/Americas) as the comments in the code suggested and I got the same error as above.

I changed it back to 33/eu (France/EU) and... it worked. The comment about region/country in the code was the culprit.

@Aymkdn
Copy link
Owner

Aymkdn commented Jun 1, 2022

Good to know! Thanks for sharing!

@shamimbdpro
Copy link

Hi @Aymkdn i see this issue with country code 880 for Bangladesh and Region bd for Bangladesh.
image

@github-actions github-actions bot removed the waiting-for-requestor Waiting for the requestor to provide more info label Mar 12, 2023
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

5 participants