I use node-red-contrib-tuya-smart-device. Unfortunately I can't do anything with the format of the data. Can someone help me?
Best regards.
I use node-red-contrib-tuya-smart-device. Unfortunately I can't do anything with the format of the data. Can someone help me?
Best regards.
It looks like your data is corrupted as it should be an object not a string. What command did you send? Show output of function node.
I have no idea what needs to be in the function. I took the flow example and replaced set with get.
The tuya node only has contact if I enter ID and IP. If I only take one of the two, I have no contact.
If you have to have both ID & IP you have something wrong with your setup. As it says in the node config only one or other is required. I always use the ID.
I have no idea what device you are using so I do not know what dps are valid but for the moment get rid of the function node and enter {"dps": 20, "set": true}
in the inject node (type JSON {}). msg.topic
is ignored by the Tuya device so can be anything.
Note: "dps": 20
is usually a light bulb, for a switch try "dps": 1
both set values are true or false. To get device values use {"dps": 20, "operation": "GET"}
(or "dps": 1
)
you should get something like;
{"data":
{"dps": {"20":false,
"21":"white",
"22":1000,
"23":0,
"24":"000003e803e8",
"25":"000e0d0000000000000000c80000",
"26":0
}
},
"deviceId":"bfed04c9d469db879doe2y",
"deviceName":"Smart Bulb 04"}
To find the dps of your various device attributes try GitHub - jasonacox/tinytuya: Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API). which is a useful resource for dps values, ignore all the stuff at the beginning and go to the section Tuya Data Points - DPS Table
I tried to log in with just the ID. Unfortunately I can't get a connection. With ID and IP comes with {"dps": 1, "operation": "GET"} only data garbage.
What did you get when you got this far?
1. On the command line, run
tuya-cli link --api-key --api-secret --schema <your schema/Channel ID> --ssid --password --region us. For the region parameter, choose the two-letter country code from
us,
eu, and
cn that is geographically closest to you.
Does this apply?
2. Your devices should link in under a minute and the parameters required to control them will be printed out to the console. If you experience problems, first make sure any smart phone/tablet app that you use with your devices is completely closed and not attempting to communicate with any of the devices.
[Edit] Note that item 2 also means that there can only be ONE node connected to the device, anywhere
Try changing the Tuya protocol to 3.3.
I was struggling with the same thing, and this was the solution for me.
Hi
I have same issue.
I try too connect with Tuya WiFi Smart Temperature Hygrometer, App and webpage show device, but garbage on the object data.
Protocol 3.1 or 3.3. do not make any difference.
Can connect with or without Device Virtual ID. (Device Key and Device IP applied)
Can not connect without Device IP.
What else can be problem?
Use Device IP OR Device Virtual ID, not both. Please show msg
being sent to node plus output
Hi
This is the payload in:
{"dps":1,"operation":"GET"}
This is the returned value of the Tuya node:
{"data":"\u0005:�ʓt\u001b�A���<"o\r�q�\r��!��\u001bĝ�\u0005�c","deviceId":"","deviceName":"OlohuoneTempHum"}
Without DV ID, I get connected together with Device key and IP get connected.
And with DV ID together with Device key and IP get connected, but the result in both cases is garbage.
Just a thought, you can only connect with one connector, do you still have the device connected in the app. If so, un-connect it or close the app.
No idea if it makes a difference but apparently there is a Tuya Protocol 3.4 so you could try that because some of the returned value is OK. You can use TinyTuya to get the protocol Ver if required. Note that TinyTuya officially supports 3.4 protocol but no idea if the Tuya node does.
Personally I prefer to use the Device Virtual ID and Device Key because I use the ID as a device identifier. (Also get a value in the deviceID property in the returned data)
Hi
Nothing seems to help.
If I use only VID and DKey, I can not connect and get error:
"Error: Error from socket: connect EHOSTUNREACH xxxxxxxxxxxx:6668"
With the DKey and IP (that is not the IP in the error), I can connect, but garbage result.
Strange thing is that the IP in the error is not the IP of the device.
Other strange is that the MAC address, shown in the Smart Life app, is not found on my router.
I have several devices (Tuya compatible) that works and the IP/Mac match, but this problematic device everything is mismatch. I have re config this several times, with sam result.
You can use something like Advanced IP Scanner or nmap to check the IP of the device.
Have you double checked that you have linked the device with tuya-cli link --api-key --api-secret --schema <your schema/Channel ID> --ssid --password --region <region>
and that the virtual ID you are using is correct because the device should connect with the Dev ID & Dev Key.
Otherwise I am running out of ideas
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.