cli icon indicating copy to clipboard operation
cli copied to clipboard

Wizard returns a strange key (encoded ?)

Open AlainKaim opened this issue 1 year ago • 8 comments

Hello From time to time, one of my device is disconnected, so I have to connect it again with the Tuya App. And then, I use tuya-cli wizard to get the new key and modify my homebridge config file. This is usually a smooth process, but today, after successfully reconnecting a blind to Tuya app( and it works through it), the wizard returned a strange key : { name: 'Volet salon petit', id: 'XXXXXXX', key: "1C<S<'HIBk*o_{eY" },

The name and id fields are ok. And the full informations are also ok for my other devices. It is just this key which is odd, and of course unusable in homebridge.

Any help will be appreciated :)

AlainKaim avatar Jun 13 '23 09:06 AlainKaim

I've just came here to report the same thing, device disconnected had to re-add it with tuya app and now this one device has this weird key which doesn't work..

  {
    name: 'Stairs',
    id: 'xxxxxx',
    key: 'nKwYCKpsudKQn^?F'
  },

ferni7 avatar Jun 18 '23 10:06 ferni7

Note that it at least is consistent with what the Tuya IoT REST API provides:

https://eu.iot.tuya.com/cloud/explorer?groupId=group-home&interfaceId=470224448454738 > "Device Management" > "Query Device Details in Bulk" returns:

{
  "result": [
    {
      [..]
      "local_key": "V+IuH~QWR`)v6A{r",
      [..]
    }
  ],
  "success": true,
  "t": 1687381074266,
  "tid": "4acd3a94107611eea68636790d793901"
}

And tuya-cli wizard returned

  {
    name: 'Wi-Fi hub',
    id: 'bf641c545b9e1920da14vi',
    key: 'V+IuH~QWR`)v6A{r'
  },

caco3 avatar Jun 21 '23 22:06 caco3

I have having the same issue after re-adding the device to Tuya App. Does anyone know how to get the correct key?

murtazabasrai avatar Jul 04 '23 16:07 murtazabasrai

Are you sure it is now encrypted? How did the yey look like before? I use exactly the key that gets returned and it works fine.

caco3 avatar Jul 04 '23 18:07 caco3

Hi, I tried and the returned key is correct. It's just that the key format has changed. Earlier it used to be in HEX. Now it's having symbols.

The issue of new key not working was in the homebridge Tuya plug-in that I was using which was validating the key as per the old format. I have found the fix to that so this new key format is not an issue. Thanks!

murtazabasrai avatar Jul 04 '23 19:07 murtazabasrai

@murtazabasrai was that the Tuya Plugin https://github.com/iRayanKhan/homebridge-tuya#readme ?

If so can you please share the fix?

On Wed, 5 Jul 2023 at 5:05 am, Murtaza Basrai @.***> wrote:

Hi, I tried and the returned key is correct. It's just that the key format has changed. Earlier it used to be in HEX. Now it's having symbols.

The issue of new key not working was in the homebridge Tuya plug-in that I was using which was validating the key as per the old format. I have found the fix to that so this new key format is not an issue. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/TuyaAPI/cli/issues/160#issuecomment-1620630623, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSZS5P3GSVWDRC3IIJ36DTXORSP5ANCNFSM6AAAAAAZETATFA . You are receiving this because you commented.Message ID: @.***>

ferni7 avatar Jul 04 '23 21:07 ferni7

Yep that's the one I'm using and here's the details of the fix that resolved the issue: https://github.com/iRayanKhan/homebridge-tuya/issues/409#issuecomment-1545078314

murtazabasrai avatar Jul 05 '23 04:07 murtazabasrai

This fix is working for me, thank you !!!I guess this will be modified in the next release of tuyalan….Have a great day !Le 5 juil. 2023 à 06:58, Murtaza Basrai @.***> a écrit : Yep that's the one I'm using and here's the details of the fix that resolved the issue: iRayanKhan/homebridge-tuya#409 (comment)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

AlainKaim avatar Jul 05 '23 12:07 AlainKaim