tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
868 stars 206 forks source link

Invalid authentication #53

Open remb0 opened 3 years ago

remb0 commented 3 years ago

Describe the bug 2021-07-03 20:48:44 INFO (SyncWorker_13) [custom_components.tuya_v2.config_flow] TuyaConfigFlow._try_login finish, response:, {'code': 2406, 'msg': 'skill id invalid', 'success': False, 't': 1625345324595}

Expected behavior I recreated a new account. changed pass in smartlife app. enabled all regions in IOT. I have the Netherlands as country in the smart life app. So I use europe and country code 31

Additional context I use version 2021.7 and 1.3 of the Tuya v2.

nellywelly commented 3 years ago

I have a similar issue. My tuya app is on +61 and my dev cloud project is set to China. "Invalid authentication"

Filip722 commented 3 years ago

I had the same problem with v1 addon while using an account that was made by "sign in with google". Maybe this applies here also?

djhampson commented 3 years ago

I'm also having this issue...

My Dev account is set to the US region. My Tuya Smart account is AU based. I've tried logging in with +61.

tsutsuku commented 3 years ago

@remb0 Try v1.3.1

djhampson commented 3 years ago

@tsutsuku I have tried 1.3.1 but still getting the following errors

2021-07-05 12:33:12 INFO (MainThread) [custom_components.tuya_v2.config_flow] TuyaConfigFlow.async_step_user start, is_import= {'password': 'xxxxxx', 'access_id': 'xxxxxx', 'access_secret': 'xxxxxx', 'tuya_app_type': 'tuyaSmart', 'country_code': '+61', 'username': 'xxxxxx'} 2021-07-05 12:33:12 INFO (SyncWorker_13) [custom_components.tuya_v2.config_flow] TuyaConfigFlow._try_login start, user_input: {'password': 'xxxxxx', 'access_id': 'xxxxxx', 'access_secret': 'xxxxxx', 'tuya_app_type': 'tuyaSmart', 'country_code': '+61', 'username': 'xxxxxx', 'tuya_project_type': 0} 2021-07-05 12:33:17 INFO (SyncWorker_13) [custom_components.tuya_v2.config_flow] TuyaConfigFlow._try_login finish, response:, {'code': 2406, 'msg': 'skill id invalid', 'success': False, 't': 1625452397444}

Filip722 commented 3 years ago

1.3.1 also gives me an error: 2021-07-06 01:59:08 INFO (SyncWorker_3) [custom_components.tuya_v2.config_flow] TuyaConfigFlow._try_login finish, response:, {'code': 1106, 'msg': 'permission deny', 'success': False, 't': 1625529548868}

djhampson commented 3 years ago

@Filip722 - Just found https://developer.tuya.com/en/docs/iot/Home_Assistant_Integration?id=Kamcjcbvk2mu8#title-5-FAQ . Have a look at the Error Code 1106 section Maybe this will help you.

patrik-malina commented 3 years ago

Found issue and workaround. I have google created acc on Smart Life app. Managed to connect with account name instead mail. It is long starting with gg-and some numbers. You can find it under Me->Home Management->Your home->Home owner

nellywelly commented 3 years ago

I just resolved the issue by selecting myy country as china on IOT dev platform. So server and IOT platform are on same server. I dont know if i might have to confirm / validate a chinese number for this.

my country code was still Aus +61 on the hacs login

tsutsuku commented 3 years ago

v1.3.1 does not need region, so how about update to v1.3.1, then try again?

0xa51f commented 3 years ago

unable to setup the integration with 'Invalid authentication'

getting the following in logs:

(SyncWorker_5) [custom_components.tuya_v2.config_flow] TuyaConfigFlow._try_login finish, response:, {'code': 2406, 'msg': 'skill id invalid', 'success': False, 't': 1625825186435}

UPDATE:

resolved by creating new project and linking device by app account as per https://github.com/tuya/tuya-home-assistant/issues/46

djhampson commented 3 years ago

My issue was also resolved by linking my tuyasmart account with my iot project image

christosmilts commented 2 years ago

Initially I also got an error message: "Login error (2406): skill id invalid". I can only guess that it's because my Cloud Project was created months ago. The issue was resolved as soon as I created a new Cloud Project (new Access ID / Access Secret), which didn't take more than 2 minutes

omolko commented 2 years ago

Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634419966766}

