From 4383c6beaf82b113245ed09030522783c34220b8 Mon Sep 17 00:00:00 2001 From: unixweb Date: Sun, 2 Feb 2020 15:06:59 +0100 Subject: [PATCH] Added new Flow for MQTT Split Messages --- mqtt-split-messages.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 mqtt-split-messages.js diff --git a/mqtt-split-messages.js b/mqtt-split-messages.js new file mode 100644 index 0000000..99581f1 --- /dev/null +++ b/mqtt-split-messages.js @@ -0,0 +1 @@ +[{"id":"bc0635f2.5a2d38","type":"mqtt in","z":"5d993ad1.d0ad14","name":"","topic":"ESP_Sensor1/#","qos":"2","datatype":"auto","broker":"27e18df8.22eae2","x":280,"y":180,"wires":[["e9cba957.77362"]]},{"id":"e9cba957.77362","type":"function","z":"5d993ad1.d0ad14","name":"Split Values","func":"var topic=msg.topic;\n\nif (topic==\"ESP_Sensor1/Sensor1/Temperature\"){\n return [ msg, null, null ]; \n}\n\nif (topic==\"ESP_Sensor1/Sensor1/Pressure\"){\n return [ null , msg, null ]; \n}\n\nif (topic==\"ESP_Sensor1/Sensor1/Humidity\"){\n return [ null, null, msg ]; \n}","outputs":3,"noerr":0,"x":490,"y":180,"wires":[["ae59d700.45338"],["705e1355.bbd74c"],["5bcb1b4c.5df4fc"]]},{"id":"ae59d700.45338","type":"debug","z":"5d993ad1.d0ad14","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":140,"wires":[]},{"id":"705e1355.bbd74c","type":"debug","z":"5d993ad1.d0ad14","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":180,"wires":[]},{"id":"5bcb1b4c.5df4fc","type":"debug","z":"5d993ad1.d0ad14","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":220,"wires":[]},{"id":"27e18df8.22eae2","type":"mqtt-broker","z":"","name":"unixweb","broker":"mqtt.unixweb.de","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]