Open gredin opened 4 years ago
Hi, sorry for the late reply, I've converted all of my Tuya devices to Tasmota because it's easier to integrate them into my smart home that way - so I don't use this script anymore ant don't have any devices for testing.
That being said - I still can authenticate positively with this script.
Please check if You have correct local time on Your computer. Also check if the correct time is being sent to the server:
$ DEBUG=* ./cli.js auth [EMAIL] PASS
the result will be:
@tuyapi/cloud using new API +0ms
@tuyapi/cloud key HMAC: 93:21:9F:C2:73:E2:20:0F:4A:DE:E5:F7:19:1D:C6:56:BA:2A:2D:7B:2F:F5:D2:4C:D5:5C:4B:61:55:00:1E:40_vay9g59g9g99qf3rtqptmc3emhkanwkx_aq7xvqcyqcnegvew793pqjmhv77rneqc +3ms
@tuyapi/cloud strToSign: a=tuya.m.user.email.token.create||appVersion=3.8.5||clientId=3fjrekuxank9eaej3gcx||deviceId=3cx1u4g11yttu6eku97cref8w9y7bg719u2e32fslqdl||et=0.0.1||lang=en||os=Linux||postData=aa11c411f885ef9db1081eb36ff5adab||time=1598512408||ttid=tuya||v=1.0 +4ms
@tuyapi/cloud Sending parameters: +1ms
@tuyapi/cloud { a: 'tuya.m.user.email.token.create',
@tuyapi/cloud deviceId: '3cx1u4g11yttu6eku97cref8w9y7bg719u2e32fslqdl',
@tuyapi/cloud os: 'Linux',
@tuyapi/cloud lang: 'en',
@tuyapi/cloud v: '1.0',
@tuyapi/cloud clientId: '3fjrekuxank9eaej3gcx',
@tuyapi/cloud time: 1598512408,
@tuyapi/cloud postData: '{"countryCode":"48","email":"[EMAIL]"}',
@tuyapi/cloud et: '0.0.1',
@tuyapi/cloud ttid: 'tuya',
@tuyapi/cloud appVersion: '3.8.5',
@tuyapi/cloud sign:
@tuyapi/cloud 'e28406e4f8ce730c4732bbb8de3877e288c9f9033daddb40e6084592aac8d34b' } +0ms
⠴ Logging in @tuyapi/cloud Received response: +475ms
Check if time=[0-9]+
is correct.
Also, right now the countryCode
in postData
is hard-coded to be 48
(Poland). Maybe you need to change that to Your country code to properly detect the timezone You're in.
Hi,
I created an account in TuyaSmart app.
cli.js auth
fails (error returned by Tuya cloud API:{ code: 'TIME_VALIDATE_FAILED', message: 'time validate failed' }
).Are API key/secrets up to date? Is there another explanation for this issue?