If someone could héla me??

Yonny24 commented 2 years ago

Initially I also got an error message: "Login error (2406): skill id invalid". I can only guess that it's because my Cloud Project was created months ago. The issue was resolved as soon as I created a new Cloud Project (new Access ID / Access Secret), which didn't take more than 2 minutes

Did you have to unlink your tuya app from the previous project? When I scan the qr code it says I cannot link 2 projects. My original project is old but still works most of the time. I'm trying to get Tuya 2 set up. Created a new project as you did and tried to enter the details in HA but keep getting the 'skill id invalid'

Yonny24 commented 2 years ago

Changed the data center, unlinked my app from the old and relinked it. Worked then. Chose Western American instead of the default chinese data center in the top far right

edwinyoo44 commented 2 years ago

Tuya login error response: {'code': 500, 'msg': 'system error,please contact the admin', 'success': False, 't': 1634419966766}

If someone could héla me??

See here #586. It works for me

mygit1405 commented 2 years ago

Do the devices need to be flashed for this to work with Home assistant?

UPDATE: In HA, and when adding TUYA it failed when I selected Australia. ERROR = Login error (2406): skill id invalidI Solution (that worked for me) = I changed to United Kingdom and it worked! How strange and perhaps due my Tuya iOT account and the DB being assigned to "Central Europe Data Center"? Seems like Tuya is a mess.

omolko commented 2 years ago

No

Le jeu. 21 oct. 2021 à 01:42, mygit1405 @.***> a écrit :

Do the devices need to be flashed for this to work with Home assistant?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tuya/tuya-home-assistant/issues/53#issuecomment-948115914, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE62OLJ3KUVJDCRWFRUMKFTUH5HWHANCNFSM47YPEXZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

FrancYescO commented 2 years ago

in my case was due to the fact that i have selected all regions in the data center field, selecting only one (Central Europe, nearest to where i live) allowed me to login in HA

PecceG2 commented 2 years ago

Changing the country just above the ID (while adding the integration in the home assistant) fixed my problem. It seems that some countries are not accepted as valid when trying to integrate.

mexmetmx commented 2 years ago

Tuya mixed everything up. While everything was normal 2 weeks ago, now we are dealing with invalid conf, error 500 s. There was a Local Tuya that I could work with everything, unfortunately, this doesn't happen anymore. I hope everything will be fine as soon as possible. It would be best if there was at least a Local Tuya who works with everything. Nobody will go to iot.tu and develop the software anyway, I have no words.

FrancYescO commented 2 years ago

In my case localtuya still work as before. But yes this official integration is a mess, harder to setup, and give nothing more to us (i.e. I still need to use localtuya to access energy monitor data of a plug)

chaoscode commented 2 years ago

Tuya, you all need to get your act together and just give us local access to the devices we own. This is really crazy.

erenoglu commented 2 years ago

I was getting code 2406 skill id invalid. My country is United Arab Emirates and my Datacenter according to Mappings is Central Europe. I changed country settings in Home Assistant Tuya account add-on UI to United Kingdom instead of United Arab Emirates and it started to work. Not sure why it's not accepting UAE.

jerptrs commented 2 years ago

This just seems like a huge mess and shit show. Sometimes it works, then it suddenly stops working, then it won't even finish the setup. SMH.

Even the response from the API is displayed wrong. "Invalid Skill ID" shows as "Invalid Authentication". In the documentation it states "enter the country code you've selected when creating your app account" - I haven't selected a country code, I've selected a country name...

zlinoliver commented 2 years ago

Hi @remb0, sorry for the inconvenience. This has been fixed in the Home Assistant Core integration version, which is available now with Home Assistant Core 2021.11.

You can check the Error Code and Troubleshooting to help resolve the error code issues.

As we stop maintain the Tuya v2 now, please help to create your github issues in the Home Assistant Core repository. And it's still maintained by Tuya developer team and Home Assistant Team.

gallilee commented 2 years ago

Thanks, authentication works with the core integration

omolko commented 2 years ago

thanks . Happy to find back my Tuya . No way to remove iot "trying project" done without success for Tuya V2?

josepeinado commented 2 years ago

Dear @zlinoliver thanks for your response. Considering "Tuya v2" won't be supported anymore by the Tuya team, is there any way to integrate the Tuya Wifi door/window sensors into HA anyhow?

Thanks.