Connecting to Tuya temperature and humidity sensor fails

Hi,
I am trying to connect to a Tuya Temperature and Humdity sensor using the "Tuya smart device hub" node with no success.
I have found the key and the id as explained in the instructions from the nodes installation notes.

The error I am getting from the node red log file is:

13 Jun 18:42:03 - [info] [tuya-smart-device-generic:14f5120375088e7d] [1686638523313] recieved data on input : {"_msgid":"6e69e4d84c7d4ac5","payload":{"deviceVirtualId":"aaaaaaaaaaaaaaaaaaaaaaaa","deviceKey":"kkkkkkkkkkkkkkkkk","deviceName":"Bed Zone","msg.payload":{"dps":1,"operation":"GET"}},"topic":"","moduleVersion":"5.0.1"}
13 Jun 18:42:03 - [info] [tuya-smart-device-generic:14f5120375088e7d] Connecting to tuya with params : {"id":"aaaaaaaaaaaaaaaaaaaaaaaa","key":"kkkkkkkkkkkkkkkkk","issueGetOnConnect":false,"nullPayloadOnJSONError":false,"version":"3.1"}
13 Jun 18:42:03 - [info] [tuya-smart-device-generic:14f5120375088e7d] [1686638523313] initiating the find command
13 Jun 18:42:13 - [error] [tuya-smart-device-generic:14f5120375088e7d] [1686638523313] An error had occured : find() timed out. Is the device powered on and the ID or IP correct?
13 Jun 18:42:13 - [info] [tuya-smart-device-generic:14f5120375088e7d] [1686638523313] Cannot find the device

This is the output from the debug node

6/13/2023, 6:42:14 PMnode: 14f5120375088e7d
msg : string[107]
"[1686638523313] An error had occured : find() timed out. Is the device powered on and the ID or IP correct?"
The ID is definitely correct and I am not inputting an IP address.

This is the json in the inject node to the "Tuya smart device hub" to trigger a connection
{
"deviceVirtualId": "aaaaaaaaaaaaaaaaaaaaaaaa",
"deviceKey": "kkkkkkkkkkkkkkkkk",
"deviceName": "Bed Zone",
"msg.payload": {
"dps": 1,
"operation": "GET"
}
}
I am unsure if the DPS number is correct but am unable to connect.

I have found the IP address, matching the MAC address from the ARP table in my router, and can ping the device from the node red server machine. However once a connection is attempted from node red I am no longer able to ping the device.
Also tried removing the device from the smart life app so that it has no other hub connections, with no success.

Any help would be appreciated

If you are using node-red-contrib-tuya-smart-device there is a message under the node telling you if you have connected or not. No input is required to connect, once the data is entered into the config page the node should connect when deployed.

To get data the output from the inject node should be,

{ dps: dps_key, operation: 'get' }

The most likely dps_key values for temperature and humidity are,

8 	Current Temperature 	integer 	400-2000 	
9 	Current Humidity 	    integer 	0-100 	%

The Device Name, Device Virtual ID & Device Key are only required in the node Config box. Note: only ONE connection can be made to a device at any one time.

I had the similar issues but with devices connected to the TUYA Bluetooth hub .. Even you have the key and ID of the devices you will not be able (or I was not able) to get a valid response from these devices.

All works fine if directly connected to the app but fails when using the hub.

Other issues I had when using the wrong types of parameters (STRING Value instead of INT or BOOLEAN) ,,, the tuya system is sensitive on that.

to test your environment make sure:

  • connect your device directly to Tuya app (not via TUYA HUB)
  • check your Tuya Device information and ensure its in the correct Time/Zone region
  • check you Device Mac adress and try to find your local IP (if IP device) .. and ensure you can ping the device from Node-Red server
  • do a full deploy when adding a new device-node
  • do not send any command to the node (after full deploy) untill you see a "Connect" state under the node

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