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

token expired (1010) #14

Closed
PrimaveraNL opened this issue Oct 26, 2022 · 29 comments · Fixed by #36
Closed

token expired (1010) #14

PrimaveraNL opened this issue Oct 26, 2022 · 29 comments · Fixed by #36
Labels
bug Something isn't working
Milestone

Comments

@PrimaveraNL
Copy link

Over night, I do not touch anything.

In the morning, no accessories wil react to operation in Apple homekit app but they do react to Tuya app.

In the log there is an 'invalid token'. Is this some setting I need to change?

20221026T0920 log.txt

@PrimaveraNL PrimaveraNL added the bug Something isn't working label Oct 26, 2022
@0x5e
Copy link
Owner

0x5e commented Oct 26, 2022

Relates to tuya#296 , is processing.

@1aranzant
Copy link

following too!

@0x5e
Copy link
Owner

0x5e commented Oct 26, 2022

1.6.0-beta.14 should working now. @PrimaveraNL @1aranzant
There was some mistake in the code.

@PrimaveraNL
Copy link
Author

PrimaveraNL commented Oct 26, 2022

Currently running beta.13, homebridge doesn't see the update yet.
I'll upgrade as soon as it is visible.
[edit] it just appeared and I pulled it, running on 14 now.
I'll keep you posted on the results.

@0x5e
Copy link
Owner

0x5e commented Oct 26, 2022

beta.13 didn't solves the problem, the second token refresh failed I found.

@1aranzant
Copy link

Looks stable :) Will update my reply if it ceases to work at one point. Thanks a lot!

@1aranzant
Copy link

Bad news :/ Still the same issue even with v1.6.0-beta.14
[@0x5e/homebridge-tuya-platform] Refresh access_token failed. code=1010, msg=token is expired

@ipa64
Copy link

ipa64 commented Oct 26, 2022

thank you, beta 14 just installed, I will give a feedback soon

@ipa64
Copy link

ipa64 commented Oct 27, 2022

Unfortunately not solved, hope this log can help.

