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

New Tuya Integration 'Permission Deny' Error (Upstream issue at Tuya) #58145

Closed
dnschnur opened this issue Oct 21, 2021 · 65 comments
Closed

New Tuya Integration 'Permission Deny' Error (Upstream issue at Tuya) #58145

dnschnur opened this issue Oct 21, 2021 · 65 comments

Comments

@dnschnur
Copy link

The problem

I updated to HA Core 2021.10.6, removed the old Tuya integration, and tried to add the new one, but I'm getting a "permission deny" error. I followed the instructions very carefully:

  1. Created Tuya IOT Platform account.
  2. Created a new Cloud Project in the US West data center.
  3. Authorized the Device Status Notification API, along with the other default ones.
  4. Linked my Tuya app account, scanned the QR code, confirmed.
  5. Confirmed that my device (dimmer light) shows up in the Devices list, and its status is "Online".
  6. Added the Tuya integration, configuration dialog comes up.
  7. Chose United States from the country list.
  8. Copy-pasted the Access ID and Access Secret into the Tuya integration fields.
  9. Enter my Tuya App (not IOT Platform) username (email address) and password in the fields.

When I click "Submit", red text "Login error (1106): permission deny" appears.

I verified that my account and password were correct by signing out of the Tuya app and then signing back in with the same username + password

Nothing at all is shown in the HA log.

What is version of Home Assistant Core has the issue?

core-2021.10.6

What was the last working version of Home Assistant Core?

core-2021-9.6

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

Hey there @tuya, @zlinoliver, @METISU, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


tuya documentation
tuya source
(message by IssueLinks)

@poptix
Copy link

poptix commented Oct 23, 2021

I had the same problem, however, I tracked it down to this: https://www.home-assistant.io/integrations/tuya#1106-permission-deny

Tuya made some changes on their end, I had to fix my datacenter settings in their developer console and re-link the app.

@dnschnur
Copy link
Author

I followed the instructions all in one go, so only a couple of minutes passed in between linking the app in the dev console and trying to add the HA integration. I actually first assumed that I had to wait for some kind of propagation, but an hour and then a day later, the error remained the same. So I don't think it could be due to a change on their end, unless you mean that the instructions are out-of-date and there's a new step that I'm missing?

What do you mean by fixing the datacenter settings?

@dnschnur
Copy link
Author

dnschnur commented Oct 23, 2021

I just tried adding US East to the datacenter list, in addition to US West. I then unlinked my app account and re-linked it. Still the same error.

The "Availability Zone" link in the documentation, under the 1106 error heading, is also semi-broken. It points to a doc in the tuya-home-assistant repo, which tells you to look at the app's "Account and Security" settings for "Region", and then says that "The Region field is what to be entered in Data Center". But my region in the app is "United States of America / Canada", which doesn't help me know whether to use US West or US East.

That page also says "For more information about the data centers, see Correspondence of regions and data centers." However, that is not a link and there's no such heading on the page.

There's just a lot here - no logging, no details in the error, missing documentation, etc. - that makes this integration feel unfinished. It's disappointing, because the old Tuya integration was incredibly easy to set up and worked perfectly.

@poptix
Copy link

poptix commented Oct 23, 2021

US East/West is sufficient, mine previously had all of the datacenters and it prevented linking the dev account to the app. Tuya made some other changes (Oct 21) that are advertised with a banner at the top of the page. Some of the basic API permissions have been consolidated along with other changes.

The documentation is a bit out of date but the basics are still right. Make sure you can see your devices in the dev account after linking, make sure you've enabled the right API permissions, remove the Tuya integration and re-add it (don't worry, your entities will stay the same), select the right app (I use Smart Life) and zone (1 - USA), then punch in your app credentials.

If that doesn't work log out of the app and log back in with your existing credentials to verify they're still correct/valid/haven't been force changed by Tuya.

@dnschnur
Copy link
Author

