tuya / tuya-homebridge

Homebridge custom plugin for controlling Powered by Tuya (PBT) devices in HomeKit. This plugin is officially maintained by the Tuya Developer Team.
MIT License
332 stars 168 forks source link

Code 2406 - after running smoothly for ages #298

Closed JaimeSLS closed 1 year ago

JaimeSLS commented 1 year ago

After using the plugins for ages now and everything running really smooth, I've got this error code now. I checked all the connections… I cant the error here. Didnt change a thing.

Can smb help?

Cheers Jaime

TuyaOpenAPI response: {"code":2406,"msg":"skill id invalid","success":false,"t":1665661964448,"tid":"8c8e356f4aed11eda7a4d2b5cc5248de"} 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 (node:internal/process/task_queues:96: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!

github-actions[bot] commented 1 year ago

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

tne7laa commented 1 year ago

+1. Same here. Tried rebooting, restarting. Can login in Tuya API site. Hope it is something simple. Plugin in Domoticz is working (https://github.com/Xenomes/Domoticz-TUYA-Plugin) luckily.

MeesMaas commented 1 year ago

I have the same.

Azukovskij commented 1 year ago

Tried different countries, VPN, nothing helped. Implemented workaround using different API https://github.com/Azukovskij/tuya-homebridge/commit/5eaa7e46543954c3ac991ea88e35eb4bbdd4f698 to retrieve access_token.

mmaslen commented 1 year ago

Same error here

aljorhythm commented 1 year ago

Same here

leo150 commented 1 year ago

I wish someone would implement a local tuya server. Window blinds to connect to a remote server is such a nonsense proven by this "suddenly" appeared error

antonkrall commented 1 year ago

Same issue here...today no longer working with homebridge

boris-dimitrov commented 1 year ago

Tried different countries, VPN, nothing helped. Implemented workaround using different API Azukovskij@5eaa7e4 to retrieve access_token.

Thank you for this workaround, it solved the problem for me.

mmaslen commented 1 year ago

Tried different countries, VPN, nothing helped. Implemented workaround using different API Azukovskij@5eaa7e4 to retrieve access_token.

Thank you for this workaround, it solved the problem for me.

tried this workaround, only works with a subset of my devices - power points (yes), contact sensors (no)

Azukovskij commented 1 year ago

Tried different countries, VPN, nothing helped. Implemented workaround using different API Azukovskij@5eaa7e4 to retrieve access_token.

Thank you for this workaround, it solved the problem for me.

tried this workaround, only works with a subset of my devices - power points (yes), contact sensors (no)

@mmaslen , can you check debug logs for errors?

JaimeSLS commented 1 year ago

I can agree the workaround from @Azukovskij is working fine.

Open ssh and navigate to nano /usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js

Edit the file as mentioned by @Azukovskij@5eaa7e4

Restart homebridge. Done

bkessels commented 1 year ago

Same problem here, tuya homebridge devices stopped working as of oct 13th.

The workaround from @Azukovskij fixed the problem for me.

Thanks for providing this.