[{"id":"ca465d63.35b9a","type":"ds18b20","name":"draussen","sensorid":"28-000005e5e8b0","timer":"1","x":332,"y":413,"z":"dafee8d6.250118","wires":[["a32d6178.5cd2a","12b8cecc.ed4731"]]},{"id":"9170c191.6e8f4","type":"ds18b20","name":"unterpc","sensorid":"28-000005e603ae","timer":"1","x":338,"y":507,"z":"dafee8d6.250118","wires":[["a32d6178.5cd2a","12b8cecc.ed4731"]]},{"id":"a32d6178.5cd2a","type":"function","name":"Wait for all tasks to finish","func":"context.data = context.data || new Object();\n\nswitch (msg.topic) {\n case \"draussen\":\n context.data.draussen = msg.payload;\n msg = null;\n break;\n case \"unterpc\":\n context.data.unterpc = msg.payload;\n msg = null;\n break;\n \n default:\n msg = null;\n \tbreak;\n\n}\n\nif(context.data.draussen != null && context.data.unterpc != null ) {\n\tmsg2 = new Object();\n msg2 = context.data;\n context.data=null;\n\treturn msg2;\n} else return msg;","outputs":1,"x":647,"y":621,"z":"dafee8d6.250118","wires":[["8793d1dd.786c3"]]},{"id":"bd264db9.42d9b","type":"function","name":"draussen","func":"msg.topic=\"draussen\";\nmsg.payload=\"draussen-payload\"\nreturn msg;","outputs":1,"x":335,"y":588,"z":"dafee8d6.250118","wires":[["a32d6178.5cd2a"]]},{"id":"be1374d1.41ec88","type":"function","name":"unterpc","func":"msg.topic=\"unterpc\";\nmsg.payload=\"unterpc-payload\"\nreturn msg;","outputs":1,"x":338,"y":683,"z":"dafee8d6.250118","wires":[["a32d6178.5cd2a"]]},{"id":"1233a591.edcc5a","type":"inject","name":"Start","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":165,"y":635,"z":"dafee8d6.250118","wires":[["bd264db9.42d9b","be1374d1.41ec88"]]},{"id":"12b8cecc.ed4731","type":"debug","name":"","active":true,"console":"false","complete":"false","x":607,"y":536,"z":"dafee8d6.250118","wires":[]},{"id":"8793d1dd.786c3","type":"debug","name":"","active":true,"console":"false","complete":"true","x":895,"y":620,"z":"dafee8d6.250118","wires":[]}]
[{"id":"a7c99df.f58366","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":""},{"id":"f1cca903.0e3358","type":"ds18b20","name":"draussen","sensorid":"28-000005e5e8b0","timer":"2","x":206,"y":91,"z":"c0fd34.ff3f02d","wires":[["addc9110.52237","ce0962b2.31f6a"]]},{"id":"addc9110.52237","type":"debug","name":"draussen","active":true,"console":"false","complete":"payload","x":352,"y":142,"z":"c0fd34.ff3f02d","wires":[]},{"id":"1f0ddee7.e0f221","type":"ds18b20","name":"unterpc","sensorid":"28-000005e603ae","timer":"2","x":206,"y":215,"z":"c0fd34.ff3f02d","wires":[["156bae93.ea9451","e68ba0ed.19746"]]},{"id":"156bae93.ea9451","type":"debug","name":"unterpc","active":true,"console":"false","complete":"payload","x":353,"y":266,"z":"c0fd34.ff3f02d","wires":[]},{"id":"ce0962b2.31f6a","type":"mqtt out","name":"","topic":"temp/draussen","qos":"","retain":"","broker":"a7c99df.f58366","x":506,"y":92,"z":"c0fd34.ff3f02d","wires":[]},{"id":"97f0f16.f680f1","type":"mqtt in","name":"","topic":"temp/#","broker":"a7c99df.f58366","x":680,"y":89,"z":"c0fd34.ff3f02d","wires":[["741c7b3.f8be384","13b8c1db.ec473e"]]},{"id":"741c7b3.f8be384","type":"debug","name":"","active":false,"console":"false","complete":"true","x":850,"y":89,"z":"c0fd34.ff3f02d","wires":[]},{"id":"e68ba0ed.19746","type":"mqtt out","name":"","topic":"temp/unterpc","qos":"","retain":"","broker":"a7c99df.f58366","x":494,"y":215,"z":"c0fd34.ff3f02d","wires":[]},{"id":"13b8c1db.ec473e","type":"function","name":"Wait for all tasks to finish","func":"context.data = context.data || new Object();\n\nswitch (msg.topic) {\n case \"temp/draussen\":\n context.data.draussen = msg.payload;\n msg = null;\n break;\n case \"temp/unterpc\":\n context.data.unterpc = msg.payload;\n msg = null;\n break;\n \n default:\n msg = null;\n \tbreak;\n\n}\n\nif(context.data.draussen != null && context.data.unterpc != null ) {\n\tmsg2 = new Object();\n msg2 = context.data;\n context.data=null;\n\treturn msg2;\n} else return msg;","outputs":1,"x":890,"y":152,"z":"c0fd34.ff3f02d","wires":[["87d0d9a.f782f28","d923a185.26dc6","e15f1739.1ea0e8"]]},{"id":"87d0d9a.f782f28","type":"debug","name":"","active":true,"console":"false","complete":"true","x":1140,"y":152,"z":"c0fd34.ff3f02d","wires":[]},{"id":"d923a185.26dc6","type":"debug","name":"","active":true,"console":"false","complete":"draussen","x":1163,"y":188,"z":"c0fd34.ff3f02d","wires":[]},{"id":"e15f1739.1ea0e8","type":"debug","name":"","active":true,"console":"false","complete":"unterpc","x":1159,"y":227,"z":"c0fd34.ff3f02d","wires":[]}]
--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Looking at the history of the node, it looks like an earlier version did set msg.topic based on the name property. But that was removed in the runtime code, but not in the ui. Will raise an issue on its repository, unless the author sees this thread.
The only debug tools you have are console.log to print things to the log output where you are running node-red, or add a second output to the function from which you can wire up to a debug node and send whatever you want.
Improving the developer experience of the function node is something I'm interested in getting feedback on. We currently use the Eclipse Orion text editor, but we've been hitting some difficulties getting some of the basic features we want to work.. Auto complete, syntax validation etc. We're close to moving over to the ACE editor which seems to work out of the box much better and gives a better experience without relying on the things around it.
Although we've talked about it before on this list, we haven't yet exposed the node.log/warn/error functions, so you can ignore them for now.
Many thanks!