node-red-contrib-tuya-local icon indicating copy to clipboard operation
node-red-contrib-tuya-local copied to clipboard

Receiving "TypeError: Cannot use 'in' operator to search for '1' in undefined"

Open drcommons opened this issue 4 years ago • 7 comments

Hi, I know you are not using this much anymore but i keep getting this error from the last function. From what I can tell it is saying that 'dps' is undefined but i'm not sure why. Thanks DC

drcommons avatar Mar 26 '20 16:03 drcommons

Is it a frequent error? do you get any output at all?

Also you mention the 'last function', are you referring to a function node?

subzero79 avatar Mar 26 '20 21:03 subzero79

I see the error in the debug window everytime i turn the switch on or off.

Yes i'm referring to a funtion node.

image

drcommons avatar Mar 26 '20 23:03 drcommons

Is code in the function node doesn’t work for your current tuya output.

Is this your first node-red flow? If so try to put a debug node after the tuya node.

subzero79 avatar Mar 27 '20 00:03 subzero79

Hi, Yes it is my first node-red flow. When i have the debug node there, it shows a string and I have not been able to work out the data in the string. One of the things that does not make sense is that I thought there would be a topic shown under the object. image

Thanks for your help so far. Do you think i could have misconfigured something in one of the other switch nodes to cause this error?

drcommons avatar Mar 27 '20 00:03 drcommons

That looks wrong. This looks like you have not obtained the proper decryption key. Have you been through tuyaapi docs on that matter ?

subzero79 avatar Mar 27 '20 01:03 subzero79

Thanks again for your help. Your comment about the decryption key got me thinking so i tried protocol version 3.1 and it started working. I thought my switches were updated to 3.3 but they must be 3.1 because i can now see the payload correctly. Cheers

drcommons avatar Mar 27 '20 03:03 drcommons

Do you know if anyone has used the same concept to control light bulbs with RGB colours etc?

drcommons avatar Mar 27 '20 03:03 drcommons