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

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

Open
drcommons opened this issue Mar 26, 2020 · 7 comments

Comments

@drcommons
Copy link

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

@subzero79
Copy link
Owner

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?

@drcommons
Copy link
Author

drcommons commented Mar 26, 2020

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

@subzero79
Copy link
Owner

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.

@drcommons
Copy link
Author

drcommons commented Mar 27, 2020

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?

@subzero79
Copy link
Owner

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

@drcommons
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants