I have just recently started having problems with MQTT and my node-red-contrib-tuya-smart-device
nodes.
The issue is, whenever I send an MQTT message to the Tuya node ALL the MQTT nodes on the relevant Node-Red instance disconnect, and only reconnect after I update & redeploy the MQTT broker in any MQTT node.
Mosquitto is running on a Raspberry Pi and I have MQTT nodes connected to the same broker on other instances of Node-Red (both 1.35 & 2.0). The MQTT disconnect ONLY occurs on the Node-Red instance with the Tuya node when connecting to the Tuya node
I have included below a small flow that I am using to show the problem.
[{"id":"dea00b1a.380558","type":"debug","z":"7fdabd9.f693544","name":"Tuya State","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":450,"y":600,"wires":[]},{"id":"3b94404c.0fca2","type":"debug","z":"7fdabd9.f693544","name":"Tuya Port 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":400,"wires":[]},{"id":"e85c8439.922c38","type":"mqtt out","z":"7fdabd9.f693544","name":"Tuya Study Light State","topic":"tuya/+/device_state/study/smart_bulb_04/state","qos":"1","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"ee05e0d9.9118e","x":760,"y":440,"wires":[]},{"id":"601fbd68.4e01d4","type":"tuya-smart-device","z":"7fdabd9.f693544","deviceName":"Study Light","disableAutoStart":false,"deviceId":"bfed04c9d469db879doe2y","deviceKey":"20120ede82e21064","deviceIp":"","retryTimeout":1000,"findTimeout":1000,"tuyaVersion":"3.1","eventMode":"event-both","x":470,"y":460,"wires":[["e85c8439.922c38","3b94404c.0fca2"],[]]},{"id":"c9a075ff.ce0788","type":"mqtt in","z":"7fdabd9.f693544","name":"Tuya Study Light Control","topic":"tuya/+/device_control/study/smart_bulb_04/command","qos":"2","datatype":"json","broker":"ee05e0d9.9118e","nl":false,"rap":true,"rh":0,"x":150,"y":460,"wires":[["601fbd68.4e01d4","a24d0969.15f918"]]},{"id":"a24d0969.15f918","type":"debug","z":"7fdabd9.f693544","name":"MQTT In","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":460,"y":400,"wires":[]},{"id":"bc510cda.15ba7","type":"mqtt out","z":"7fdabd9.f693544","name":"Tuya Study Light Command","topic":"tuya/NRCTD/device_control/study/smart_bulb_04/command","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"ee05e0d9.9118e","x":500,"y":540,"wires":[]},{"id":"f6432cc0.d3e0f","type":"inject","z":"7fdabd9.f693544","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"dps\":20,\"set\":true}","payloadType":"json","x":150,"y":540,"wires":[["bc510cda.15ba7","dea00b1a.380558"]]},{"id":"ee05e0d9.9118e","type":"mqtt-broker","name":"MQTT","broker":"192.168.1.21","port":"1883","clientid":"","usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
If anyone is willing to test this to either prove that it is a problem with my setup, or a problem somewhere else, I would be grateful and look forward to the results.
If anyone is already aware of a possible fix I would also like to know