Yep, that's exactly what I had tried. I just went through it one more time: un-linked my app account from Tuya IOT, signed out of the app, signed back in, linked the app account again, confirmed that the app shows that it's linked to my Cloud Development Project, confirmed that my devices show up in Tuya IOT, then tried to set up the integration again using the exact same app account and password that I had just used to sign in. Same error. :(

The only difference from what you wrote is that when setting up the integration I don't see any option to choose Tuya v.s. Smart Life, and I don't have a number next to the zone name. This is what I see:

ha-tuya

(Ignore the "Extensions" text; just a tooltip that was up when I took the screenshot)

@dnschnur
Copy link
Author

dnschnur commented Oct 23, 2021

Oh, and yes, I confirmed under the Tuya IOT "My Services" pane that I'm "Subscribed" to the new "Device Connection Service", as well as "Device Status Notification", "Authorization", "Smart Home Scene Linkage, and "IoT Data Analytics.

@poptix
Copy link

poptix commented Oct 24, 2021

That more closely matches the dialog described in the documentation. I'm running Home Assistant 2021.8.8 and mine asks for my app password so I'm not sure what the deal is there, other than mine works and yours doesn't =)

@dnschnur
Copy link
Author

You're using the old Tuya integration. Mine worked great in 2021.9.6 and earlier as well, but in 2021.10.0 the Tuya integration was replaced with a completely new one.

@julnobugs
Copy link

julnobugs commented Oct 24, 2021

I've the exact same issue as you during my test today.
Did try everything:

  • Ensure that my tuya "Smart Life" account is US and that my login/pwd are correct
  • Did check that my tuya dev account was already an US account, did try to select west us/east us and both DC (same errors)
  • In the project of the dev tuya account I confirm the project:
    • is subscribed to "Device Connection Service", "Device Status Notification", "Authorization", "Smart Home Scene Linkage, and "IoT Data Analytic.
    • the smart lif tuya account is properly linked and I see my devices

Like you, I'm running out of options unfortunately :/

@dnschnur
Copy link
Author

Can we please have the new Tuya integration rolled back, or at least have the old one reintroduced as a "Tuya Legacy" option? There are many other issues being reported with the V2 integration. Please give us the option to use the old one until V2 is stable.

@javierugarte
Copy link

With HA new version 2021.11 the Tuya integration has stopped working. With the previous version 2021.10 it worked correctly.
I try to login with same id, access key and user but it doesn't work.
The country is Spain

@iMarkus
Copy link
Contributor

iMarkus commented Nov 4, 2021

Same authentication issue for me. Updated Home Assistant Core to latest version 2021.11.0 and tried to setup the tuya integration for the first time.

What I did so far is:

  • Unlink and link the app again
  • Readded IOT Core Service
  • Removed App from smartphone and logged in again
  • Changed password to max. 8 chars
  • Added other data centers

App is working fine as well as Postman and Node Red. Debug log only shows username / password wrong.

@damiano75
Copy link

damiano75 commented Nov 4, 2021

Same here.
With 2021.10.7 Tuya integration worked fine, now I tried to create another poroject, I checked login and changed my password.
I'm in Italy, could the country be the problem?
These are my log entries:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 66, in async_setup_entry hass.data[DOMAIN].pop(entry.entry_id) KeyError: '7d2dccce4876ceeac46d63a1cfa59839'

@elyobelyob
Copy link
Contributor

elyobelyob commented Nov 4, 2021

Same here. Was using Tuya V2 with no issues. Upgraded to 2021.11 and started getting 1106 error. Have removed Tuya V2 integration and tried to install the HA Tuya integration but also get 1106 error. Have double checked subscribed services and all seems okay. Had tested HA Tuya under 2021.10.* and it worked, but I backed it out due to lack of device support.

@Arakon
Copy link

Arakon commented Nov 4, 2021

I switched from V2 to the main one and no issues. Make sure you use the login data of your app, not the login to the IOT site.

@iMarkus
Copy link
Contributor

iMarkus commented Nov 4, 2021

In my case the mail address and password is the same for IOT site and app.

@elyobelyob
Copy link
Contributor

I just checked my password for the app and it is correct (also the same for IOT and app).

@danielsmith89
Copy link

I can confirm I'm having exactly the same problem, worked fine on 2021.10, but since updating to 2021.11 it's giving the 1106 permission deny error.

@suttridge
Copy link

I confirm as well, exactly the same problem, worked fine on 2021.10, but since updating to 2021.11 today it's giving the 1106 permission deny error.

@groenmarsmannetje
Copy link

groenmarsmannetje commented Nov 4, 2021

I was using 2021.11 beta version without issues. And yesterday I installed the new official 2021.11 release. After that it also worked without issues. This morning I did a restart and now I also get the "permission deny error" in my logging.

So it seems to me that there is an issue with the Tuya platform itself.

@BartEngelen
Copy link

I confirm as well, exactly the same problem, worked fine on 2021.10, but since updating to 2021.11 today it's giving the 1106 permission deny error.

@damiano75
Copy link

I was using 2021.11 beta version without issues. And yesterday I installed the new official 2021.11 release. After that it also worked without issues. This morning I did a restart and now I also get the "KeyError" in my logging.

So it seems to me that there is an issue with the Tuya platform itself.

Right, I downgraded my system to 2021.10.7 and I have the same issue, yesterday it worked fine...

@kacpergski
Copy link

I confirm as well, exactly the same problem, worked fine on 2021.10, but since updating to 2021.11 today it's giving the 1106 permission deny error.

@nicespoon
Copy link

Same issue here. Worked on 2021.10 but I get the 1106 error with 2021.11 today.

1 similar comment
@scambo00
Copy link

scambo00 commented Nov 4, 2021

Same issue here. Worked on 2021.10 but I get the 1106 error with 2021.11 today.

@brainfrz82
Copy link

I've seen the error a few times on 2021.10.x, but it didn't stop working so i didn't look into it. after upgrading to 2021.11 it stopped working altogether.

@danielsmith89
Copy link

Started working for about 10 minutes, and now it's stopped again.

@ssm84
Copy link

ssm84 commented Nov 4, 2021

nope...stopped again

@ssm84
Copy link

ssm84 commented Nov 4, 2021

anybody else still having the issue??

@babelhoo
Copy link

babelhoo commented Nov 4, 2021

Yes, still happening. Earlier today I was able to connect, but now I get 1106 - permission deny.

@frenck
Copy link
Member

frenck commented Nov 4, 2021

ℹ️ update.

This is an upstream issue @ Tuya. They are working on a solution.

@elyobelyob
Copy link
Contributor

elyobelyob commented Nov 4, 2021

Managed to login an hour ago and started fixing all my name migrations from V2 to Core .. then it all fell over again. Same 1106 error. Hopefully this will prove to Tuya user reliance on cloud isn't the best idea and will include local at some point in the future.

@CraigN
Copy link

CraigN commented Nov 4, 2021

I noticed my upgrade from 2021.10.x to 2021.11.0 broke the Tuya integration again. Was previously forced to select country Germany to login. Now unable to login as my real country South Africa or Germany. Getting the same 1106 Permission Deny error.

@frenck
Copy link
Member

frenck commented Nov 4, 2021

@CraigN Please, see a couple of messages above yours...

#58145 (comment)

Your comment will not help with that. Please have some patience while they resolve their issue.

@ssm84
Copy link

ssm84 commented Nov 4, 2021

Do we have any eta on resolution? Or I just need to have faith🤣 can’t be to soon to have local control 🥳

@scambo00
Copy link

scambo00 commented Nov 4, 2021

I was able to get the integration to work by removing the eastern American data center and adding the western American data center to my IOT application and relinking that to my Tuya app account

@babelhoo
Copy link

babelhoo commented Nov 4, 2021

hey, doing what @scambo00 suggested worked for me as well!

@ssm84
Copy link

ssm84 commented Nov 4, 2021

not a working solution for europe

@iMarkus
Copy link
Contributor

iMarkus commented Nov 4, 2021

I managed to login now.

It still said 1106 and then i switched to United States and back to my location and finally it works.

@nkorosi
Copy link

nkorosi commented Nov 4, 2021

I tried the same. However, when I try to relink the account and scan the QR Code from my App, it errors because my app apparently stored everything in a different data center. Or I'm doing it wrong. :) I'll just wait and see what happens here.

Edit: I spoke to soon. I just looked and mine is working again. I just deleted my link and re-setup to the same Western America data center.

@ssm84
Copy link

ssm84 commented Nov 4, 2021

Found working solution...tested!!
https://www.reddit.com/r/homeassistant/comments/qmla4o/tuya_login_error_1106_permission_deny/

@Jeffrey-JK
Copy link

Changing my password, then changing it back worked for me too.

@bdraco bdraco changed the title New Tuya Integration 'Permission Deny' Error New Tuya Integration 'Permission Deny' Error (Upstream issue at Tuya) Nov 4, 2021
@stamandr
Copy link

stamandr commented Nov 4, 2021

I was able to get the integration to work by removing the eastern American data center and adding the western American data center to my IOT application and relinking that to my Tuya app account

Didn't work for me.....

@elyobelyob
Copy link
Contributor

Well, I've really screwed mine up now, as I can't re-link the integration due to "device deployed to another data centre". Been through every single one and can't see where ... grrr.

@Xorpereira
Copy link

You can have multiple data centers. When the issue first started I unlinked the account added all data centers in Europe and relinked it.
Since it got back never stopped working. I've been checking back regularly and is still working.

@Stooovie
Copy link

Stooovie commented Nov 4, 2021

Changing password and then changing it back fixed it for me as well.

@elyobelyob
Copy link
Contributor

You can, but I'm completely unable to relink to any data centre apart from China, and then I am blocked from using that. Tuya is FUBAR at present. I've tried everything, but this trust in HA and Tuya getting things done is massively undermined. Their IOT website is poor, the inability to remove a cloud project to wipe a slate clean is just massive warnings about their level to detail.

@Stooovie
Copy link

Stooovie commented Nov 6, 2021

You can, but I'm completely unable to relink to any data centre apart from China, and then I am blocked from using that. Tuya is FUBAR at present. I've tried everything, but this trust in HA and Tuya getting things done is massively undermined. Their IOT website is poor, the inability to remove a cloud project to wipe a slate clean is just massive warnings about their level to detail.

Tried and true fix: in Tuya/Smart life app, change your password and then change it back to what it was. Restart HA, it will log in and Tuya integ will work.

@ben0551
Copy link

ben0551 commented Nov 10, 2021

Can confirm that changing password fixed the issue.

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@chrislinke
Copy link

Update on this one for anyone playing along and still has issues!
I'm in Australia (Central Europe Data Center according to documentation), and was consistently getting 0 devices shown in Tuya IoT and Permission Deny error in Hassio.
I 'shopped around' the data centers until I found one that showed my devices in Tuya IoT (Western America worked for me), but still had issues in Hassio with logging in. After mucking around with a few other data centers in Tuya IoT and only finding that one that worked, I tried changing my login 'country' to match the data center that worked. I selected United States in Hassio, despite my app having 'Australia' set as the region, and low-and-behold it worked! Seems as though the Country selection in Hassio just directs it to the Data Center that worked for you in Tuya (doesn't do a cross-check with App Region)? Happy to be told otherwise, trying to piece it together as to why it would work for me.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests