This basic project is to support multiple sensors to communicate via Node-Red to Domoticz.
Sensors
ESP8862 > MQTT > Node-Red > MQTT > Domoticz
The sample flow works fine till the moment that Node-Red has to update a variable in Domoticz.
type or paste code here
```[{"id":"738d2506.c6d1cc","type":"debug","z":"582c68b5.350268","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":490,"y":220,"wires":},{"id":"7b557eca.a619f","type":"mqtt in","z":"582c68b5.350268","name":"","topic":"temperature_topic","qos":"2","broker":"a693e4e6.945728","x":130,"y":180,"wires":[["97af2374.45b52","fa710cbd.f1788"]]},{"id":"97af2374.45b52","type":"debug","z":"582c68b5.350268","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":370,"y":120,"wires":},{"id":"473054c0.899f9c","type":"mqtt out","z":"582c68b5.350268","name":"","topic":"Domoticz/in","qos":"0","retain":"","broker":"a693e4e6.945728","x":490,"y":360,"wires":},{"id":"fa710cbd.f1788","type":"function","z":"582c68b5.350268","name":"temperatuur dht11","func":"msg.payload = {\n "idx":29,\n "nvalue":0,\n "svalue":"12.1"};\nreturn msg;\n","outputs":1,"noerr":0,"x":290,"y":280,"wires":[["473054c0.899f9c","738d2506.c6d1cc"]]},{"id":"a693e4e6.945728","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
The ESP is reading the DHT22 temperature sensor, brings it into the Node-Red flow and
there it stucks. The temperature_topic shows the right value in the msg.payload/debug screen.
The function node, with the following dscription, is not able to transfer the data into Domoticz.
msg.payload = {
"idx":29,
"nvalue":0,
"svalue":"12.1"};
return msg;
With the following statement in Putty I am able to preform that action with any problem.
mosquitto_pub -h localhost -m '{"idx" :29,"nvalue":0 ,"svalue":"99.0"}' -t 'domoticz/in'
Any idea what I do wrong?
Thanks in advance.
![mqtt%20error|690x260](upload://5SYyF644xYcGXkl4YEvZFsz4ZYI.png)