[90mTuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/token/a6f533d75c23a9873c25c001e1da205e, params = undefined, body = null, headers = {"t":"1666833665733","client_id":"ft7hc7ye3hxe44cgpf4d","nonce":"e02ca8f3-6851-4f48-a25a-5a09ce1b807e","Signature-Headers":"client_id","sign":"XXXXXXXXXXXX","sign_method":"HMAC-SHA256","access_token":"16ff0999e798a9a41e4b3be7a857f50e","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.14"}�[39m �[37m[10/27/2022, 8:21:06 AM] �[39m�[36m[@0x5e/homebridge-tuya-platform]�[39m �[90mTuyaOpenAPI response: path = /v1.0/token/a6f533d75c23a9873c25c001e1da205e, data = {"code":1010,"msg":"token is expired","success":false,"t":1666833666578,"tid":"XXXXXXXXXXX"}�[39m �[37m[10/27/2022, 8:21:06 AM] �[39m�[36m[@0x5e/homebridge-tuya-platform]�[39m �[31mRefresh access_token failed. code=1010, msg=token is expired�[39m �[37m[10/27/2022, 8:21:06 AM] �[39m�[36m[@0x5e/homebridge-tuya-platform]�[39m �[90mTuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/devices/eb2c4c4425902f8253dqv0/commands, params = null, body = {"commands":[{"code":"switch_1","value":true}]}, headers = {"t":"1666833666697","client_id":"ft7hc7ye3hxe44cgpf4d","nonce":"7a84eda9-9987-4080-901b-b8d8170c649c","Signature-Headers":"client_id","sign":"XXXXXXXXXX","sign_method":"HMAC-SHA256","access_token":"16ff0999e798a9a41e4b3be7a857f50e","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.14"}�[39m �[37m[10/27/2022, 8:21:07 AM] �[39m�[36m[@0x5e/homebridge-tuya-platform]�[39m �[90mTuyaOpenAPI response: path = /v1.0/devices/eb2c4c4425902f8253dqv0/commands, data = {"code":1010,"msg":"token is expired","success":false,"t":1666833667550,"tid":"a20a6dd9559511ed912596dbc75dca5a"}

@0x5e
Copy link
Owner

0x5e commented Oct 27, 2022

I don't know why beta.14 works for me, I run the homebridge all night and see it success calles refresh token API 5 times.

@ipa64
Do you have the token refresh or login log before this failed call? I will submit a ticket in the Tuya platform, maybe the issue is cloud side. We are using different endpoint.

I need to show them this things:

  • Last success login / token refresh API call. (To confirm when access_token / refresh_token was get)
  • And the failed calls (within 7200 seconds).

Thanks for testing.

@PrimaveraNL
Copy link
Author

beta.14 works here. This morning, accessories are still available after 14 hrs. Still running in debug mode.
If I can provide anything that helps with analysis, please let me know.

@0x5e
Copy link
Owner

0x5e commented Oct 27, 2022

beta.14 works here. This morning, accessories are still available after 14 hrs. Still running in debug mode.

If I can provide anything that helps with analysis, please let me know.

If you are working, then no need :) Thanks!

Just need two API call logs as discribed before.
One success call and one failed call, with the same access_token & refresh_token.

@ipa64
Copy link

ipa64 commented Oct 27, 2022

Just need two API call logs as discribed before. One success call and one failed call, with the same access_token & refresh_token.

Hope that what you asked:

`
[10/27/2022, 11:27:24 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/iot-01/associated-users/actions/authorized-login, params = null, body = {"country_code":66,"username":"xxxxxxxx@gmail.com","password":"xxxxxxxxxx","schema":"smartlife"}, headers = {"t":"1666844844015","client_id":"ft7hc7ye3hxe44cgpxxx","nonce":"xxxxxxx","Signature-Headers":"client_id","sign":"xxxxxxxxxxxxx","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.14"}

[10/27/2022, 11:27:25 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/iot-01/associated-users/actions/authorized-login, data = {"result":{"access_token":"9a1bab720b426e6ef968a2742d0543ea","expire_time":7200,"platform_url":"https://openapi.tuyaus.com","refresh_token":"d714e4d55c918bca5e199f10232cc5cd","uid":"az1664451251132ekqP5"},"success":true,"t":1666844844965,"tid":"a84308b455af11ed912596dbc75dca5a"}

[36m[@0x5e/homebridge-tuya-platform]�[39m �[90mTuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/token/d714e4d55c918bca5e199f10232cc5cd, params = undefined, body = null, headers = {"t":"1666851986236","client_id":"ft7hc7ye3hxe44cgpxxx","nonce":"47d6ecd2-653b-425c-8e04-6cba77421398","Signature-Headers":"client_id","sign":"XXXXXXXXXXXXXX","sign_method":"HMAC-SHA256","access_token":"9a1bab720b426e6ef968a2742d0543ea","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.14"}�[39m
�[37m[10/27/2022, 1:26:27 PM] �[39m�[36m[@0x5e/homebridge-tuya-platform]�[39m �[90mTuyaOpenAPI response: path = /v1.0/token/d714e4d55c918bca5e199f10232cc5cd, data = {"code":1010,"msg":"token is expired","success":false,"t":1666851987045,"tid":"494eec1055c011ed918366cd25043e07"}`

@0x5e
Copy link
Owner

0x5e commented Oct 27, 2022

@ipa64 Yes that's what I need, I created tickets, waiting for Tuya reply.

@ipa64
Copy link

ipa64 commented Oct 27, 2022

@ipa64 Yes that's what I need, I created tickets, waiting for Tuya reply.

Thank you

@ipa64
Copy link

ipa64 commented Oct 29, 2022

Hi @0x5e, I spent time to try to understand event sequences:

  • 9:03:08 login (get access token and refresh token)
  • 11:00:16 try to toggle a switch but token is already expired
  • 11:00:22 try to toggle a switch but token is already expired
  • 11:02:09 request Refresh access_token
  • 11:02:10 Refresh access_token failed
    ....

I have some questions related to

  • Why the request to refresh the token is made so late, I mean there is already token expired when I try to toggle switch_1.
  • from the code return (this.tokenInfo.expire - 60 * 1000 <= new Date().getTime()); shouldn't the query have been performed after 6000s? it was made at about 7140s

here the log:
`//--------------------------------------
// 9:03:07 AM request: authorized-login
//--------------------------------------
[10/29/2022, 9:03:07 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/iot-01/associated-users/actions/authorized-login, params = null, body = {"country_code":66,"username":"udon.patrick@gmail.com","password":"XXXXXXXX","schema":"smartlife"}, headers = {"t":"1667008987184","client_id":"XXXXXXX","nonce":"XXXXXX","Signature-Headers":"client_id","sign":"XXXXXXXX","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/29/2022, 9:03:07 AM] Homebridge v1.5.1 (HAP v0.10.4) (@0x5e/homebridge-tuya-platform) is running on port 51157.
//--------------------------------------
// 9:03:08 AM response: success":true expire_time":7200
//--------------------------------------
[10/29/2022, 9:03:08 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/iot-01/associated-users/actions/authorized-login, data = {"result":{"access_token":"aa90b186e1b05a3c1300867ff1a34f4a","expire_time":7200,"platform_url":"https://openapi.tuyaus.com","refresh_token":"1d9b4988574b5b15c486e9e9ce2bb970","uid":"xxxxxxx"},"success":true,"t":1667008988166,"tid":"xxxxxxxx"}

...
...
...
...

//--------------------------------------
// 11:00:16 AM request: switch_1 true
//--------------------------------------
[10/29/2022, 11:00:16 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/devices/eb2c4c4425902f8253dqv0/commands, params = null, body = {"commands":[{"code":"switch_1","value":true}]}, headers = {"t":"1667016016027","client_id":"xxxxxx","nonce":"xxxxxx","Signature-Headers":"client_id","sign":"XXXXXXXX","sign_method":"HMAC-SHA256","access_token":"aa90b186e1b05a3c1300867ff1a34f4a","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
//--------------------------------------
// 11:00:16 AM response: token is expired
//--------------------------------------
[10/29/2022, 11:00:16 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/devices/eb2c4c4425902f8253dqv0/commands, data = {"code":1010,"msg":"token is expired","success":false,"t":1667016016861,"tid":"XXXXXXXXXX"}

//--------------------------------------
// 11:00:22 AM request: switch_1 flase
//--------------------------------------
[10/29/2022, 11:00:22 AM] [@0x5e/homebridge-tuya-platform] 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":"1667016022359","client_id":"XXXXXXXXXX","nonce":"XXXXXX","Signature-Headers":"client_id","sign":"XXXXXX","sign_method":"HMAC-SHA256","access_token":"aa90b186e1b05a3c1300867ff1a34f4a","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
//--------------------------------------
// 11:00:23 AM response: token is expired
//--------------------------------------
[10/29/2022, 11:00:23 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/devices/eb2c4c4425902f8253dqv0/commands, data = {"code":1010,"msg":"token is expired","success":false,"t":1667016023204,"tid":"XXXXXXXXXXXX"}

//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// 11:02:09 AM Refresh access_token (async _refreshAccessTokenIfNeed(path: string))
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
[10/29/2022, 11:02:09 AM] [@0x5e/homebridge-tuya-platform] Refresh access_token

//--------------------------------------
// 11:02:09 AM request: Refresh token
//--------------------------------------
[10/29/2022, 11:02:09 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/token/1d9b4988574b5b15c486e9e9ce2bb970, params = undefined, body = null, headers = {"t":"1667016129570","client_id":"XXXXXXXX","nonce":"XXXXXX","Signature-Headers":"client_id","sign":"XXXXXXX","sign_method":"HMAC-SHA256","access_token":"aa90b186e1b05a3c1300867ff1a34f4a","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}

//--------------------------------------
// 11:02:10 AM response: token is expired
//--------------------------------------
[10/29/2022, 11:02:10 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/token/1d9b4988574b5b15c486e9e9ce2bb970, data = {"code":1010,"msg":"token is expired","success":false,"t":1667016130535,"tid":"XXXXXXXXX"}

//--------------------------------------
// 11:02:10 AM Refresh access_token failed
//--------------------------------------
[10/29/2022, 11:02:10 AM] [@0x5e/homebridge-tuya-platform] Refresh access_token failed. code=1010, msg=token is expired

//--------------------------------------
// 11:02:10 AM request: ???
//--------------------------------------
[10/29/2022, 11:02:10 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/iot-03/open-hub/access-config, params = null, body = {"uid":"az1664451251132ekqP5","link_id":"XXXXXXX","link_type":"mqtt","topics":"device","msg_encrypted_version":"1.0"}, headers = {"t":"1667016130654","client_id":"XXXXXX","nonce":"XXXXXXX","Signature-Headers":"client_id","sign":"XXXXXXXXXXX","sign_method":"HMAC-SHA256","access_token":"aa90b186e1b05a3c1300867ff1a34f4a","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}

//--------------------------------------
// 11:02:11 AM response: token is expired
//--------------------------------------
[10/29/2022, 11:02:11 AM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/iot-03/open-hub/access-config, data = {"code":1010,"msg":"token is expired","success":false,"t":1667016131742,"tid":"XXXXXXXXX"}
`

@0x5e
Copy link
Owner

0x5e commented Oct 29, 2022

the token should expires after 7200 seconds, and I already advance 60 seconds to refresh the token.
Tuya didn't respond the ticket, let's wait response in next workday.

@ipa64
Copy link

ipa64 commented Oct 30, 2022

This morning I got an error: API subscription expired ….
On iot.tuya I have discovered, that I was on a trial period of 1 month for some services:
IoT Core : about to expire ( I requested for an extension)
Cloud develop base ressource : suspended
So had a look on Subscribe for a ressource pack, the first price is 25’000$/year :-O (⊙⊙)
Seems to be the end of the game
:-(

@0x5e
Copy link
Owner

0x5e commented Oct 30, 2022

This morning I got an error: API subscription expired ….

On iot.tuya I have discovered, that I was on a trial period of 1 month for some services:

IoT Core : about to expire ( I requested for an extension)

Cloud develop base ressource : suspended

So had a look on Subscribe for a ressource pack, the first price is 25’000$/year :-O (⊙⊙)

Seems to be the end of the game

:-(

In my memory there's free plan and no need to pay, 25000 is not for personal users. We are all free users

@ipa64
Copy link

ipa64 commented Oct 30, 2022

Free trial only works one time, one month
I didn’t see any other solution, but maybe I am missing something, I hope …

@0x5e
Copy link
Owner

0x5e commented Oct 30, 2022

Sorry to hear that, maybe tuya changes plan for newly created projects. I can't help with this and not familiar with Tuya Platform too. How about other people?
If that is true, then there would be no meaning to maintain this plugin.

I can still use API maybe because my account created long before, not sure.

@PrimaveraNL
Copy link
Author

PrimaveraNL commented Oct 30, 2022

I remember quite vividly that it was mentioned that all was free for smart home users, but now I see that the 'IoT Core' is on a free trial.
There is an option to prolong the trial with 6 months, but you have to indicate what kind of project you are doing.
My trial ends November 9th so I don't know what is going to happen after that.

[edit]
currentyly mentioned on Tuya platform:
"The service API calls will consume basic resources. Please make sure that there is a basic resource pack available under your account. You can subscribe to the IoT core service to get a free basic resource pack."

On Reddit, I read users that can still access their devices after the trial period. So I guess I'll see what happens two weeks from now...

@0x5e
Copy link
Owner

0x5e commented Oct 30, 2022

My ex colleague told me last month, at present API still can be used for free. After expiration you can apply for extend the expire date for free. apply every 6 month is acceptable for me, but if once a month will be too frequently.

My account is the same as you said on reddit, I expired at 2022.8 but still avaliable now....

@ipa64
Copy link

ipa64 commented Oct 30, 2022

After few days my extension request was approuved, for 6 months

before and after
CC42DC13-5DA6-421F-9217-F7B12B370355

1E29517F-6E78-40B4-8747-093605B8E0BA

@0x5e
Copy link
Owner

0x5e commented Oct 31, 2022

Hi @ipa64 , can you provide the latest token expired log? The server-side log was expired and cleared, they need the latest log, thanks.

  1. the login success request & response, with full access_token, refresh_token, and client_id (you can hide the middle part).
  2. the failed token refresh request & response, with full logs (you can hide the client_id middle part)

@1aranzant If you have time, can you do the same? Please to this before open the homebridge log.

@ipa64
Copy link

ipa64 commented Oct 31, 2022

2. client_id

Hi @ipa64 , can you provide the latest token expired log? The server-side log was expired and cleared, they need the latest log, thanks.

  1. the login success request & response, with full access_token, refresh_token, and client_id (you can hide the middle part).
  2. the failed token refresh request & response, with full logs (you can hide the client_id middle part)

`[10/31/2022, 3:10:53 PM] [Homebridge UI] Homebridge restart request received
[10/31/2022, 3:10:54 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[10/31/2022, 3:10:54 PM] [Homebridge UI] Sending SIGTERM to Homebridge
[10/31/2022, 3:10:54 PM] Got SIGTERM, shutting down Homebridge...
[10/31/2022, 3:10:54 PM] Got SIGTERM, shutting down child bridge process...
[10/31/2022, 3:10:59 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[10/31/2022, 3:11:04 PM] [HB Supervisor] Restarting Homebridge...
[10/31/2022, 3:11:04 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /volume1/homebridge/node_modules -D --strict-plugin-resolution
[10/31/2022, 3:11:04 PM] [HB Supervisor] Started Homebridge v1.5.1 with PID: 7249
[10/31/2022, 3:11:06 PM] Loaded config.json with 0 accessories and 2 platforms.
[10/31/2022, 3:11:06 PM] Loaded 0 cached accessories from cachedAccessories.
[10/31/2022, 3:11:06 PM] ---
[10/31/2022, 3:11:07 PM] Loaded plugin: @0x5e/homebridge-tuya-platform@1.6.0-beta.16
[10/31/2022, 3:11:07 PM] Registering platform '@0x5e/homebridge-tuya-platform.TuyaPlatform'
[10/31/2022, 3:11:07 PM] ---
[10/31/2022, 3:11:07 PM] Loading 2 platforms...
[10/31/2022, 3:11:07 PM] [TuyaPlatform] Initializing TuyaPlatform platform...
[10/31/2022, 3:11:07 PM] [TuyaPlatform] Initializing child bridge 0E:34:8E:CE:D8:CD
[10/31/2022, 3:11:07 PM] Publishing bridge accessory (name: Homebridge D7CB, publishInfo: {
username: '0E:01:CE:8C:D7:CB',
port: 51518,
pincode: '--**',
category: 2,
bind: undefined,
mdns: undefined,
addIdentifyingMaterial: true,
advertiser: 'avahi'
}).
Setup Payload:
X-HM://0023PLSKW8YV6
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 145-67-664 │     
└────────────┘     

[10/31/2022, 3:11:07 PM] Homebridge v1.5.1 (HAP v0.10.4) (Homebridge D7CB) is running on port 51518.
[10/31/2022, 3:11:08 PM] [@0x5e/homebridge-tuya-platform] Launched child bridge with PID 7274
[10/31/2022, 3:11:09 PM] Registering platform '@0x5e/homebridge-tuya-platform.TuyaPlatform'
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Loaded @0x5e/homebridge-tuya-platform v1.6.0-beta.16 child bridge successfully
[10/31/2022, 3:11:09 PM] Loaded 6 cached accessories from cachedAccessories.0E348ECED8CD.
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Finished initializing platform
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Loading accessory from cache: Zigbee Portail
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Loading accessory from cache: Zigbee Interrupteur
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Loading accessory from cache: Lumière
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Loading accessory from cache: ZigBee Fontaine
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Loading accessory from cache: ZemiSmart Zigbee Hub
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Loading accessory from cache: Smart Monitoring Plug
[10/31/2022, 3:11:09 PM] Publishing bridge accessory (name: @0x5e/homebridge-tuya-platform, publishInfo: {
username: '0E:34:8E:CE:D8:CD',
port: 51157,
pincode: '--**',
category: 2,
bind: undefined,
mdns: undefined,
addIdentifyingMaterial: true,
advertiser: 'avahi'
}).
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Executed didFinishLaunching callback
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] Log in to Tuya Cloud.
[10/31/2022, 3:11:09 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/iot-01/associated-users/actions/authorized-login, params = null, body = {"country_code":66,"username":"xxxxxx@gmail.com","password":"XXXXXXX","schema":"smartlife"}, headers = {"t":"1667203869370","client_id":"ft7hc7XXXXXX44cgpf4d","nonce":"e7d02c6f-013c-4c86-bd5f-4877c77156ac","Signature-Headers":"client_id","sign":"XXXXXXXXX","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/31/2022, 3:11:09 PM] Homebridge v1.5.1 (HAP v0.10.4) (@0x5e/homebridge-tuya-platform) is running on port 51157.
[10/31/2022, 3:11:10 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/iot-01/associated-users/actions/authorized-login, data = {"result":{"access_token":"015da4db40d801a43e5b844177b3f4de","expire_time":7200,"platform_url":"https://openapi.tuyaus.com","refresh_token":"da677ec0ad584aad37936ebdb6fcb147","uid":"az1664451251132ekqP5"},"success":true,"t":1667203870404,"tid":"94171c3d58f311ed912596dbc75dca5a"}
[10/31/2022, 3:11:10 PM] [@0x5e/homebridge-tuya-platform] Start MQTT connection.
[10/31/2022, 3:11:10 PM] [@0x5e/homebridge-tuya-platform] Fetching home list.
[10/31/2022, 3:11:10 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/iot-03/open-hub/access-config, params = null, body = {"uid":"az1664451251132ekqP5","link_id":"0e49670a-3566-4a65-890b-b882908a6b2f","link_type":"mqtt","topics":"device","msg_encrypted_version":"1.0"}, headers = {"t":"1667203870538","client_id":"ft7hc7XXXXXX44cgpf4d","nonce":"de98ccf3-b508-4857-8ef5-df920c61c667","Signature-Headers":"client_id","sign":"XXXXXXXXX","sign_method":"HMAC-SHA256","access_token":"015da4db40d801a43e5b844177b3f4de","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/31/2022, 3:11:10 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/users/az1664451251132ekqP5/homes, params = undefined, body = null, headers = {"t":"1667203870549","client_id":"ft7hc7XXXXXX44cgpf4d","nonce":"b01e61ba-8ca3-4a2a-bd59-142e6e5af979","Signature-Headers":"client_id","sign":"XXXXXXXX","sign_method":"HMAC-SHA256","access_token":"015da4db40d801a43e5b844177b3f4de","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/31/2022, 3:11:11 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/users/az1664451251132ekqP5/homes, data = {"result":[{"geo_name":"Mueang Udon Thani 41000","home_id":83503597,"lat":17.357523834186928,"lon":102.65342651364435,"name":"Ma "Maison" ..","role":"OWNER"}],"success":true,"t":1667203871252,"tid":"949eb38558f311ed918366cd25043e07"}
[10/31/2022, 3:11:11 PM] [@0x5e/homebridge-tuya-platform] Got home_id=83503597, name=Ma "Maison" ..
[10/31/2022, 3:11:11 PM] [@0x5e/homebridge-tuya-platform] Fetching device list.
[10/31/2022, 3:11:11 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/homes/83503597/devices, params = undefined, body = null, headers = {"t":"1667203871373","client_id":"ft7hc7XXXXXX44cgpf4d","nonce":"84f13059-9aec-4dba-a09c-e477ba88226e","Signature-Headers":"client_id","sign":"XXXXXXXX","sign_method":"HMAC-SHA256","access_token":"015da4db40d801a43e5b844177b3f4de","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/31/2022, 3:11:11 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/iot-03/open-hub/access-config, data = {"result":{"client_id":"cloud_82dd39efe1f26db515788e3dd9567323","expire_time":7200,"password":"XXXXXXXX","sink_topic":{"device":"cloud/token/out/{device_id}"},"source_topic":{"device":"cloud/token/in/26e67e57e74a706d58ed7524949199a7"},"url":"ssl://m1.tuyaus.com:8883","username":"cloud_26e67e57e74a706d58ed7524949199a7"},"success":true,"t":1667203871650,"tid":"94db9c5658f311ed83872a5d04de810f"}
[10/31/2022, 3:11:11 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ connecting: ssl://m1.tuyaus.com:8883
[10/31/2022, 3:11:12 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/homes/83503597/devices, data = {"result":[{"active_time":1666594990,"biz_type":18,"category":"kg","create_time":1666594990,"icon":"smart/icon/1538135755lcl6jilv02e_0.png","id":"ebb0bbffeb6190270ahpdh","ip":"","lat":"17.3575","lon":"102.6534","model":"","name":"Zigbee Portail","online":true,"owner_id":"83503597","product_id":"LnAjU2Xj3hTvIHQ1","product_name":"","status":[{"code":"switch_1","value":false}],"sub":true,"time_zone":"+07:00","uid":"az1664451251132ekqP5","update_time":1666671536,"uuid":"ebb0bbffeb6190270ahpdh"},{"active_time":1665797648,"biz_type":18,"category":"wxkg","create_time":1665797648,"icon":"smart/icon/bay1617774091208h6cA/c54b3bed3d0663c996b6c9b8cd006a28.png","id":"ebdc0996ced9c2992cq4i1","ip":"","lat":"17.3575","lon":"102.6534","model":"SC04","name":"Zigbee Interrupteur","online":true,"owner_id":"83503597","product_id":"aaabrnhr","product_name":"四键无线情景开关(Zigbee)","status":[{"code":"switch_mode1","value":"click"},{"code":"switch_mode2","value":"click"},{"code":"switch_mode3","value":"click"},{"code":"switch_mode4","value":"click"},{"code":"battery_percentage","value":100}],"sub":true,"time_zone":"+07:00","uid":"az1664451251132ekqP5","update_time":1665797680,"uuid":"847127fffee7a24d"},{"active_time":1664518426,"biz_type":18,"category":"tdq","create_time":1664518426,"icon":"smart/icon/ay1562830083757AoBrF/4253d80e73e101006ca72eb65a1a71f0.png","id":"eb2c4c4425902f8253dqv0","ip":"223.206.241.129","lat":"17.3575","local_key":"b68d0f6403824d0a","lon":"102.6534","model":"EZB-WC1H16N-A(芯片上板) +EZB-WBC1H16N-C(模组款)","name":"Lumière","online":true,"owner_id":"83503597","product_id":"jqo111f6ahvas3tr","product_name":"mini通断器","status":[{"code":"switch_1","value":false},{"code":"countdown_1","value":0},{"code":"relay_status","value":"0"},{"code":"random_time","value":""},{"code":"cycle_time","value":""},{"code":"switch_inching","value":""}],"sub":false,"time_zone":"+07:00","uid":"az1664451251132ekqP5","update_time":1665797352,"uuid":"4e8e6336c63e619b"},{"active_time":1665796704,"biz_type":18,"category":"cz","create_time":1665796441,"icon":"smart/icon/ay15306906879543yc3O/859fa3031c34ed0d3602d62a36cc7905.png","id":"ebcf17defcef29bf1fgmuq","ip":"","lat":"17.3575","lon":"102.6534","model":"ZigBee插座-T1","name":"ZigBee Fontaine ","online":true,"owner_id":"83503597","product_id":"nzkqcvvs","product_name":"ZigBee socket(T1)","status":[{"code":"switch_1","value":false},{"code":"countdown_1","value":0},{"code":"relay_status","value":"last"},{"code":"light_mode","value":"relay"},{"code":"child_lock","value":false}],"sub":true,"time_zone":"+07:00","uid":"az1664451251132ekqP5","update_time":1665797115,"uuid":"a4c1384ad1414485"},{"active_time":1665796249,"biz_type":18,"category":"wg2","create_time":1665796249,"icon":"smart/icon/ay1487598680188r2sFY/ca68233d1435dd2b9639d64919bfc917.jpg","id":"eb08a8a7f4115d4500dn1t","ip":"223.206.237.160","lat":"17.3575","local_key":"8567667bd0fb426b","lon":"102.6534","model":"ZMHK-01","name":"ZemiSmart Zigbee Hub","online":true,"owner_id":"83503597","product_id":"gzvra5f9z8qdfb1f","product_name":"ZemiSmart Zigbee Hub","status":[],"sub":false,"time_zone":"+07:00","uid":"az1664451251132ekqP5","update_time":1665796365,"uuid":"b61b20be0d39af10"},{"active_time":1664451566,"biz_type":18,"category":"cz","create_time":1664451566,"icon":"smart/program_category_icon/cz.png","id":"eb480d1169ad377266wv40","ip":"223.206.241.129","lat":"17.3575","local_key":"8e1d19d9a3815c23","lon":"102.6534","model":"LD-BSD58-M","name":"Smart Monitoring Plug","online":true,"owner_id":"83503597","product_id":"jes2qmucfl6hq8fi","product_name":"Smart Monitoring Plug","status":[{"code":"switch_1","value":true},{"code":"countdown_1","value":0},{"code":"add_ele","value":70},{"code":"cur_current","value":0},{"code":"cur_power","value":0},{"code":"cur_voltage","value":2236},{"code":"relay_status","value":"last"},{"code":"light_mode","value":"relay"},{"code":"child_lock","value":false},{"code":"cycle_time","value":""},{"code":"random_time","value":""}],"sub":false,"time_zone":"+07:00","uid":"az1664451251132ekqP5","update_time":1665567238,"uuid":"33ea6f34323e5583"}],"success":true,"t":1667203872407,"tid":"9538334258f311ed918366cd25043e07"}
[10/31/2022, 3:11:12 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/devices/functions, params = {"device_ids":"ebb0bbffeb6190270ahpdh,ebdc0996ced9c2992cq4i1,eb2c4c4425902f8253dqv0,ebcf17defcef29bf1fgmuq,eb08a8a7f4115d4500dn1t,eb480d1169ad377266wv40"}, body = null, headers = {"t":"1667203872532","client_id":"ft7hc7XXXXXX44cgpf4d","nonce":"68f2218b-d2ca-4866-b3d5-2dd23474434a","Signature-Headers":"client_id","sign":"XXXXXXXX","sign_method":"HMAC-SHA256","access_token":"015da4db40d801a43e5b844177b3f4de","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/31/2022, 3:11:12 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ connected
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/devices/functions, data = {"result":[{"category":"tdq","devices":["eb2c4c4425902f8253dqv0"],"functions":[{"code":"switch_1","desc":"switch 1","name":"switch 1","type":"Boolean","values":"{}"},{"code":"countdown_1","desc":"countdown 1","name":"countdown 1","type":"Integer","values":"{"unit":"s","min":0,"max":86400,"scale":0,"step":1}"},{"code":"relay_status","desc":"relay status","name":"relay status","type":"Enum","values":"{"range":["0","1","2"]}"},{"code":"random_time","desc":"random time","name":"random time","type":"String","values":"{"maxlen":255}"},{"code":"cycle_time","desc":"cycle time","name":"cycle time","type":"String","values":"{"maxlen":255}"},{"code":"switch_inching","desc":"switch inching","name":"switch inching","type":"String","values":"{"maxlen":255}"}],"product_id":"jqo111f6ahvas3tr"},{"category":"cz","devices":["ebcf17defcef29bf1fgmuq"],"functions":[{"code":"switch_1","desc":"switch 1","name":"switch 1","type":"Boolean","values":"{}"},{"code":"countdown_1","desc":"countdown 1","name":"countdown 1","type":"Integer","values":"{"unit":"s","min":0,"max":43200,"scale":0,"step":1}"},{"code":"relay_status","desc":"relay status","name":"relay status","type":"Enum","values":"{"range":["power_off","power_on","last"]}"},{"code":"light_mode","desc":"light mode","name":"light mode","type":"Enum","values":"{"range":["none","relay","pos"]}"},{"code":"child_lock","desc":"child lock","name":"child lock","type":"Boolean","values":"{}"}],"product_id":"nzkqcvvs"},{"category":"cz","devices":["eb480d1169ad377266wv40"],"functions":[{"code":"switch_1","desc":"switch 1","name":"switch 1","type":"Boolean","values":"{}"},{"code":"countdown_1","desc":"countdown 1","name":"countdown 1","type":"Integer","values":"{"unit":"s","min":0,"max":86400,"scale":0,"step":1}"},{"code":"relay_status","desc":"relay status","name":"relay status","type":"Enum","values":"{"range":["power_off","power_on","last"]}"},{"code":"light_mode","desc":"light mode","name":"light mode","type":"Enum","values":"{"range":["relay","pos","none"]}"},{"code":"child_lock","desc":"child lock","name":"child lock","type":"Boolean","values":"{}"},{"code":"cycle_time","desc":"cycle time","name":"cycle time","type":"String","values":"{}"},{"code":"random_time","desc":"random time","name":"random time","type":"String","values":"{}"}],"product_id":"jes2qmucfl6hq8fi"},{"category":"kg","devices":["ebb0bbffeb6190270ahpdh"],"functions":[{"code":"switch_1","desc":"switch 1","name":"switch 1","type":"Boolean","values":"{}"}],"product_id":"LnAjU2Xj3hTvIHQ1"}],"success":true,"t":1667203873260,"tid":"95c6380658f311ed918366cd25043e07"}
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Got 6 device(s).
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Restoring existing accessory from cache: Zigbee Portail
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Restoring existing accessory from cache: Zigbee Interrupteur
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Create accessory using legacy mode: Zigbee Interrupteur.
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Unsupported device: Zigbee Interrupteur.
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Restoring existing accessory from cache: Lumière
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Restoring existing accessory from cache: ZigBee Fontaine
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Restoring existing accessory from cache: ZemiSmart Zigbee Hub
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Create accessory using legacy mode: ZemiSmart Zigbee Hub.
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Unsupported device: ZemiSmart Zigbee Hub.
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Restoring existing accessory from cache: Smart Monitoring Plug
[10/31/2022, 3:11:13 PM] [@0x5e/homebridge-tuya-platform] Update value true => false for devId=eb2c4c4425902f8253dqv0 service=00000049-0000-1000-8000-0026BB765291, subtype=switch_1, characteristic=00000025-0000-1000-8000-0026BB765291
[10/31/2022, 3:21:15 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"cc87b212-0660-44bf-a3f8-9f270d728b53","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667204470","18":2536,"value":2536},{"code":"cur_power","t":"1667204470","19":3694,"value":3694},{"code":"cur_voltage","t":"1667204470","value":2244,"20":2244}]}
[10/31/2022, 3:21:15 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2536,"code":"cur_current","t":"1667204470","value":2536},{"19":3694,"code":"cur_power","t":"1667204470","value":3694},{"20":2244,"code":"cur_voltage","t":"1667204470","value":2244}]
[10/31/2022, 3:29:29 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"2c1421dc-965b-46e1-811c-cad93b4fa045","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"add_ele","t":"1667204968","17":90,"value":90}]}
[10/31/2022, 3:29:29 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"17":90,"code":"add_ele","t":"1667204968","value":90}]
[10/31/2022, 3:30:16 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"b1536f8d-5294-480c-906d-dea7748b6b13","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667205016","18":2388,"value":2388},{"code":"cur_power","t":"1667205016","19":2801,"value":2801},{"code":"cur_voltage","t":"1667205016","value":2326,"20":2326}]}
[10/31/2022, 3:30:16 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2388,"code":"cur_current","t":"1667205016","value":2388},{"19":2801,"code":"cur_power","t":"1667205016","value":2801},{"20":2326,"code":"cur_voltage","t":"1667205016","value":2326}]
[10/31/2022, 3:32:03 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"1e4ddb6a-65f6-4df8-886d-43729447577d","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667205122","18":0,"value":0},{"code":"cur_power","t":"1667205122","19":0,"value":0},{"code":"cur_voltage","t":"1667205122","value":2298,"20":2298}]}
[10/31/2022, 3:32:03 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":0,"code":"cur_current","t":"1667205122","value":0},{"19":0,"code":"cur_power","t":"1667205122","value":0},{"20":2298,"code":"cur_voltage","t":"1667205122","value":2298}]
[10/31/2022, 3:41:57 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"422fb5c0-73d2-45b7-aef5-8ff5d61d9f98","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667205716","18":2504,"value":2504},{"code":"cur_power","t":"1667205716","19":3597,"value":3597},{"code":"cur_voltage","t":"1667205716","value":2248,"20":2248}]}
[10/31/2022, 3:41:57 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2504,"code":"cur_current","t":"1667205716","value":2504},{"19":3597,"code":"cur_power","t":"1667205716","value":3597},{"20":2248,"code":"cur_voltage","t":"1667205716","value":2248}]
[10/31/2022, 3:52:55 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"5e1c335c-2c11-431d-af6a-99833721cd92","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667206373","18":0,"value":0},{"code":"cur_power","t":"1667206373","19":0,"value":0},{"code":"cur_voltage","t":"1667206373","value":2229,"20":2229}]}
[10/31/2022, 3:52:55 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":0,"code":"cur_current","t":"1667206373","value":0},{"19":0,"code":"cur_power","t":"1667206373","value":0},{"20":2229,"code":"cur_voltage","t":"1667206373","value":2229}]
[10/31/2022, 3:58:49 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"2356d760-d6d1-4a05-b11b-6353775329c1","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_voltage","t":"1667206728","value":2236,"20":2236}]}
[10/31/2022, 3:58:49 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"20":2236,"code":"cur_voltage","t":"1667206728","value":2236}]
[10/31/2022, 3:59:30 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"0feb39f8-f09d-4d89-b359-cda615f99e26","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"add_ele","t":"1667206769","17":66,"value":66}]}
[10/31/2022, 3:59:30 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"17":66,"code":"add_ele","t":"1667206769","value":66}]
[10/31/2022, 4:01:22 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 20, message = {"bizCode":"offline","bizData":{"time":1667206878},"devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","ts":0}
[10/31/2022, 4:01:22 PM] [@0x5e/homebridge-tuya-platform] Unhandled mqtt message: bizCode=offline, bizData={"time":1667206878}
[10/31/2022, 4:01:30 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 20, message = {"bizCode":"online","bizData":{"time":1667206890},"devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","ts":0}
[10/31/2022, 4:01:30 PM] [@0x5e/homebridge-tuya-platform] Unhandled mqtt message: bizCode=online, bizData={"time":1667206890}
[10/31/2022, 4:01:48 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"d82ee2a8-32c4-49ab-9941-ff42b141b06e","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_voltage","t":"1667206905","value":2244,"20":2244}]}
[10/31/2022, 4:01:48 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"20":2244,"code":"cur_voltage","t":"1667206905","value":2244}]
[10/31/2022, 4:05:20 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"21da2854-45e4-46c9-b9ed-ec9ff38eeb35","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667207119","18":2504,"value":2504},{"code":"cur_power","t":"1667207119","19":3652,"value":3652},{"code":"cur_voltage","t":"1667207119","value":2200,"20":2200}]}
[10/31/2022, 4:05:20 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2504,"code":"cur_current","t":"1667207119","value":2504},{"19":3652,"code":"cur_power","t":"1667207119","value":3652},{"20":2200,"code":"cur_voltage","t":"1667207119","value":2200}]
[10/31/2022, 4:14:56 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"86fb2b0a-987d-424d-8274-4dc05e355f71","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667207695","18":2196,"value":2196},{"code":"cur_power","t":"1667207695","19":2713,"value":2713},{"code":"cur_voltage","t":"1667207695","value":2164,"20":2164}]}
[10/31/2022, 4:14:56 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2196,"code":"cur_current","t":"1667207695","value":2196},{"19":2713,"code":"cur_power","t":"1667207695","value":2713},{"20":2164,"code":"cur_voltage","t":"1667207695","value":2164}]
[10/31/2022, 4:19:32 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"5924ce60-1274-47d5-9087-d3f41f1b1328","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667207970","18":2297,"value":2297},{"code":"cur_power","t":"1667207970","19":2696,"value":2696},{"code":"cur_voltage","t":"1667207970","value":2267,"20":2267}]}
[10/31/2022, 4:19:32 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2297,"code":"cur_current","t":"1667207970","value":2297},{"19":2696,"code":"cur_power","t":"1667207970","value":2696},{"20":2267,"code":"cur_voltage","t":"1667207970","value":2267}]
[10/31/2022, 4:20:38 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"81557504-3a3c-4069-a12b-1d9a8ea2a8f7","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667208037","18":0,"value":0},{"code":"cur_power","t":"1667208037","19":0,"value":0},{"code":"cur_voltage","t":"1667208037","value":2244,"20":2244}]}
[10/31/2022, 4:20:38 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":0,"code":"cur_current","t":"1667208037","value":0},{"19":0,"code":"cur_power","t":"1667208037","value":0},{"20":2244,"code":"cur_voltage","t":"1667208037","value":2244}]
[10/31/2022, 4:21:23 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"1335c567-6fea-418e-9a32-13caee02445a","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_voltage","t":"1667208081","value":2218,"20":2218}]}
[10/31/2022, 4:21:23 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"20":2218,"code":"cur_voltage","t":"1667208081","value":2218}]
[10/31/2022, 4:29:33 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"5a40399c-8a4c-42d6-9e0d-4b817cd94581","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"add_ele","t":"1667208572","17":73,"value":73}]}
[10/31/2022, 4:29:33 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"17":73,"code":"add_ele","t":"1667208572","value":73}]
[10/31/2022, 4:31:54 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"5c17caf1-3c5d-4292-b8f3-cddc95004972","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_voltage","t":"1667208713","value":2298,"20":2298}]}
[10/31/2022, 4:31:54 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"20":2298,"code":"cur_voltage","t":"1667208713","value":2298}]
[10/31/2022, 4:34:15 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"499b79e3-8756-4ed0-8ab1-1b8d6cb3d50e","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667208853","18":2541,"value":2541},{"code":"cur_power","t":"1667208853","19":3737,"value":3737},{"code":"cur_voltage","t":"1667208853","value":2207,"20":2207}]}
[10/31/2022, 4:34:15 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2541,"code":"cur_current","t":"1667208853","value":2541},{"19":3737,"code":"cur_power","t":"1667208853","value":3737},{"20":2207,"code":"cur_voltage","t":"1667208853","value":2207}]
[10/31/2022, 4:46:23 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"b3dc0c44-ceca-4f42-b373-9d22f234ec1c","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667209582","18":0,"value":0},{"code":"cur_power","t":"1667209582","19":0,"value":0},{"code":"cur_voltage","t":"1667209582","value":2196,"20":2196}]}
[10/31/2022, 4:46:23 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":0,"code":"cur_current","t":"1667209582","value":0},{"19":0,"code":"cur_power","t":"1667209582","value":0},{"20":2196,"code":"cur_voltage","t":"1667209582","value":2196}]
[10/31/2022, 4:47:13 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"77e25f53-d23d-4aaa-b99d-688a20e7cea2","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_voltage","t":"1667209632","value":2290,"20":2290}]}
[10/31/2022, 4:47:13 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"20":2290,"code":"cur_voltage","t":"1667209632","value":2290}]
[10/31/2022, 4:59:35 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"3b87e957-fad8-44ba-ba02-54a31823e55f","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"add_ele","t":"1667210374","17":60,"value":60}]}
[10/31/2022, 4:59:35 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"17":60,"code":"add_ele","t":"1667210374","value":60}]
[10/31/2022, 5:00:19 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenMQ onMessage: topic = cloud/token/in/26e67e57e74a706d58ed7524949199a7, protocol = 4, message = {"dataId":"2ec2aa20-563e-4eeb-8d8a-4711a0880f48","devId":"eb480d1169ad377266wv40","productKey":"jes2qmucfl6hq8fi","status":[{"code":"cur_current","t":"1667210414","18":2580,"value":2580},{"code":"cur_power","t":"1667210414","19":3717,"value":3717},{"code":"cur_voltage","t":"1667210414","value":2278,"20":2278}]}
[10/31/2022, 5:00:19 PM] [@0x5e/homebridge-tuya-platform] onDeviceStatusUpdate devId=eb480d1169ad377266wv40, status=[{"18":2580,"code":"cur_current","t":"1667210414","value":2580},{"19":3717,"code":"cur_power","t":"1667210414","value":3717},{"20":2278,"code":"cur_voltage","t":"1667210414","value":2278}]
[10/31/2022, 5:10:11 PM] [@0x5e/homebridge-tuya-platform] Refresh access_token
[10/31/2022, 5:10:11 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/token/da677ec0ad584aad37936ebdb6fcb147, params = undefined, body = null, headers = {"t":"1667211011857","client_id":"ft7hc7XXXXXX44cgpf4d","nonce":"c2f629ce-7da2-46dd-b036-cc72aba4eab0","Signature-Headers":"client_id","sign":"XXXXXXXX","sign_method":"HMAC-SHA256","access_token":"015da4db40d801a43e5b844177b3f4de","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/31/2022, 5:10:12 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/token/da677ec0ad584aad37936ebdb6fcb147, data = {"code":1010,"msg":"token is expired","success":false,"t":1667211012778,"tid":"35513223590411ed912596dbc75dca5a"}
[10/31/2022, 5:10:12 PM] [@0x5e/homebridge-tuya-platform] Refresh access_token failed. code=1010, msg=token is expired
[10/31/2022, 5:10:12 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaus.com, path = /v1.0/iot-03/open-hub/access-config, params = null, body = {"uid":"az1664451251132ekqP5","link_id":"0e49670a-3566-4a65-890b-b882908a6b2f","link_type":"mqtt","topics":"device","msg_encrypted_version":"1.0"}, headers = {"t":"1667211012902","client_id":"ft7hc7XXXXXX44cgpf4d","nonce":"45db49b6-c057-4c2d-adca-5c6040bf4f1b","Signature-Headers":"client_id","sign":"XXXXXXXX","sign_method":"HMAC-SHA256","access_token":"015da4db40d801a43e5b844177b3f4de","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.6.0-beta.16"}
[10/31/2022, 5:10:13 PM] [@0x5e/homebridge-tuya-platform] TuyaOpenAPI response: path = /v1.0/iot-03/open-hub/access-config, data = {"code":1010,"msg":"token is expired","success":false,"t":1667211013727,"tid":"35e42591590411ed83872a5d04de810f"}
`

@0x5e
Copy link
Owner

0x5e commented Oct 31, 2022

OK, I will contact them tomorrow.

@0x5e 0x5e changed the title Homekit unresponsive token expired (1010) Oct 31, 2022
@0x5e
Copy link
Owner

0x5e commented Nov 1, 2022

Server side log says you have another login API call between "3:11:09 PM" and "5:10:11 PM" from hass, so the homebridge token expired (actually is invalid, not time expired).

So, the tuya platform account can't be used in homebridge/homeassistant at the same time. That's the root cause.
I will add some notice log when 1010 code appears.

@ipa64 @1aranzant

@ipa64
Copy link

ipa64 commented Nov 1, 2022

So…
Thank you @0x5e for your support

@0x5e 0x5e linked a pull request Nov 1, 2022 that will close this issue
@0x5e 0x5e closed this as completed in #36 Nov 1, 2022
@0x5e 0x5e added this to the 1.6.0 milestone Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants