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
876 stars 206 forks source link

2406 skill id invalid #613

Closed mifrith closed 3 years ago

mifrith commented 3 years ago

Hello! Following the instructions, I created a new account and a new project. When I try to log in, I get an error: Invalid authentication. In logs: 2021-10-21 10:33:31 ERROR (MainThread) [custom_components.tuya_v2.config_flow] Login failed: {'code': 2406, 'msg': 'skill id invalid', 'success': False, 't': 1634801611400}. The SmartLife account is linked, the devices on the Tuya website are visible. "Central Europe Data Center" is selected in the project settings, country code for authorization is 7.

Hennie59 commented 3 years ago

Same error here. Also on Central Europa Data Center. Country code 31.

Actpohomoc commented 3 years ago

Same to me. Login error (2406): skill id invalid. Recreate project two times. Never find "Smart Home Devices Management" API service. I had project before 22-09-2020. Subscribe to everything that can find related.

I think this is that moment when we have to move to ESPHome!

mazzy89 commented 3 years ago

Yeah same here. no luck. neither the support could help. time to move to a better ecosystem.

zlinoliver commented 3 years ago

Hi @mifrith , the Tuya developer team really appreciates your contributions and efforts to this Tuya v2 integration project. As we stop maintaining it now, please help to recreate your issue in the Home Assistant Core repository: https://github.com/home-assistant/core/tree/dev/homeassistant/components/tuya

nescada commented 3 years ago

the problem is that the official integration doesn't support yet the same sensors that tuya v2

mazzy89 commented 3 years ago

@zlinoliver then please mark this integration as broken because it does not even support the basic functionalities and make the repo achieved. there is no sense to leave it around because it is broken if it can't even support proper authentication and configuration.

zlinoliver commented 2 years ago

Hi @mifrith @Hennie59 @mazzy89 , this error is caused by the cross-region API calls prohibition. The Tuya v2 has bug in the config_flow.py file, the TUYA_ENDPOINT_OTHER uses "https://openapi.tuyaus.com" for any country outside China, which is unreasonable. It causes the authentication error.

This issue is fixed in the Tuya HA Core version, please try it and see if it can resolve your issue.

We have already remove the Tuya v2 code from the master branch for this repo, you can still find the code in tuya-v2-backup branch.

ilanfroi commented 2 years ago

Hi, I dont know if it helps anyone, but the only way i managed to get it to work is by selecting UK as my country (dispite the fact that on Tuya developer site this is not my selection). I don't know why, but it worked and the integration didnt show the 2406 error anymore

mazzy89 commented 2 years ago

That's really weird that it works because as stated above the URL of the API is set for the US DC so unless you selected shouldn't work.

werdnum commented 2 years ago

This issue is fixed in the Tuya HA Core version, please try it and see if it can resolve your issue.

I'm on Home Assistant 2021.10.4, and I am using the built-in Tuya integration, and encountering the exact same issue.

madmaiike commented 2 years ago

Having the issue on Core 2021.10.6 - been looking at videos and following this thread.

When using UK as the country - it works as well even though I only see two devices when I have 5 detected in tuya iot platform.

Climate temperature is way off.

I'm guessing it's because it is not yet supported - devices are smart lock - bluetooth pin - mesh gateway for the smart lock.

ilanfroi commented 2 years ago

That's really weird that it works because as stated above the URL of the API is set for the US DC so unless you selected shouldn't work.

Hi, Some additional information. The original country i have selected was Israel that should be apart of the central Europe datacenter. when i tried to authenticate again i got the 2406 error. on the 2nd attemped i selected a diffrent country which belongs to Central Europe (France) and the authentication worked correctly and the devices apeared.

werdnum commented 2 years ago

It looks a great deal like this file needs to be updated with the correct mappings: https://github.com/home-assistant/core/blob/dev/homeassistant/components/tuya/const.py#L534-L775

werdnum commented 2 years ago

Confirmed, when I set the correct endpoint for Australia in const.py and rebuilt the Docker image, I was able to successfully link my account.

SebCar62 commented 2 years ago

bonjour j'ai réussi a contournez l'erreur .j'ai mis comme pays Spain a la place de switzerland. et cela a fonctionnez

tekelectron commented 2 years ago

This has to be the worse integration I have ever seen, it should be pulled instantly.

cnschulz commented 2 years ago

Yeah, this is super weird. Although my (original) app was set to mainland china (years ago) after trial and error I found my data in the USA. Im in Australia. They are really trying hard to make this overcomplicated. I just added ALL the data centres and kept selecting until it worked. Probably not the integration authors fault, just a crap implementation by Tuya. That said, smartthings isnt much better.

