Trouble in TUYA Land? The tuya-smart-device node can't find devices?

Trouble in TUYA Land? The tuya-smart-device node can't find devices? I had to change my wifi security cofniguration, namely the SSID and passphrase. So I had to update all my IoT plugs. This of course changed the tuya keys. So I when into my flow, updated the keys.

Via the tuya cli wizard all devices are registered, and device virtual ids correct. In the tuya app, I can control all devices on/off as expected. So as far as tuya (cloud) everything is fine. But the tuya-smart-device NR node is not happy.

Endnessly in the log...

7 Jul 14:02:34 - [info] [tuya-smart-device:Auto View] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:34 - [info] [tuya-smart-device:Black Lasko Fan Power Control] findDevice(): Initiating the find command
7 Jul 14:02:34 - [info] [tuya-smart-device:Bond Bridge] findDevice(): Initiating the find command
7 Jul 14:02:34 - [info] [tuya-smart-device:HP LaserJet 5] findDevice(): Initiating the find command
7 Jul 14:02:35 - [info] [tuya-smart-device:Reserve Router] findDevice(): Initiating the find command
7 Jul 14:02:35 - [info] [tuya-smart-device:HP DeskJet 5650A] findDevice(): Initiating the find command
7 Jul 14:02:35 - [info] [tuya-smart-device:Storage Server] findDevice(): Initiating the find command
7 Jul 14:02:35 - [info] [tuya-smart-device:Edge Router] findDevice(): Initiating the find command
7 Jul 14:02:35 - [info] [tuya-smart-device:Eccentric] findDevice(): Initiating the find command
7 Jul 14:02:35 - [info] [tuya-smart-device:Auto View] findDevice(): Initiating the find command
7 Jul 14:02:36 - [info] [tuya-smart-device:Black Lasko Fan Power Control] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:36 - [info] [tuya-smart-device:Bond Bridge] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:36 - [info] [tuya-smart-device:HP LaserJet 5] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:37 - [info] [tuya-smart-device:Reserve Router] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:37 - [info] [tuya-smart-device:HP DeskJet 5650A] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:37 - [info] [tuya-smart-device:Storage Server] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:37 - [info] [tuya-smart-device:Edge Router] findDevice(): Cannot find the device, re-trying...
7 Jul 14:02:37 - [info] [tuya-smart-device:Eccentric] findDevice(): Cannot find the device, re-trying...

Anyone seen this behavior before? I have tried bounding the NR service, I have tried explicit disconnect and reconnects, the NR node is responding to commands just not find the IoT plugs? The app finds them just fine. The cli finds them just fine.

Never managed to get my Tuya devices working with the app AND the nodes. How did you get it wotking before?

I don't recall doing anything special. The app was already setup, and I just created a flow and it worked. Well, it worked until just recently.

Appears the TUYA has changed the 'key' format. I noticed that the keys returned via the tuya-cli are NO LONGER just alpha-numeric.

For example...
{
name: 'Reserve Router',
id: '31006440bcddc253e92A',
key: '.5X/3baAQaMhtI>8'
},

This was reported as an issue on the tuya-cli issue list on GitHub...

Wierd Encoding?

So maybe the Tuya NR Nodes need a code change to handle the new key format?

Would it be the nodes or the underlying Tuya-api ?

Based on following the link you provided it looks like (for example) the homebridge plugin was trying to sanitize the key input - i guess this could be at the tuya-smart-device level but i think it would more likely be in the tuya-api code

Craig

I was thinking that so I did an explicit get via the tuya-cli, and they all worked with the 'new' keys. So if the tuya-cli works, and the app works in parallel, then the only component not working is the NR node.

For example...
# tuya-cli get --id '31006440bcddc25393cf' --key 'Vf-IsW:bww%A07+4'
{ '1': false, '2': 0 }

Clearly the tuya-cli connects, and gets the state of the wifi plug. The NR node can't even connect. (Of course the example above, the actual tested, id and key has been changed to protect access).

OK good one - i started working through that yesterday also and got to about the same point - it is somewhere in the tuya-smart-device node

I was going to try and look through it at some stage today as i assume (much the same as the Homethings fix) they will be sanitizing the key input with a regex or some such that will need updating or removing)

Not sure i will find the time today

Craig

No rush, rather have great code than fast code, if you get my meaning. More than happy to help test, validate, etc.

Yep i only have one Tuya device (a critical one my hydronic heatpump) so have no intention of breaking anything with that flow !

I immensly dislike the Tuya stuff and intend to bypass their wifi interface on this heatpump (once our winter is done in Australia) and run it through Modbus instead

But will try and get a look at it over the weekend

Craig

I am moving to Tasmota where I can as well, as the TUYA stuff dies from use/age, replacing it. But I still have 6 or 7 in use.

Any update on this?

No sorry - not even on my todo list yet - been away the last couple of weekends

it is on the list but as i only have a single tuya device (and not been hit with this problem yet) its very low prirotiy

Craig

Still gotten a chance to look at this?

No sorry - wife has had me doing Power Query for her business for the last two weeks !

Craig

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.