Tuya Integration setup failure - Invalid authentication

Ok so it took me quite some time to figure this out, here’s what solved it for me.

In Sweden where I am the app Nedis SmartLife (by NEDIS) is promoted as the app to use. By coincidence I found that there is another app called Smart Life (by Tuya Inc.) which is the app you have to register and use for the integration in Home Assistant to work.

Steps I did to resolve my issue

  1. Downloaded Smart Life by Tuya Inc. from Google Play Store
  2. Registered new account using my email (gmail in my case) (I did not login with my google account SSO)
  3. Reset my light and connected it to the app
  4. Added the Tuya integration through the HA GUI, entered my email as username and password I set. (including special characters). Set my country code (46) and chose “Smart Life” as platform.

Worked right away.

So my theory is that “Nedis SmartLife” is not the same as “Smart Life” referred to in the Home Assistant Tuya integration setup.

I hope this can help others like myself who searched and searched for a solution. If others can confirm this is correct then the documentation should be updated to help new users.

4 Likes

I might be a little late here, but I was having issues using a hotmail account for the email. Worked as soon as I switched the account to a gmail account

I had the same issue. It worked after I choosed a password without any special characters like a questionmark.

Mobile notification setup works for me. After that integration works with mobile number as login. Thank you!

I had this problem with an e-mail address used for an account in both the Tuya app and the Smart Life app.

I created a new account for Smart Life, with another e-mail address not used before, invited this account to the home, and now it works!

1 Like

This worked, thanks man!

Adding configuration via YAML helped me to overcome this issue.

This is what worked for me with the regular Smartlife app. Took me a while to get it going.

Something I have checked on code base and figured out that the integration doesn’t use the correct region url based on the country.

If you are desperately trying to connect your devices and you don’t have time to wait for the patch, Delete existing account in another country, create an account in country "United States"

I have created a bug/feature at home assistant. https://github.com/home-assistant/core/issues/44922

1 Like

I tried as well, but the option is not there in Tuya. :’( I’ve checked everything in the app. Changed my PW a couple of times. Changed my email. Tried my phone # but that doesn’t work either. No clue what to check next! But the option indicated above isn’t there.

I tried that. Set a password that was just uppercase, lowercase, and a number. Still getting the same thing. I get either “Invalid authentication” or “Aborted Failed to connect”. I’ve been fighting with this for several days now and it’s getting really irritating! Not sure if it’s an issue with Tuya, or with Home Assistant.
Screenshot 2021-01-12 150615

What is your country code? If you are trying with an account that has country other than USA, this must fail. Since there is a rate limiting from tuya, when you try second time in 1 minute, it gives “Failed to connect error”

Country code is 1 (USA/Canada). Only thing I have not tried yet is to delete my Tuya account and create a new one starting with my email address instead of using Google account. Found in the notes above where that resolved it for someone… I did change Tuya to use a different email account, and back again, as well, but that didn’t help. Just not excited about completely redoing my Tuya configuration at this point since I’ll likely be re-flashing all of my devices to Tasmota at some point anyway.

In fact, I may just say screw it, and re-flash all of the devices to Tasmota instead of messing with Tuya. I’d rather not be giving my activities up to a 3rd party to handle anyway… I’ve already flashed an extra 3-way that I have, with success. We’ll see. That’s even more work, but it will be done at some point. :anguished: Between work and other necessities, I don’t have as much time as I’d like to mess with this.

This fix worked for me.

  1. Head over to you file editor and add this to your configuration.yaml. If your are already registered with either smartlife or tuya it should work.

tuya:
username: [email protected]
password: yourpassword
country_code: xx

  1. Then go to configurations>Integrations>add integration>tuya
  2. when you get to the tuya dialog box
    re-enter your username that you entered in your configuration.yaml file and select the app that you registered in. For me it was smart life.

Hope it works for you.
Cheers.

1 Like

What I did:

If you are experiencing that error with a linked Google account(SSO). Try creating a ‘regular’ new account just using your e-mail and setting a password. I did that and 1 minute after I could connect from my HA. I’m using SmartLife.

Cheers,
Andre

current version of home assistant give the following error message:

WARNING:homeassistant.components.tuya:The 'tuya' option is deprecated, please remove it from your configuration

Still not able to complete authentication with the integration ui
Note, that I have LocalTuya installed as well. But it should not affect the login of the Tuya integration.
I have verified that my credentials are correct, and I can login to auth.tuya.com

Any suggestions would be appreciated

If you use the Smart Life mobile app by Volcano Technology Limited,
in this app you can go to Profile > Setting -> About -> Download Log (maybe little wrong)
In the popup, you will find the “User Account” filed.
This field is what exactly you should use as username.
But for me, when registered with Google, this value was like gg-[many-many-numbers] and does not work with HA.
When registered with mail, it was like my@mail and working perfectly with HA.

2 Likes

LOL. that was it … Code 39 worked. THANKS!!

What worked for me was only creating a password with letters and numbers. (no special characters)

1 Like