MQTT data send from BSB-LAN arduino program

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":""}]

Hi and welcome, your flow is corrupt due to not posting correctly.
please read this

ok, thank i'll try to upload the correct flow

[{"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":""}]Preformatted text

I tried to upload the red-node flow, but I don't know how to do it
sorry

Did you read this and follow the instruction

[{"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":""}]```

this is the code I wanted to update
please can someone help me to solve my problem?

thanx

Peter

Ok can i have an payload output from the mqtt in node, also how the json input to the domoticz mqtt should structured. then i can help.

[edit]
I have edited your flow and added wildcards, so you can subscribe to all topics in one node.
I can not finish function as i do not use Domotics so don't know the payload structure, and i do not know your input payload structure

[{"id":"f03eb685.0cfc","type":"mqtt in","z":"8d22ae29.7df6d","name":"recieve from all bsb topic","topic":"BSB-LAN/#","qos":"2","datatype":"auto","broker":"7b8cda69.1563ec","x":210,"y":2800,"wires":[["5fc2a4ee.a2f38c","61c9d902.fa901"]]},{"id":"5fc2a4ee.a2f38c","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":590,"y":2880,"wires":[]},{"id":"61c9d902.fa901","type":"function","z":"8d22ae29.7df6d","name":"","func":"\nvar msg1 = {};\nmsg1.payload = {\"command\": msg.payload, \"idx\": 1928};\nreturn msg1;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":2800,"wires":[["5fc2a4ee.a2f38c","afe6064e.c23f9"]]},{"id":"afe6064e.c23f9","type":"mqtt out","z":"8d22ae29.7df6d","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"7b8cda69.1563ec","x":670,"y":2800,"wires":[]},{"id":"7b8cda69.1563ec","type":"mqtt-broker","z":"","name":"testb","broker":"192.168.1.25","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Here is some info on wildcards

And here are Domoticz mqtt api docs, which command do you want to send?
https://www.domoticz.com/wiki/MQTT

thanx,

I will try your flow,
but first I will enjoy new year,
happy new year,

greetz peter

Hi, E1cid,
I tried your flow but it doen'st work either,
It stil gives me an Unknown command in Domticz.
I tried myselves some changes I found at the webpage I copied but does didn't work either,
so I ask for you help one more time.
can you look at the web page I copied,
perhaps you can solve the problem with these pages

thanks for your help
Greetz, Peter

https://www.domoticz.com/wiki/MQTT

Sorry E1cid,
I have seen just, that you copied the webseite already in you answer,

Peter

I said i need the debug from an in node and the format of the command you want to send..

The function can not be completed as i do not have all the info required.

hi E1cid,

I want to send devices/sensors data, in this case a temperature, so a value that the BSB topic contains,
that value (the temprature) needs to send to a IDX (an identifier in Domoticz)

I can't help any further because I am not an JSON programmer, and just tried examples I found on the web.

kind regards, Peter

You have the data, i do not. If you can not supply it how can anyone help.

So attach a debug to the in node and capture the payload, use the copy value button, which appeares to right of payload in debug when you hoover the cursor in that area.

As to how to send i have no idea which payload you wish to send, have a read of api and try to work out which you require.

Thanks,

I did it, I see that the output of the "recieve from all bsb topic"is an nummber, and the output of the function block is an object. That should a number also I think,
I will try some other things to come to the solution,

Thanks very much for yout effort E1cid

Hello,

Can you publish the contents of the Debug node, connected to the MQTT input node.
A screenshot would help a lot.

Currently your Function node contains:

var msg1 = {};
msg1.payload = {"command": msg.payload, "idx": 1928};
return msg1;

This should become something like:

msg.payload = {"command":"udevice","idx":1928,"svalue":msg.payload.temp};
return msg;

But, before I'm sure, what to insert after "svalue", I have to know, what the output of the MQTT input node is.

Regards

Hi FireWizard,

I will check it tomorrow,

Regards
Peter

Hi FireWizard52,

I inplemented your code and it works!!!!!!!

thank you very much

greetz, Peter

[{"id":"12f69e2c.88aaf2","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Buitentemp WP/8700","topic":"BSB-LAN/8700","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":120,"y":280,"wires":[["730e33f3.966894"]]},{"id":"5ad007ff.d8c158","type":"debug","z":"a7f56b1b.43d8d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":500,"wires":[]},{"id":"4dac0088.02d14","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Buitentemperatuur","topic":"BSB-LAN/8700","qos":"","retain":"","broker":"5aedb555.d0a26c","x":730,"y":20,"wires":[]},{"id":"e4df2233.0892d","type":"inject","z":"a7f56b1b.43d8d8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"10","x":430,"y":100,"wires":[[]]},{"id":"5d2ddfb5.24d4a","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Sanitairwater Temp/8830","topic":"BSB-LAN/8830","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":110,"y":400,"wires":[["469f7b38.71a744"]]},{"id":"a88d5ce7.623a5","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Kamertemperatuur","topic":"BSB-LAN/8740","qos":"","retain":"","broker":"5aedb555.d0a26c","x":730,"y":60,"wires":[]},{"id":"6b69374a.82d4c8","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Sanitairwater Temp","topic":"BSB-LAN/8830","qos":"","retain":"","broker":"5aedb555.d0a26c","x":730,"y":100,"wires":[]},{"id":"31262c61.08b9b4","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Retourwater Temp","topic":"BSB-LAN/8410","qos":"","retain":"","broker":"5aedb555.d0a26c","x":730,"y":140,"wires":[]},{"id":"637e4636.24d8c8","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Aanvoer Temp","topic":"BSB-LAN/8412","qos":"","retain":"","broker":"5aedb555.d0a26c","x":740,"y":180,"wires":[]},{"id":"38957d7.27d5f82","type":"mqtt out","z":"a7f56b1b.43d8d8","name":"Modulatie Pomp","topic":"BSB-LAN/8413","qos":"","retain":"","broker":"5aedb555.d0a26c","x":740,"y":220,"wires":[]},{"id":"51ce9400.961d3c","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Retourwater Temp/8410","topic":"BSB-LAN/8410","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":120,"y":460,"wires":[["bd7c401.f926cc"]]},{"id":"1a6f4d2f.b0a0d3","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Aanvoer Temp/8412","topic":"BSB-LAN/8412","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":130,"y":520,"wires":[["33e337cf.7bc378"]]},{"id":"c2283c88.59bfc","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Kamertemperatuur/8740","topic":"BSB-LAN/8740","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":110,"y":340,"wires":[["9d73ecdd.1884c"]]},{"id":"9b32cfa0.e24c7","type":"mqtt in","z":"a7f56b1b.43d8d8","name":"Modulatie Pomp/8413","topic":"BSB-LAN/8413","qos":"2","datatype":"auto","broker":"5aedb555.d0a26c","x":120,"y":580,"wires":[["16f28d7b.fffd53"]]},{"id":"2ca8e8d0.bfc868","type":"file","z":"a7f56b1b.43d8d8","name":"","filename":"/home/pi/logs/test.log","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":760,"y":640,"wires":[[]]},{"id":"7ff4ae87.7225","type":"csv","z":"a7f56b1b.43d8d8","name":"","sep":",","hdrin":"","hdrout":"","multi":"one","ret":"\\n","temp":"","skip":"0","x":330,"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":140,"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":730,"y":400,"wires":[]},{"id":"730e33f3.966894","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\nmsg.payload = {\"command\":\"udevice\",\"idx\":1928,\"svalue\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":280,"wires":[["aa13a77a.9a1d88","5ad007ff.d8c158"]]},{"id":"9d73ecdd.1884c","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\n\nmsg.payload = {\"command\":\"udevice\",\"idx\":1927,\"svalue\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":340,"wires":[["aa13a77a.9a1d88","5ad007ff.d8c158"]]},{"id":"469f7b38.71a744","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\n\nmsg.payload = {\"command\":\"udevice\",\"idx\":1778,\"svalue\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":400,"wires":[["aa13a77a.9a1d88"]]},{"id":"51e57838.793c48","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\n\nmsg.payload = {\"command\":\"udevice\",\"idx\":1778,\"svalue\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":400,"wires":[["5ad007ff.d8c158"]]},{"id":"16f28d7b.fffd53","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\n\nmsg.payload = {\"command\":\"udevice\",\"idx\":1929,\"svalue\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":580,"wires":[["aa13a77a.9a1d88","5ad007ff.d8c158"]]},{"id":"bd7c401.f926cc","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\n\nmsg.payload = {\"command\":\"udevice\",\"idx\":1930,\"svalue\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":460,"wires":[["aa13a77a.9a1d88","5ad007ff.d8c158"]]},{"id":"33e337cf.7bc378","type":"function","z":"a7f56b1b.43d8d8","name":"","func":"\n\nmsg.payload = {\"command\":\"udevice\",\"idx\":1931,\"svalue\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":520,"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":""}]```