Hi,
I want to send data from an arduino program BSB-LAN that sends MQTT.
I revieved them and made a program in rednode to send the data to Domoticz
I see some data in domoticz but I want to send it to a specific IDX in domoticz.
unfortunately I am not an Json programmer, so I do not know what to write in the rednode function node between MQTT inject node "Buitentemperatuur WP" (ambient temp heatpump) and the domoticz/in node.
I have attached the rednode flow I wrote.
This flow is sending data to Domoticz but in the log I see “error::MQTT: Invalid data recieved !”. So the flow send something to Domoticz but it is not ok, and with the function node it doesn’t send data to an IDX.
Please can someone help me to solve the problem.
Kind regard Peter from the Netherlands
[{"id":"12f69e2c.88aaf2","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Buitentemp WP","topic":"BSB-LAN/8700","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":140,"y":300,"wires":[["5ad007ff.d8c158","730e33f3.966894"]]},{"id":"5ad007ff.d8c158","type":"debug","z":"a7f56b1b.43d8d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":610,"y":420,"wires":},{"id":"4dac0088.02d14","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Buitentemperatuur","topic":"BSB-LAN/8700","qos":"","retain":"","broker":"5aedb555.d0a26c","x":490,"y":60,"wires":},{"id":"e4df2233.0892d","type":"inject","z":"a7f56b1b.43d8d8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"10","x":150,"y":160,"wires":[["4dac0088.02d14","a88d5ce7.623a5","6b69374a.82d4c8","31262c61.08b9b4","38957d7.27d5f82","637e4636.24d8c8"]]},{"id":"5d2ddfb5.24d4a","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Sanitairwater Temp","topic":"BSB-LAN/8830","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":150,"y":380,"wires":[["aa13a77a.9a1d88"]]},{"id":"a88d5ce7.623a5","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Kamertemperatuur","topic":"BSB-LAN/8740","qos":"","retain":"","broker":"5aedb555.d0a26c","x":490,"y":100,"wires":},{"id":"6b69374a.82d4c8","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Sanitairwater Temp","topic":"BSB-LAN/8830","qos":"","retain":"","broker":"5aedb555.d0a26c","x":490,"y":140,"wires":},{"id":"31262c61.08b9b4","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Retourwater Temp","topic":"BSB-LAN/8410","qos":"","retain":"","broker":"5aedb555.d0a26c","x":490,"y":180,"wires":},{"id":"637e4636.24d8c8","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Aanvoer Temp","topic":"BSB-LAN/8412","qos":"","retain":"","broker":"5aedb555.d0a26c","x":500,"y":220,"wires":},{"id":"38957d7.27d5f82","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Modulatie Pomp","topic":"BSB-LAN/8413","qos":"","retain":"","broker":"5aedb555.d0a26c","x":500,"y":260,"wires":},{"id":"51ce9400.961d3c","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Retourwater Temp","topic":"BSB-LAN/8410","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":150,"y":420,"wires":[["aa13a77a.9a1d88"]]},{"id":"1a6f4d2f.b0a0d3","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Aanvoer Temp","topic":"BSB-LAN/8412","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":130,"y":460,"wires":[["aa13a77a.9a1d88"]]},{"id":"c2283c88.59bfc","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Kamertemperatuur","topic":"BSB-LAN/8740","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":150,"y":340,"wires":[["aa13a77a.9a1d88"]]},{"id":"9b32cfa0.e24c7","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Modulatie Pomp","topic":"BSB-LAN/8413","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":140,"y":500,"wires":[["aa13a77a.9a1d88"]]},{"id":"2ca8e8d0.bfc868","type":"file","z":"a7f56b1b.43d8d8","name":"","filename":"/home/pi/logs/test.log","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":660,"y":640,"wires":[]},{"id":"7ff4ae87.7225","type":"csv","z":"a7f56b1b.43d8d8","name":"","sep":",","hdrin":"","hdrout":"","multi":"one","ret":"\n","temp":"","skip":"0","x":430,"y":640,"wires":[["2ca8e8d0.bfc868"]]},{"id":"4009f8bc.df4208","type":"function","z":"a7f56b1b.43d8d8","name":"Modify Payload","func":"var d = new Date();\nvar t = d.getTime();\npayload={"time":t,"payload":msg.payload,"topic":msg.topic};\nmsg.payload=payload;\nreturn msg;","outputs":1,"noerr":0,"x":180,"y":620,"wires":[["7ff4ae87.7225"]]},{"id":"aa13a77a.9a1d88","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"","topic":"domoticz/in","qos":"","retain":"true","broker":"5aedb555.d0a26c","x":710,"y":300,"wires":},{"id":"361932a3.6efdce","type":"function","z":"a7f56b1b.43d8d8","name":"sonoff wcd 3 IDX 51","func":"// 59 is a RGB strip, 28 is a normal ligth\n\nif (msg.topic=="light"){\n var newMsg={ command: "switchlight", idx: 51, switchcmd: msg.payload }\n}\nreturn {payload: newMsg}\n\n","outputs":1,"noerr":0,"x":500,"y":540,"wires":[]},{"id":"7d4565a.a6b2e9c","type":"file","z":"a7f56b1b.43d8d8","name":"","filename":"/home/pi/logs/test.log","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":520,"y":740,"wires":[]},{"id":"730e33f3.966894","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\nvar msg1 = {};\nrequests1 = {"command": "BSB-LAN/8700", "idx": 1928};\nmsg1.payload = requests1\nreturn [msg1];\n","outputs":1,"noerr":0,"x":330,"y":280,"wires":[["aa13a77a.9a1d88","5ad007ff.d8c158"]]},{"id":"5aedb555.d0a26c","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.200","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]