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

Error 2406 #134

Closed
Bentrama opened this issue Oct 18, 2021 · 41 comments
Closed

Error 2406 #134

Bentrama opened this issue Oct 18, 2021 · 41 comments

Comments

@Bentrama
Copy link

Hello

im trying to setup home bridge but it doesn’t work.
I always get error 2406 : Skill Invalid.
My data center is set to : Central Europe
I’m from Belgium and selected Belgium in the Tuya app
My app is linked to the Tuya IOT platform
Acces ID and access key are correct also
Login and password on home bridge plugin are the same as the app

but it doesn’t work. Always return a 2406 error. What can I do ?

@github-actions
Copy link

Thank you for your feedback, we will solve this issue soon

@Bentrama
Copy link
Author

Uploading BD23CC87-9768-49A2-8291-315CB575F972.jpeg…

@MeesMaas
Copy link

I have the same issue

@CaneEmm
Copy link

CaneEmm commented Oct 19, 2021

Same problem here too!

@ryanlbates01
Copy link

Im also getting the same issue.
My homebridge logs:
TuyaOpenAPI response: {"code":2406,"msg":"skill id invalid","success":false,"t":1634665343274} path = /v1.0/iot-01/associated-users/actions/authorized-login
TypeError: Cannot destructure property 'access_token' of 'res.result' as it is undefined.
at TuyaSHOpenAPI._refreshAccessTokenIfNeed (/usr/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:48:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at TuyaSHOpenAPI.request (/usr/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:144:7)
at TuyaSHOpenAPI.getDevices (/usr/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:62:15)
at TuyaPlatform.initTuyaSDK (/usr/lib/node_modules/homebridge-tuya-platform/index.js:90:19)
Attention⚠️ ⚠️ ⚠️ ! You get an error!

@ryanlbates01
Copy link

I found a workaround to this issue.

I had to input my personal information into the tuyashopenapi.js program directly.
after doing this I was able to generate an access token and my devices are now showing in my home app

/usr/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js

my example:

const axios = require('axios').default;
const Crypto = require('crypto-js');
const uuid = require('uuid');
const nonce = uuid.v1();
class TuyaSHOpenAPI {

constructor(accessId, accessKey, username, password, countryCode, appSchema, log, lang = 'en') {
this.countryCode = 44;
this.endpoint = 'https://openapi.tuyaeu.com'
this.access_id = 'df6';
this.access_key = '5
***********8e';
this.lang = lang;
this.username = 'r@m';
this.password = '
';

this.appSchema = 'tuyaSmart';
this.log = log;

@Tomcraft1980
Copy link

Tomcraft1980 commented Oct 20, 2021

The only thing you need to do is changing the endpoint:

    //this.endpoint = (this.countryCode && this.countryCode == 86)? 'https://openapi.tuyacn.com' : 'https://openapi.tuyaus.com'
    this.endpoint = 'https://openapi.tuyaeu.com';

@Bentrama
Copy link
Author

The only thing you need to do is changing the endpoint:

//this.endpoint = (this.countryCode && this.countryCode == 86)? 'https://openapi.tuyacn.com' : 'https://openapi.tuyaus.com'
this.endpoint = 'https://openapi.tuyaeu.com';

Where should I change it ?

@Tomcraft1980
Copy link

In file /usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js

@Bentrama
Copy link
Author

Bentrama commented Oct 20, 2021

So I can edit that file directly from Homebridge terminal ? Sorry for all the questions but I’m new to homebridge
I replace the first line with the second right ?

@Tomcraft1980
Copy link

Tomcraft1980 commented Oct 20, 2021

Sure! You can either use "vi" or "nano" editor.
So the command is either:
sudo vi /usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js
or:
sudo nano /usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js

Just replace the line (or comment out using double slashes // as mentioned before):

    this.endpoint = (this.countryCode && this.countryCode == 86)? 'https://openapi.tuyacn.com' : 'https://openapi.tuyaus.com'

with the new line for european users:

    //this.endpoint = (this.countryCode && this.countryCode == 86)? 'https://openapi.tuyacn.com' : 'https://openapi.tuyaus.com'
    this.endpoint = 'https://openapi.tuyaeu.com';

EDIT: I currently don't get all my devices shown up in Home App, only the switches. Currently thermostat and curtain switches don't show up. Therefore I currently use this plugin: https://github.com/milo526/homebridge-tuya-web

@Bentrama
Copy link
Author

22114967-6416-4366-81E3-A8144815CFBB

i tried what you asked but get this error now

@Tomcraft1980
Copy link

Have a look at the screenshot. The error is marked with the ^^^^^^ signs. ;-)

Edit the file again and replace the duplicate single quotes (or is it a single double quote?) in the line where you changed the endpoint URL.

@TheWojtek
Copy link

Most probably this one is a copy of #131

@lliebold
Copy link

Sure! You can either use "vi" or "nano" editor. So the command is either: sudo vi /usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js or: sudo nano /usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js

Just replace the line (or comment out using double slashes // as mentioned before):

    this.endpoint = (this.countryCode && this.countryCode == 86)? 'https://openapi.tuyacn.com' : 'https://openapi.tuyaus.com'

with the new line for european users:

    //this.endpoint = (this.countryCode && this.countryCode == 86)? 'https://openapi.tuyacn.com' : 'https://openapi.tuyaus.com'
    this.endpoint = 'https://openapi.tuyaeu.com';

EDIT: I currently don't get all my devices shown up in Home App, only the switches. Currently thermostat and curtain switches don't show up. Therefore I currently use this plugin: https://github.com/milo526/homebridge-tuya-web

tried it, now got the following error:
TuyaOpenAPI response: {"code":1106,"msg":"permission deny","success":false,"t":1635110907701} path = /v1.0/iot-01/associated-users/actions/authorized-login
TypeError: Cannot destructure property 'access_token' of 'res.result' as it is undefined.
at TuyaSHOpenAPI._refreshAccessTokenIfNeed (/homebridge/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:50:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at TuyaSHOpenAPI.request (/homebridge/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:146:7)
at TuyaSHOpenAPI.getDevices (/homebridge/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:64:15)
at TuyaPlatform.initTuyaSDK (/homebridge/node_modules/homebridge-tuya-platform/index.js:90:19)
Attention⚠️ ⚠️ ⚠️ ! You get an error!

@Tomcraft1980
Copy link

Seems like you do not have permission to access the API.

@Bentrama
Copy link
Author

I have the same, even if all the API have permissions. And my lights bulb appear but not my exterior RGBW light (Lsc Smart) so for now I use also the Tuya-web plugin

@TheWojtek
Copy link

Keep in mind the password in plugin configuration must be the password from the mobile app and not the password from the iot.tuya.com

@Tomaholk1
Copy link

#144

@Hanh94
Copy link
Contributor

Hanh94 commented Nov 2, 2021

Hi guys, Sorry for the late reply.
Recently our server is making cross-region adjustment of devices, so foreign cross-region cannot access each other. Tuya HB plugin has fixed this problem, and a new version will be released soon.

@Hanh94
Copy link
Contributor

Hanh94 commented Nov 3, 2021

The issue has been fixed and released in version 1.5.0

@chrise86
Copy link

chrise86 commented Nov 4, 2021

@Hanh94 since 1.5.0 I cannot login at all. I just get error 1106 all the time now.

@ryanlbates01
Copy link

@Hanh94 I too am now getting the 1106 error since updating to 1.5.0

@ryanlbates01
Copy link

@Hanh94 I have also tried rolling back to 1.4.2 and i am still getting the 1106 error

@jlucasnc
Copy link

jlucasnc commented Nov 5, 2021

Hello. I can't access too. I did the change on URL but same issue:

TuyaOpenAPI response: {"code":1106,"msg":"permission deny","success":false,"t":1636072232018} path = /v1.0/iot-01/associated-users/actions/authorized-login TypeError: Cannot destructure property 'access_token' of 'res.result' as it is undefined.

What are the data centres options you are using? Thanks in advance.

@Hanh94
Copy link
Contributor

Hanh94 commented Nov 5, 2021

Hi guys.
Sorry for the inconvenience, we have found the cause of the 1106 error, it's related to the account password validation, not related to v1.5.0. We will fix it ASAP.

@Hanh94 Hanh94 mentioned this issue Nov 5, 2021
@ryanlbates01
Copy link

@Hanh94 Do you have an ETA on a fix/resolution to the 1106 error?

@bluntiless
Copy link

Hi everyone, I was getting the same error yesterday and it was resolved. However it has come back again this morning:

TuyaOpenAPI response: {"code":1109,"msg":"param is illegal, please check it","success":false,"t":1636109496612} path = /v1.0/iot-01/associated-users/actions/authorized-login
TypeError: Cannot destructure property 'access_token' of 'res.result' as it is undefined.
at TuyaSHOpenAPI._refreshAccessTokenIfNeed (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:48:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at TuyaSHOpenAPI.request (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:144:7)
at TuyaSHOpenAPI.getDevices (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:62:15)
at TuyaPlatform.initTuyaSDK (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:90:19)
Attention⚠️ ⚠️ ⚠️ ! You get an error!

@bluntiless
Copy link

TuyaOpenAPI response: {"code":2406,"msg":"skill id invalid","success":false,"t":1636116141984} path = /v1.0/iot-01/associated-users/actions/authorized-login
TypeError: Cannot destructure property 'access_token' of 'res.result' as it is undefined.
at TuyaSHOpenAPI._refreshAccessTokenIfNeed (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:49:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at TuyaSHOpenAPI.request (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:145:7)
at TuyaSHOpenAPI.getDevices (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:63:15)
at TuyaPlatform.initTuyaSDK (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:90:19)
Attention⚠️ ⚠️ ⚠️ ! You get an error!
Failed to get device information. Please check if the config.json is correct.

@xrust83
Copy link

xrust83 commented Nov 5, 2021

I have the same problem. On the website Tuya api already offer to include some kind of plan for $ 1200 or go to the Trial Edition plan for 1 month. If they want money this will be the last TuYa device I bought.

@JaredSartin
Copy link

Hi guys. Sorry for the inconvenience, we have found the cause of the 1106 error, it's related to the account password validation, not related to v1.5.0. We will fix it ASAP.

Still being worked on?

@DJBenson
Copy link

Keep in mind the password in plugin configuration must be the password from the mobile app and not the password from the iot.tuya.com

Really important point!!

@JaredSartin
Copy link

JaredSartin commented Dec 11, 2021 via email

@cbaddah
Copy link

cbaddah commented Jan 13, 2022

I am having the same issue. Do we know if this problem has been fixed?

@dehness
Copy link

dehness commented Jan 19, 2022

Same issue for me...

@Ieuanoh
Copy link

Ieuanoh commented Feb 4, 2022

For anyone having this issue - I was able to fix it by manually entering the config values into the Homebridge ui config json rather than using the input fields in the plugin. The main ones that seemed to be missing from when it was configured with the plugin ui were 'countryCode' and 'endpoint'. Take a look at the instructions on the readme to see what these values should be rather than relying on the plugin ui. Also the country code should be a number (e.g. 44 for United Kingdom) not the country code string (e.g. gb) as stated in the plugin ui. This fixed the issue for me. Hope this helps!

The plugin ui should be fixed to account for this or the docs should clarify this a little more.

@igorayres-falepaco
Copy link

Hello guys, i'm with this same erros...

Anyone can help?

TuyaOpenAPI response: {“code”:2406,“msg”:“skill id invalid”
Failed to get device information. Please check if the config.json is correct.

this is my config.js file:

{
"bridge": {
"name": "homebridge-tuya-platform",
"username": "BE:B9:AC:79:6C:CA",
"port": 8081,
"pin": "034-85-687"
},

"description": "This is an Homebridge Plugin of Tuya.",

"platforms": [
    {
        "platform": "TuyaPlatform",
        "name": "TuyaPlatform",
        "options":
          {
            "username": "some_email",
            "password": "some_pass",
            "accessId": "some_id",
            "accessKey": "some_key",
            "lang": "en",
            "endPoint":"https://openapi.tuyaus.com",
            "projectType": "2",
            "appSchema": "tuyaSmart",
            "countryCode": 44,
            "debug":true
          }
    }
]

}

I’m in Brazil, and already try few contry codes: 86, 55 but noone worked…

@igorayres-falepaco
Copy link

For anyone having this issue - I was able to fix it by manually entering the config values into the Homebridge ui config json rather than using the input fields in the plugin. The main ones that seemed to be missing from when it was configured with the plugin ui were 'countryCode' and 'endpoint'. Take a look at the instructions on the readme to see what these values should be rather than relying on the plugin ui. Also the country code should be a number (e.g. 44 for United Kingdom) not the country code string (e.g. gb) as stated in the plugin ui. This fixed the issue for me. Hope this helps!

The plugin ui should be fixed to account for this or the docs should clarify this a little more.

Hello my friend,

Could you please share your config.js file?

@igorayres-falepaco
Copy link

igorayres-falepaco commented Feb 11, 2022

Hello everyone, I DID IT!

First of all, only work on my new tuya accont, I have a 2 years tuya account, and I just can't make work, so if your Tuya account is 6 months or older, I recommend create a new one.

When I create a new cloud project on tuya platform, I'm select both servers: Eastern and Western (I'm in Brazil).

On Devices - link tuya app account, I have to conect with my app account on both servers (Westean and Eastern), I have to make this procedure, twice (read the QR code)

image

After this, I just return om my homebridge server, put my account information, and IT's WORKS!!

This is my config.js file:

image

@leo150
Copy link

leo150 commented Feb 23, 2022

I reported 1109 to tuya support and they answered:

Hi dear, thank you for contacting Tuya. Your issue is being handled. Thank you for your patience.

You can reported the issue here https://service.console.tuya.com/ for faster "handling".

@github-actions
Copy link

Stale issue. we will close the issue soon. If this issue has not been resolved, please update the issue and contact us in time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests