mqtt-example-flow

This flow Reads mqtt topics to file in a couple different ways to give syntax examples

[{"id":"26ca1d88.49b1f2","type":"subflow","name":"mqtt | Topic","info":"","category":"","in":[{"x":60,"y":60,"wires":[{"id":"deb24c63.68bd8"}]}],"out":[{"x":480,"y":200,"wires":[{"id":"ffecb43f.18a568","port":0}]}],"env":[{"name":"topic","type":"str","value":"todo"}],"color":"#C7E9C0","icon":"node-red-contrib-mqtt-connection-check/conn.svg","status":{"x":400,"y":320,"wires":[{"id":"ffecb43f.18a568","port":0}]}},{"id":"ffecb43f.18a568","type":"mqtt in","z":"26ca1d88.49b1f2","name":"","topic":"$(topic)","qos":"1","datatype":"auto","broker":"5b41a831.e6efd8","x":270,"y":200,"wires":[["674b2d1d.20ea04","35aa6b02.96db04"]]},{"id":"be96f5e3.04ed88","type":"mqtt out","z":"26ca1d88.49b1f2","name":"","topic":"$(topic)","qos":"1","retain":"false","broker":"5b41a831.e6efd8","x":300,"y":80,"wires":[]},{"id":"674b2d1d.20ea04","type":"ui_text","z":"26ca1d88.49b1f2","d":true,"tab":"eb6fd063.6755e","name":"","group":"","order":3,"format":"{{msg.payload}}","x":420,"y":140,"wires":[]},{"id":"deb24c63.68bd8","type":"ui_text_input","z":"26ca1d88.49b1f2","tab":"eb6fd063.6755e","mode":"text","delay":"0","name":"$(topic)","topic":"$(topic)","group":"","order":1,"x":160,"y":80,"wires":[["be96f5e3.04ed88"]]},{"id":"35aa6b02.96db04","type":"debug","z":"26ca1d88.49b1f2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","x":480,"y":260,"wires":[]},{"id":"852eb089.1d4128","type":"inject","z":"26ca1d88.49b1f2","d":true,"name":"","topic":"","payload":"boot","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":320,"wires":[["af1a7a51.28c9b8"]]},{"id":"af1a7a51.28c9b8","type":"file in","z":"26ca1d88.49b1f2","d":true,"name":"","filename":"","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":270,"y":320,"wires":[[]]},{"id":"eb6fd063.6755e","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":"1"},{"id":"3f4a8052.c56d8","type":"subflow","name":"topic >> $(topic).txt","info":"","category":"","in":[],"out":[{"x":680,"y":120,"wires":[{"id":"85b51809.7be1d8","port":0}]}],"env":[{"name":"topic","type":"str","value":"#"}],"color":"#DDAA99","status":{"x":200,"y":180,"wires":[{"id":"8f28632e.32354","port":0}]}},{"id":"8f28632e.32354","type":"mqtt in","z":"3f4a8052.c56d8","name":"wildcard","topic":"$(topic)","qos":"0","datatype":"auto","broker":"5b41a831.e6efd8","x":100,"y":140,"wires":[["fca021de.89551","ab73e21a.08785","55fa00f8.fd456","474cca79.357d04"]]},{"id":"85b51809.7be1d8","type":"file","z":"3f4a8052.c56d8","name":"write file","filename":"","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":560,"y":140,"wires":[["d4167afd.756488"]]},{"id":"474cca79.357d04","type":"function","z":"3f4a8052.c56d8","name":"extend_path","func":"var n = msg.topic.includes(\"/\");\n\nif (n){\n    msg.topic = msg.topic.replace(\"/\",\"//\")\n    msg.filename = \"notes//\"+msg.topic\n} else {\n    msg.filename = \"notes//\"+msg.topic\n}\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":140,"wires":[["85b51809.7be1d8"]]},{"id":"d4167afd.756488","type":"debug","z":"3f4a8052.c56d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":180,"wires":[]},{"id":"55fa00f8.fd456","type":"change","z":"3f4a8052.c56d8","d":true,"name":"","rules":[{"t":"set","p":"text","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":220,"wires":[["52b10180.bf56"]]},{"id":"52b10180.bf56","type":"join-message","z":"3f4a8052.c56d8","d":true,"name":"push to phone","text":"","title":"Msg recieved","url":"","notificationicon":"","joinConfig":"af705b49.68a668","x":560,"y":220,"wires":[["d4167afd.756488"]]},{"id":"fca021de.89551","type":"delay","z":"3f4a8052.c56d8","d":true,"name":"","pauseType":"delay","timeout":"3","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":270,"y":80,"wires":[["474cca79.357d04","55fa00f8.fd456"]]},{"id":"ab73e21a.08785","type":"moment","z":"3f4a8052.c56d8","d":true,"name":"Log timestamp on seperate line","topic":"","input":"","inputType":"date","inTz":"CDT","adjAmount":0,"adjType":"days","adjDir":"add","format":"MM-DD_HH:mm","locale":"C","output":"","outputType":"msg","outTz":"CDT","x":270,"y":40,"wires":[["474cca79.357d04"]]},{"id":"2d2dfa23.949ff6","type":"subflow","name":"devices","info":"","category":"","in":[{"x":80,"y":60,"wires":[{"id":"dc8927f1.73e998"}]}],"out":[{"x":680,"y":220,"wires":[{"id":"6f859c5f.2b4a04","port":0}]}],"env":[{"name":"device","type":"str","value":"p2"},{"name":"override","type":"bool","value":"false"}],"color":"#DDAA99","status":{"x":280,"y":260,"wires":[{"id":"c097a64b.ff69c8","port":0}]}},{"id":"c097a64b.ff69c8","type":"mqtt in","z":"2d2dfa23.949ff6","name":"","topic":"$(device)","qos":"1","datatype":"auto","broker":"5b41a831.e6efd8","x":100,"y":240,"wires":[["8d6dfb0b.6ab888"]]},{"id":"3f2d5a86.4a5616","type":"ui_text","z":"2d2dfa23.949ff6","d":true,"name":"Device Output","group":"3ec92893.217438","order":3,"format":"{{msg.payload}}","x":400,"y":300,"wires":[]},{"id":"90cacfb.85c1a3","type":"ui_text_input","z":"2d2dfa23.949ff6","d":true,"mode":"text","delay":"0","name":"UI Device Input","topic":"$(device)","group":"c04a6d97.054e8","order":2,"x":120,"y":120,"wires":[["dc8927f1.73e998"]]},{"id":"6f859c5f.2b4a04","type":"join-message","z":"2d2dfa23.949ff6","name":"push to device","text":"","title":"","url":"","notificationicon":"","joinConfig":"af705b49.68a668","x":580,"y":120,"wires":[[]]},{"id":"9a1c5bc6.bb88a8","type":"change","z":"2d2dfa23.949ff6","name":"","rules":[{"t":"set","p":"devices","pt":"msg","to":"device","tot":"env"},{"t":"set","p":"text","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":160,"wires":[["6f859c5f.2b4a04"]]},{"id":"dc8927f1.73e998","type":"mqtt out","z":"2d2dfa23.949ff6","name":"","topic":"$(device)","qos":"","retain":"","broker":"5b41a831.e6efd8","x":280,"y":60,"wires":[]},{"id":"8d6dfb0b.6ab888","type":"switch","z":"2d2dfa23.949ff6","name":"","property":"override","propertyType":"env","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":200,"wires":[["9a1c5bc6.bb88a8"],[]]},{"id":"af705b49.68a668","type":"join-config","z":"","name":"","register":true},{"id":"5d57dd27.79b114","type":"tab","label":"mqtt","disabled":false,"info":""},{"id":"b0ef344b.3f0a68","type":"mqtt in","z":"5d57dd27.79b114","d":true,"name":"","topic":"#","qos":"0","datatype":"auto","broker":"5b41a831.e6efd8","x":610,"y":1000,"wires":[["18f3de1e.8a5702","50ad0bf2.12be44"]]},{"id":"18f3de1e.8a5702","type":"debug","z":"5d57dd27.79b114","d":true,"name":"MQTT # RAW","active":false,"console":"false","complete":"payload","x":1220,"y":1000,"wires":[]},{"id":"50ad0bf2.12be44","type":"function","z":"5d57dd27.79b114","d":true,"name":"Store and shift msg","func":"\n\n\n// initialise the counter to 0 if it doesn't exist already\nvar text = context.get('text')|| [];\n\ntext.push(msg);\nif (text.length > 20){\n    text.shift();\n    text.length = 20;\n} \n\n// store the value back\ncontext.set('text',text);\n// make it part of the outgoing msg object\nmsg = {};\nmsg.payload = text;\nreturn msg;\n","outputs":1,"noerr":0,"x":890,"y":1060,"wires":[["81a6f594.6e6188","f88c0853.16b118"]]},{"id":"81a6f594.6e6188","type":"debug","z":"5d57dd27.79b114","d":true,"name":"mqtt array","active":true,"console":"false","complete":"payload","x":1210,"y":1080,"wires":[]},{"id":"f88c0853.16b118","type":"ui_template","z":"5d57dd27.79b114","d":true,"name":"MQTT Output","group":"ae30d055.c16be","order":1,"format":"<ul>\n <li ng-repeat=\"x in msg.payload\">\n <font color=\"red\">{{x.topic}}</font>\n    <ul>\n        <li>{{x.payload}}</li>\n    </ul>\n </li>\n</ul>","storeOutMessages":true,"fwdInMessages":true,"x":1220,"y":1040,"wires":[[]]},{"id":"567a805f.4a07e","type":"mqtt out","z":"5d57dd27.79b114","d":true,"name":"","topic":"","qos":"","retain":"","broker":"5b41a831.e6efd8","x":1230,"y":1180,"wires":[]},{"id":"a1f7081e.61b7e8","type":"ui_text_input","z":"5d57dd27.79b114","d":true,"mode":"text","delay":"300","name":"Message","topic":"message","group":"ae30d055.c16be","order":3,"x":620,"y":1120,"wires":[["c26ff044.805e1"]]},{"id":"41b9ef6d.267f9","type":"ui_button","z":"5d57dd27.79b114","d":true,"name":"Submit","payload":"submit","topic":"submit","group":"ae30d055.c16be","order":4,"x":610,"y":1160,"wires":[["c26ff044.805e1"]],"icon":"fa-arrow-circle-o-up"},{"id":"c26ff044.805e1","type":"function","z":"5d57dd27.79b114","d":true,"name":"Store and Submit","func":"context.msg = context.msg || {};\n\nswitch (msg.topic){\n    case 'message':\n        context.msg.payload = msg.payload;\n        break;\n    case 'topic':\n        context.msg.topic = msg.payload;\n        break;\n    case 'submit':\n        if(context.msg.topic){\n            return context.msg;\n        }else{\n            context.msg.topic=\"#\"; // set default topic\n            return context.msg;\n        }\n}","outputs":"1","noerr":0,"x":890,"y":1140,"wires":[["567a805f.4a07e","6c32e7e0.5d3f68"]]},{"id":"6c32e7e0.5d3f68","type":"debug","z":"5d57dd27.79b114","d":true,"name":"MQTT Monitor","active":true,"console":"false","complete":"true","x":1200,"y":1140,"wires":[]},{"id":"56f5e9f1.fa5cc8","type":"ui_text_input","z":"5d57dd27.79b114","d":true,"mode":"text","delay":300,"name":"Topic","topic":"topic","group":"ae30d055.c16be","order":2,"x":610,"y":1080,"wires":[["c26ff044.805e1"]]},{"id":"258a283f.74ec98","type":"ui_button","z":"5d57dd27.79b114","d":true,"name":"Clear","payload":"","topic":"","group":"ae30d055.c16be","order":8,"x":610,"y":1200,"wires":[["56f5e9f1.fa5cc8","a1f7081e.61b7e8"]],"icon":"fa-trash"},{"id":"fa2eb112.a8642","type":"comment","z":"5d57dd27.79b114","d":true,"name":"MQTT Console","info":"This flow demonstrates how to view MQTT data\n\nIt is also a nice demonstration how you can\nuse an array to shift data into the UI template\n\n\nUI Viewable:\nhttp://localhost:1880/ui\n\nWritten by\nCory Guynn\n2016\nwww.InternetOfLEG0.com","x":640,"y":960,"wires":[]},{"id":"27083a00.5f9ac6","type":"switch","z":"5d57dd27.79b114","name":"ATC","property":"device","propertyType":"msg","rules":[{"t":"eq","v":"p2","vt":"str"},{"t":"eq","v":"serverghost","vt":"str"},{"t":"eq","v":"s8","vt":"str"},{"t":"eq","v":"fieldpc","vt":"str"},{"t":"eq","v":"hometv","vt":"str"},{"t":"eq","v":"ghost","vt":"str"},{"t":"eq","v":"pi4","vt":"str"},{"t":"eq","v":"grev","vt":"str"},{"t":"eq","v":"jim","vt":"str"},{"t":"eq","v":"XboxOne","vt":"str"},{"t":"eq","v":"All","vt":"str"}],"checkall":"true","repair":false,"outputs":11,"x":1242.999885559082,"y":511.9999542236328,"wires":[["a39cb3fd.bb11b"],["dbd040be.ad417"],["45fd8c7c.1c88c4"],["969c92f.7f2c07"],["2fc549d.cd72ab6"],["cdf1318c.fb62b"],[],["36e5399.c3341c6"],["54812134.e7c7b"],["84731ba7.b412b8"],["2a26a5f6.7fc7ca"]],"inputLabels":["device=:=topic=:=payload"],"outputLabels":["p2","serverghost","s8","fieldpc","hometv","ghost","pi4","grev","jim","XboxOne","All"],"icon":"node-red/batch.svg","l":false},{"id":"a39cb3fd.bb11b","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"p2","env":[],"x":1377.999885559082,"y":311.9999542236328,"wires":[["3725b2b0.c6542e","5175cdcd.e86034"]]},{"id":"dbd040be.ad417","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"serverghost","env":[{"name":"device","value":"serverghost","type":"str"},{"name":"override","value":"true","type":"bool"}],"x":1417.999885559082,"y":471.9999542236328,"wires":[["3977cd73.560412","c2a84e4d.23bd7"]]},{"id":"45fd8c7c.1c88c4","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"s8","env":[{"name":"device","value":"s8","type":"str"}],"x":1377.999885559082,"y":371.9999542236328,"wires":[["3725b2b0.c6542e"]]},{"id":"969c92f.7f2c07","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"fieldpc","env":[{"name":"device","value":"fieldpc","type":"str"},{"name":"override","value":"true","type":"bool"}],"x":1397.999885559082,"y":531.9999542236328,"wires":[["3977cd73.560412"]]},{"id":"2fc549d.cd72ab6","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"hometv","env":[{"name":"device","value":"hometv","type":"str"}],"x":1467.999885559082,"y":691.9999542236328,"wires":[["fd21e541.6a4538","20d40eef.ae5042"]]},{"id":"cdf1318c.fb62b","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"ghost","env":[{"name":"device","value":"ghost","type":"str"},{"name":"override","value":"true","type":"bool"}],"x":1397.999885559082,"y":591.9999542236328,"wires":[["3977cd73.560412"]]},{"id":"36e5399.c3341c6","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"grev","env":[{"name":"device","value":"grev","type":"str"}],"x":1457.999885559082,"y":811.9999542236328,"wires":[["fd21e541.6a4538"]]},{"id":"54812134.e7c7b","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"jim","env":[{"name":"device","value":"jim","type":"str"}],"x":1457.999885559082,"y":751.9999542236328,"wires":[["fd21e541.6a4538"]]},{"id":"84731ba7.b412b8","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"XboxOne","env":[{"name":"device","value":"XboxOne","type":"str"}],"x":1327.999885559082,"y":871.9999542236328,"wires":[["53de59e0.098b98"]]},{"id":"2a26a5f6.7fc7ca","type":"subflow:2d2dfa23.949ff6","z":"5d57dd27.79b114","name":"All","env":[{"name":"device","value":"All","type":"str"}],"x":1317.999885559082,"y":931.9999542236328,"wires":[["53de59e0.098b98"]]},{"id":"fe1d14a0.93de88","type":"set-defaults","z":"5d57dd27.79b114","name":"device","rules":[{"p":"device","pt":"msg","to":"p2","tot":"msg"}],"chbox_DoOutputToMessage":true,"chbox_SetCurrentToMsg":false,"howSend":{"text":"device","type":"msg","modifiedValue":"device"},"dropdown_HowManyMessages":"single","dropdownObjOrVal":"value","outputs":1,"x":1157.999885559082,"y":511.9999542236328,"wires":[["27083a00.5f9ac6"]],"info":"\np2  \nserverghost  \ns8   \nfieldpc    \nhometv  \nghost  \ngrev  \njim  \nXboxOne  \nAll  \n"},{"id":"b9b46edb.65b6e","type":"link in","z":"5d57dd27.79b114","name":"Join with Device splitter ","links":["854116b1.92ee98","d24639a6.d835b8","81d34aac.32c3f8"],"x":1062.999885559082,"y":511.9999542236328,"wires":[["fe1d14a0.93de88"]]},{"id":"3725b2b0.c6542e","type":"debug","z":"5d57dd27.79b114","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","x":1607.999885559082,"y":351.9999542236328,"wires":[]},{"id":"3977cd73.560412","type":"debug","z":"5d57dd27.79b114","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","x":1647.999885559082,"y":531.9999542236328,"wires":[]},{"id":"fd21e541.6a4538","type":"debug","z":"5d57dd27.79b114","name":"","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","x":1667.999885559082,"y":731.9999542236328,"wires":[]},{"id":"53de59e0.098b98","type":"debug","z":"5d57dd27.79b114","name":"","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","x":1527.999885559082,"y":911.9999542236328,"wires":[]},{"id":"f6a6e903.1b2ee8","type":"mqtt in","z":"5d57dd27.79b114","d":true,"name":"#","topic":"#","qos":"0","datatype":"auto","broker":"5b41a831.e6efd8","x":90,"y":180,"wires":[["81c7ddeb.f3175","9ad4cc2c.3612a"]]},{"id":"d14ffb65.ab4d18","type":"file","z":"5d57dd27.79b114","name":"write","filename":"","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":950,"y":300,"wires":[["81c7ddeb.f3175"]]},{"id":"a5327306.11b2d","type":"function","z":"5d57dd27.79b114","name":"extend_path","func":"msg.filename = \"notes//.tmp\"\nvar skip = msg.topic.includes(\"_skip\");\nif (skip){\n    msg.topic = msg.topic.replace(\"_skip\",\"\")\n} else {\n    // var ignore = global.get('global_mqtt_ignore')\n    var ignore = msg.topic.includes('Scanner')\n    // var globalskip = ignore.includes(msg.topic)\n    if (ignore){\n    }else{\n        var is_path = msg.topic.includes(\"/\");\n        if (is_path){\n            msg.topic = msg.topic.replace(\"/\",\"//\")\n            msg.filename = \"notes//\"+msg.topic\n        } else {\n            msg.filename = \"notes//\"+msg.topic\n        }\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":220,"wires":[["fc8c6621.229098","68276080.639ec"]]},{"id":"81c7ddeb.f3175","type":"debug","z":"5d57dd27.79b114","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1150,"y":300,"wires":[]},{"id":"b257372d.92bff8","type":"change","z":"5d57dd27.79b114","name":"","rules":[{"t":"set","p":"text","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":160,"wires":[["89193975.8a7b68"]]},{"id":"89193975.8a7b68","type":"join-message","z":"5d57dd27.79b114","name":"notification","text":"","title":"Msg recieved","url":"","notificationicon":"","joinConfig":"af705b49.68a668","x":950,"y":260,"wires":[["81c7ddeb.f3175"]]},{"id":"6c4827c.0e5ebd8","type":"delay","z":"5d57dd27.79b114","name":"3ms","pauseType":"delay","timeout":"3","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":570,"y":120,"wires":[["a5327306.11b2d"]]},{"id":"9158f0e.87d241","type":"moment","z":"5d57dd27.79b114","name":"TImestamp","topic":"","input":"","inputType":"date","inTz":"CDT","adjAmount":0,"adjType":"days","adjDir":"add","format":"MM-DD_HH:mm","locale":"C","output":"","outputType":"msg","outTz":"CDT","x":570,"y":100,"wires":[["a5327306.11b2d"]]},{"id":"6513d1b5.e2f45","type":"switch","z":"5d57dd27.79b114","name":"if(msg.log_time)","property":"log_time","propertyType":"msg","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":200,"wires":[["6c4827c.0e5ebd8","9158f0e.87d241"],["a5327306.11b2d"]]},{"id":"fc8c6621.229098","type":"switch","z":"5d57dd27.79b114","name":"send_confirm","property":"send_confirm","propertyType":"global","rules":[{"t":"true"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":860,"y":120,"wires":[["b257372d.92bff8"],[]]},{"id":"2092c4e7.935cfc","type":"DataIn","z":"5d57dd27.79b114","collection":"1800cc9f.684003","name":"not doing anything yet","update":false,"topic":"","x":860,"y":440,"wires":[]},{"id":"d67b07f0.6ca1c8","type":"DataOut","z":"5d57dd27.79b114","collection":"1800cc9f.684003","name":"database out","topic":"","error":true,"x":950,"y":340,"wires":[["81c7ddeb.f3175"]]},{"id":"443b7356.0dc60c","type":"change","z":"5d57dd27.79b114","name":"path","rules":[{"t":"set","p":"datapath","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":340,"wires":[["d67b07f0.6ca1c8"]]},{"id":"1b99dbc8.b7ac34","type":"inject","z":"5d57dd27.79b114","name":"mqtt.file","topic":"file_mode","payload":"file","payloadType":"str","repeat":"43200","crontab":"","once":true,"onceDelay":0.1,"x":100,"y":300,"wires":[["ddcc9d1d.fc84a"]]},{"id":"eba5e7a2.6baae8","type":"inject","z":"5d57dd27.79b114","name":"mqtt.json","topic":"","payload":"json","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":340,"wires":[["ddcc9d1d.fc84a"]]},{"id":"68276080.639ec","type":"switch","z":"5d57dd27.79b114","name":"","property":"mqttlog","propertyType":"global","rules":[{"t":"eq","v":"file","vt":"str"},{"t":"eq","v":"json","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":750,"y":280,"wires":[["d14ffb65.ab4d18"],["443b7356.0dc60c"]]},{"id":"d7ca9e7.9efda6","type":"inject","z":"5d57dd27.79b114","name":"confirm(off)","topic":"","payload":"false","payloadType":"bool","repeat":"7200","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":400,"wires":[["7edd6a90.d0e074"]]},{"id":"bb51e602.e0f888","type":"inject","z":"5d57dd27.79b114","name":"turn on","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":440,"wires":[["7edd6a90.d0e074"]]},{"id":"e0a1b852.89dce8","type":"change","z":"5d57dd27.79b114","name":"mqtlog","rules":[{"t":"set","p":"mqttlog","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":340,"wires":[[]]},{"id":"7edd6a90.d0e074","type":"change","z":"5d57dd27.79b114","name":"confirm","rules":[{"t":"set","p":"send_confirm","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":440,"wires":[[]]},{"id":"5175cdcd.e86034","type":"function","z":"5d57dd27.79b114","d":true,"name":"Tasker","func":"\nreturn msg;","outputs":1,"noerr":0,"x":1450.999888420105,"y":257.99993991851807,"wires":[[]]},{"id":"c2a84e4d.23bd7","type":"function","z":"5d57dd27.79b114","d":true,"name":"Eventghost","func":"\nreturn msg;","outputs":1,"noerr":0,"x":1510.999888420105,"y":417.99993991851807,"wires":[[]]},{"id":"20d40eef.ae5042","type":"function","z":"5d57dd27.79b114","d":true,"name":"chrome","func":"\nreturn msg;","outputs":1,"noerr":0,"x":1540.999888420105,"y":637.9999399185181,"wires":[[]]},{"id":"9ad4cc2c.3612a","type":"switch","z":"5d57dd27.79b114","name":"Ignore list","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"Scanner","vt":"str"},{"t":"cont","v":"status","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":320,"y":140,"wires":[[],[],["6513d1b5.e2f45"]]},{"id":"ddcc9d1d.fc84a","type":"ui_radio_button","z":"5d57dd27.79b114","tab":"3f176065.89f88","name":"file_mode","topic":"file_mode","group":"","order":1,"buttons":[{"label":"file","payload":"file"},{"label":"json","payload":"json"}],"x":320,"y":280,"wires":[["e0a1b852.89dce8"]]},{"id":"b13f8647.8bc528","type":"ui_radio_button","z":"5d57dd27.79b114","tab":"3f176065.89f88","name":"confirm_mode","topic":"confirm_mode","group":"","order":1,"buttons":[{"label":"file","payload":"file"},{"label":"json","payload":"json"}],"x":320,"y":380,"wires":[[]]},{"id":"7afdcd2c.065864","type":"subflow:3f4a8052.c56d8","z":"5d57dd27.79b114","name":"sub #","env":[],"x":90,"y":60,"wires":[[]],"icon":"node-red/file-in.svg","info":"Subflow that "},{"id":"a9bcfd44.2df9b","type":"comment","z":"5d57dd27.79b114","name":"Log all topics to file via subflow","info":"","x":130,"y":20,"wires":[]},{"id":"c8871e4a.8e4d1","type":"subflow:26ca1d88.49b1f2","z":"5d57dd27.79b114","d":true,"name":"log","env":[{"name":"topic","value":"log","type":"str"}],"x":930,"y":680,"wires":[[]]},{"id":"285f49b9.3d7a36","type":"subflow:26ca1d88.49b1f2","z":"5d57dd27.79b114","d":true,"name":"todo","env":[],"x":830,"y":620,"wires":[[]]},{"id":"5877ed72.071dd4","type":"subflow:26ca1d88.49b1f2","z":"5d57dd27.79b114","d":true,"name":"note","env":[{"name":"topic","value":"note","type":"str"}],"x":650,"y":780,"wires":[[]]},{"id":"bfb3759f.781f28","type":"subflow:26ca1d88.49b1f2","z":"5d57dd27.79b114","d":true,"name":"timesheet","env":[{"name":"topic","value":"timesheet","type":"str"}],"x":680,"y":620,"wires":[[]]},{"id":"89752edd.da16c","type":"subflow:26ca1d88.49b1f2","z":"5d57dd27.79b114","d":true,"name":"done","env":[{"name":"topic","value":"done","type":"str"}],"x":530,"y":660,"wires":[[]]},{"id":"eac0c9b8.2252a8","type":"subflow:26ca1d88.49b1f2","z":"5d57dd27.79b114","name":"status","env":[{"name":"topic","value":"status/aws","type":"str"}],"x":730,"y":720,"wires":[["81d34aac.32c3f8"]]},{"id":"3ec9a2bb.ba1ece","type":"inject","z":"5d57dd27.79b114","name":"Init","topic":"status/aws","payload":"online","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":".5","x":610,"y":720,"wires":[["eac0c9b8.2252a8"]]},{"id":"81d34aac.32c3f8","type":"link out","z":"5d57dd27.79b114","name":"status mqtt","links":["b9b46edb.65b6e"],"x":815,"y":720,"wires":[]},{"id":"89214e6c.eed25","type":"subflow:3f4a8052.c56d8","z":"5d57dd27.79b114","d":true,"name":"Log to file: music.log","env":[{"name":"topic","value":"music.log","type":"str"}],"x":230,"y":620,"wires":[[]],"icon":"node-red/file-in.svg"},{"id":"5b41a831.e6efd8","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1884","clientid":"local","usetls":false,"compatmode":false,"keepalive":"60","cleansession":false,"birthTopic":"status/sawsflow","birthQos":"0","birthRetain":"true","birthPayload":"online","closeTopic":"status/sawsflow","closeQos":"0","closeRetain":"true","closePayload":"offline","willTopic":"status/sawsflow","willQos":"0","willRetain":"true","willPayload":"offline"},{"id":"1800cc9f.684003","type":"json-db-collection","z":"","name":"mqtttopicsettings","collection":"topicsettings","save":true},{"id":"3f176065.89f88","type":"ui_tab","z":"","name":"Dashboard","icon":"dashboard","order":1}]

Flow Info

Created 5 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x6)
  • comment (x2)
  • debug (x10)
  • delay (x2)
  • file (x2)
  • file in (x1)
  • function (x7)
  • inject (x6)
  • link in (x1)
  • link out (x1)
  • mqtt in (x5)
  • mqtt out (x3)
  • mqtt-broker (x1)
  • switch (x6)
Other
  • DataIn (x1)
  • DataOut (x1)
  • join-config (x1)
  • join-message (x3)
  • json-db-collection (x1)
  • moment (x2)
  • set-defaults (x1)
  • subflow (x3)
  • subflow:26ca1d88.49b1f2 (x6)
  • subflow:2d2dfa23.949ff6 (x10)
  • subflow:3f4a8052.c56d8 (x2)
  • tab (x1)
  • ui_button (x2)
  • ui_radio_button (x2)
  • ui_tab (x2)
  • ui_template (x1)
  • ui_text (x2)
  • ui_text_input (x4)

Tags

  • mqtt
  • join
  • dashboard
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option