Closed ipa64 closed 1 year ago
Now it’s still working after more than 12h without any issue ! Wait and see
I got this issue only first day, not anymore after ! So I close
Hi, was working few weeks, then these last days again code 1010 token expired Just restart the plugin and it works again for a while
Hi @ipa64, please try @0x5e/homebridge-tuya-platform beta version, it reimplemented the login and token fetch procedure. It should work now.
By the way, what projectType are you using? Is it Custom
?
Do you mean Development Method?
My project settings: Industry=Smart Home Development Method=Smart Home
Hi @ipa64, please try @0x5e/homebridge-tuya-platform beta version, it reimplemented the login and token fetch procedure. It should work now.
Thank you, on the way
OK. Could you provide the request and response logs of /v1.0/iot-01/associated-users/actions/authorized-login
, /v1.0/token
, if the beta version still not work?
OK. Could you provide the request and response logs of
/v1.0/iot-01/associated-users/actions/authorized-login
,/v1.0/token
, if the beta version still not work?
Yes of course ! Thank you
OK. Could you provide the request and response logs of
/v1.0/iot-01/associated-users/actions/authorized-login
,/v1.0/token
, if the beta version still not work?
Seems to have the same issue, but not really sure, because the option to activate debug log is missing, is there another way to enable debug ?
Add -D
params when start homebridge: homebridge -D
Or if you are using web, the debug mode can be found in the setting page.
Add
-D
params when start homebridge:homebridge -D
Or if you are using web, the debug mode can be found in the setting page.
precisely it is not here on the setting page of in the beta version
I have just found the debug switch in homebridge settings, with the plugin v1.5 it was one on the setting plugin
Yeah I mean homebridge setting page :)
OK. Could you provide the request and response logs of
/v1.0/iot-01/associated-users/actions/authorized-login
,/v1.0/token
, if the beta version still not work?
here we are, but don't if it's what you are asking for :-)
`[37m[10/25/2022, 7:53:48 PM] [39m [36m[@0x5e/homebridge-tuya-platform] [39m [90mTuyaOpenAPI response: path = /v1.0/iot-01/associated-users/actions/authorized-login, data = {"result":{"access_token":"97aad7563f71f89a342b4620a59c3c59","expire_time":7200,"platform_url":"https://openapi.tuyaus.com","refresh_token":"2d1ad6412ab362f086101eca3a108d38","uid":"az1664451251132ekqP5"},"success":true,"t":1666702428447,"tid":"11664f98546411ed918366cd25043e07"}
[37m[10/25/2022, 9:52:50 PM] [39m [36m[@0x5e/homebridge-tuya-platform] [39m [90mTuyaOpenAPI response: path = /v1.0/token/2d1ad6412ab362f086101eca3a108d38, data = {"code":1010,"msg":"token is expired","success":false,"t":1666709570756,"tid":"b294e393547411ed918366cd25043e07"} `
OK. Could you provide the request and response logs of
/v1.0/iot-01/associated-users/actions/authorized-login
,/v1.0/token
, if the beta version still not work?here we are, but don't if it's what you are asking for :-)
`[37m[10/25/2022, 7:53:48 PM]
[39m
[36m[@0x5e/homebridge-tuya-platform]
[39m
[90mTuyaOpenAPI response: path = /v1.0/iot-01/associated-users/actions/authorized-login, data = {"result":{"access_token":"97aad7563f71f89a342b4620a59c3c59","expire_time":7200,"platform_url":"https://openapi.tuyaus.com","refresh_token":"2d1ad6412ab362f086101eca3a108d38","uid":"az1664451251132ekqP5"},"success":true,"t":1666702428447,"tid":"11664f98546411ed918366cd25043e07"}
[37m[10/25/2022, 9:52:50 PM]
[39m
[36m[@0x5e/homebridge-tuya-platform]
[39m
[90mTuyaOpenAPI response: path = /v1.0/token/2d1ad6412ab362f086101eca3a108d38, data = {"code":1010,"msg":"token is expired","success":false,"t":1666709570756,"tid":"b294e393547411ed918366cd25043e07"}
`
That's wierd. can you also provide the request part? there's only response. the sensitive part can be replaced
This is it ? (Note I am not sure what sensitive part are)
[90mTuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/token/2d1ad6412ab362f086101eca3a108d38, params = undefined, body = null, headers = {"t":"1666709569834","client_id":"xxxxxxxxxxxxxxx","nonce":"xxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxx","Signature-Headers":"client_id","sign":"xxxxxxxxxx","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.12"}
yes, let me have a test.
1.6.0-beta.14 should working now. @ipa64 There was some mistake in the code.
Stale issue. we will close the issue soon. If this issue has not been resolved, please update the issue and contact us in time.
Describe the bug After a plugin restart (or restart Homebridge) all is working as expected (1x Tuya monitoring plug, 1x Tuya miniSwitch can be ON/OFF from homekit), but after un bit less than 2 hours I got a token expired code 1010 in the log file (debug ON).
Expected behavior The plugin should refresh the token before it expired. I guess if the first token could be created it should not be a configuration problem.
**Device info (please complete the following information, which can be found in [log]
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/devices/eb2c4c4425902f8253dqv0/commands, params = null, body = {"commands":[{"code":"switch_1","value":false}]}, headers ={"t":"1664956300703","client_id":"xxxxxxxxxxx","nonce":"xxxxxxxx","Signature-Headers":"client_id","sign":"DCD0AC982E6C15E227197E9F4366718Xxxxxxx","sign_method":"HMAC-SHA256","access_token":"03ff96847228798b7f2e4f23c306exxx","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.5.0"} TuyaOpenAPI response: {"code":1010,"msg":"token is expired","success":false,"t":1664956301xxx,"tid":"8cbec1ac448211ed820d56272bexxx"} path = /v1.0/devices/eb2c4c4425902f8253dqv0/commands
Additional context Add any other context or logs about the problem here.