e-dupuis commented 2 years ago

Still having the issue on the latest docker version

virdb commented 2 years ago

same here, still broken

Tontze commented 2 years ago

You need to have a device in IoT platform... What helped for me was: Under "Devices" linked my Smartlife app to Tuya IoT platform, then under "all devces" added my Smartlife account and got my device listed. After this, i got rid of the error and my devices popped up :)

virdb commented 2 years ago

I can confirm. My issue was the location of the devices of my linked Smart Life. I changed the datacenter (in the device section) and linked my account again. Now the devices are presents and the integration works.

nanoamp commented 2 years ago

I didn't get any devices until I first set the correct datacenter under the owerview of the Tuya IoT platform. For me, it wasn't the obvious one from my geographical location - I needed to look-up the appropriate one here. I then linked my SmartLife account to the Tuya IoT platform via Devices > Link Tuya App Account. With the wrong datacenter selected, the SmartLife account would still link, but it wouldn't pick up any devices, and the HASS integration would throw this error.

luixal commented 2 years ago

So crazy! In case some gets here having the same problem I had:

Cheers!

rileyz commented 2 years ago

I had this error also.

https://developer.tuya.com/en/docs/iot/oem-app-data-center-distributed?id=Kafi0ku9l07qb

baylanger commented 2 years ago

I might have found a "workaround" for this.

I am in Eastern Canada/US and ran today into this same exact "2406 skill id invalid" issue.

First, I followed the instructions here. Installed Tuya Smart, created a tuya.com account created to add a Tuya Cloud Project (per instructions). Since I'm on East coast, I picked Eastern America Data Center"

Then I tried to configure Tuya in hass and kept getting the "2406" error. I scramble and went on a trial / error. Then I stumble on this Tuya document that shows some data centers are available only from specific regions... and I noticed "Eastern America DC" isn't even part of the list.

I went on tuya.com and added "Western America DC" to the Cloud Project. BINGO, my devices finally showed up on tuya.com IoT portal!

Bottom line, if you're trying to use Eastern America Data Center, try to use the Western one.

mschipperheyn commented 2 years ago

From Brazil, Western American doesn't work. Even though it is listed in the docs: https://github.com/tuya/tuya-home-assistant/blob/main/docs/regions_dataCenters.md None of the data centers works for Brazil. Also upgraded to home assistant: 2022.3.3

baylanger commented 2 years ago

if you put the code "55" try with "1" or vice-versa. Maybe Tuna has an issue with the site today?

Quaziz-creator commented 2 years ago

I give up! Nothing is working. I use other brands from now on

piereligio commented 2 years ago

GUYSGUYSGUYS solution found! From documentation: "Your cloud project on the Tuya IoT Development Platform should be created after May 25, 2021. Otherwise, you need to create a new project." For doing the new project I followed: https://developer.tuya.com/en/docs/iot/Platform_Configuration_smarthome?id=Kamcgamwoevrx and this: https://developer.tuya.com/en/docs/iot/Home-assistant-tuya-intergration?id=Kb0eqjig0utdd

josepeinado commented 2 years ago

@luixal I've tried to set it up for Spain. I selected Eastern Europe as the data center for my project and my smart life app is already linked but the same error appears: "Login failed: {'code': 2406, 'msg': 'skill id invalid'," when trying to install the Tuya V2 integration, any idea / suggestion? What's the literal code you entered: '34'? Thanks.

luixal commented 2 years ago

Hi @josepeinado , if you read my comment above, I selected "Central Europe", not Eastern. I don't know which literal I entered or if I entered any at all, I think it was just a dropdown. Anyhow, there's a table linked around for you to find you zone (Central Europe for Spain).

iamteedoh commented 2 years ago

Western and Eastern America worked for me and I'm in the Eastern US. Make sure that in the Tuya IoT project, you go to the Devices tab. After that, link you Tuya regular account so that all of the devices from your regular account show up in your IoT Tuya account. Finally, go back to Home Assistant and add the Tuya Integration. The Access ID and Token you'll add from the project in the Tuya IoT account. However, the username and password that you'll use for the integration will be the email address and password from the standard Tuya account and NOT the credentials from the Tuya IoT account.

SleepWalker commented 2 years ago

GUYSGUYSGUYS solution found! From documentation: "Your cloud project on the Tuya IoT Development Platform should be created after May 25, 2021. Otherwise, you need to create a new project."

this solved my issue. I have created my project a long time ago when I wasn't using HA and now tried to use it for HA. Recreating a new project have solved all the issues.

dracomithril commented 2 years ago

I had the same issue recently and to fix that I created new iot tuya project with Device Status Notification added just like in documentation and all started to work