[{"id":"e411fa50.6266e8","type":"tab","label":"Duet Outgoing - BLV mgn","disabled":false,"info":""},{"id":"1202483e.4ba818","type":"inject","z":"e411fa50.6266e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1700,"wires":[["c9f5abab.30068"]]},{"id":"c9f5abab.30068","type":"http request","z":"e411fa50.6266e8","name":"rr_statusType1","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_status?type=1","tls":"","x":340,"y":1740,"wires":[["52403a6e.e74da4"]]},{"id":"fd555062.90f0d8","type":"debug","z":"e411fa50.6266e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1090,"y":1720,"wires":[]},{"id":"52403a6e.e74da4","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_statusType1","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":1700,"wires":[["d4ef33a0.90f478"]]},{"id":"737e9825.a8bfb","type":"http request","z":"e411fa50.6266e8","name":"rr_fileinfo","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_fileinfo","tls":"","x":560,"y":2220,"wires":[["9546ce7.2dcbdb"]]},{"id":"9546ce7.2dcbdb","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_fileinfo","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":2300,"wires":[[]]},{"id":"942e078.30140f8","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"statusCode","pt":"msg"},{"t":"delete","p":"responseUrl","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":1700,"wires":[["fd555062.90f0d8"]]},{"id":"d4ef33a0.90f478","type":"http request","z":"e411fa50.6266e8","name":"rr_disconnect","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_disconnect","tls":"","x":600,"y":1740,"wires":[["942e078.30140f8"]]},{"id":"dc91b402.31022","type":"inject","z":"e411fa50.6266e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1840,"wires":[["fd25b5e9.d6c72"]]},{"id":"fd25b5e9.d6c72","type":"http request","z":"e411fa50.6266e8","name":"rr_statusType2","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_status?type=2","tls":"","x":340,"y":1880,"wires":[["27195892.00a7e8"]]},{"id":"27195892.00a7e8","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_statusType2","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":1840,"wires":[["694eba6f.be078c"]]},{"id":"50dfcd49.14b7c4","type":"debug","z":"e411fa50.6266e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":1880,"wires":[]},{"id":"b6fcc8d7.6c50e","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"statusCode","pt":"msg"},{"t":"delete","p":"responseUrl","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1840,"wires":[["50dfcd49.14b7c4"]]},{"id":"403e3c8d.f9ed34","type":"mqtt out","z":"e411fa50.6266e8","name":"","topic":"","qos":"0","retain":"false","broker":"83ebccdc.c8317","x":1610,"y":340,"wires":[]},{"id":"d1b874ef.d365d","type":"inject","z":"e411fa50.6266e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1980,"wires":[["25f61dbb.9380f2"]]},{"id":"25f61dbb.9380f2","type":"http request","z":"e411fa50.6266e8","name":"rr_statusType3","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_status?type=3","tls":"","x":340,"y":2020,"wires":[["dbb6945a.b155f8"]]},{"id":"dbb6945a.b155f8","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_statusType3","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":1980,"wires":[["903b0bb8.2f7fa"]]},{"id":"d2ea8504.3f77d","type":"debug","z":"e411fa50.6266e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":2020,"wires":[]},{"id":"862dfb7c.3f9c6","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"statusCode","pt":"msg"},{"t":"delete","p":"responseUrl","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1980,"wires":[["d2ea8504.3f77d"]]},{"id":"694eba6f.be078c","type":"http request","z":"e411fa50.6266e8","name":"rr_disconnect","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_disconnect","tls":"","x":660,"y":1880,"wires":[["b6fcc8d7.6c50e"]]},{"id":"903b0bb8.2f7fa","type":"http request","z":"e411fa50.6266e8","name":"rr_disconnect","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_disconnect","tls":"","x":680,"y":2020,"wires":[["862dfb7c.3f9c6"]]},{"id":"bd6e7888.05729","type":"inject","z":"e411fa50.6266e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":2100,"wires":[["68437298.af373c"]]},{"id":"68437298.af373c","type":"http request","z":"e411fa50.6266e8","name":"rr_fileinfo","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_fileinfo","tls":"","x":340,"y":2140,"wires":[["7969bf95.0661e8"]]},{"id":"7969bf95.0661e8","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_fileinfo","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":2100,"wires":[["a72f44d7.d50568"]]},{"id":"27680133.037c0e","type":"debug","z":"e411fa50.6266e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":890,"y":2140,"wires":[]},{"id":"77ee974d.e0603","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"statusCode","pt":"msg"},{"t":"delete","p":"responseUrl","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":2100,"wires":[["27680133.037c0e"]]},{"id":"a72f44d7.d50568","type":"http request","z":"e411fa50.6266e8","name":"rr_disconnect","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_disconnect","tls":"","x":660,"y":2140,"wires":[["77ee974d.e0603"]]},{"id":"38ece6c8.94f312","type":"ping","z":"e411fa50.6266e8","name":"Ping Duet","host":"192.168.8.15","timer":"5","x":260,"y":240,"wires":[["313c0a3e.9c173e","40dc590.ba2a6a8"]]},{"id":"8f4ffa95.cee808","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":950,"y":200,"wires":[]},{"id":"313c0a3e.9c173e","type":"switch","z":"e411fa50.6266e8","name":"ping?","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":240,"wires":[["a46a3c5.83cabc","29078e5b.44ef92"],["9fcf3754.de7bb8","abb30f62.e2ddc"]]},{"id":"40dc590.ba2a6a8","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":270,"y":200,"wires":[]},{"id":"9fcf3754.de7bb8","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":450,"y":160,"wires":[]},{"id":"f4b39bda.236878","type":"change","z":"e411fa50.6266e8","name":"flow.ping = true","rules":[{"t":"set","p":"ping","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":240,"wires":[["8f4ffa95.cee808","b0df5cd9.c10ad"]]},{"id":"53d893e5.28ea3c","type":"change","z":"e411fa50.6266e8","name":"flow.ping = false","rules":[{"t":"set","p":"ping","pt":"flow","to":"false","tot":"bool"},{"t":"delete","p":"pingStart","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":340,"wires":[["1e3f6153.348767"]]},{"id":"a46a3c5.83cabc","type":"switch","z":"e411fa50.6266e8","name":"flow.ping false previously?","property":"ping","propertyType":"flow","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":660,"y":240,"wires":[["f4b39bda.236878","e0bcda03.d6b8e"],["ac8a4f55.2c199","77cc5803.b9b908"]]},{"id":"ac8a4f55.2c199","type":"change","z":"e411fa50.6266e8","name":"flow.pingStart = timestamp","rules":[{"t":"set","p":"pingStart","pt":"flow","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":300,"wires":[["f4b39bda.236878"]]},{"id":"29078e5b.44ef92","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":450,"y":200,"wires":[]},{"id":"e0bcda03.d6b8e","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":610,"y":160,"wires":[]},{"id":"77cc5803.b9b908","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":610,"y":200,"wires":[]},{"id":"ebad6a34.6e27f8","type":"function","z":"e411fa50.6266e8","name":"Format JSON String","func":"var duet = \"duet/\";\nvar name = \"BLVmgn\";\n\n// topic: duet/BLV mgn\nmsg.topic = duet + name;\n\n// payload.name: \"BLV mgn\"\n// firmware: \"RepRapFirmware for Duet 2 WiFi/Ethernet\"\n// geometry: \"coreXY\"\n// voltage: 23.9\n\nmsg.payload = {};\n\nmsg.payload.name = msg.rr_statusType2.name;\nmsg.payload.firmware = msg.rr_statusType2.firmwareName;\nmsg.payload.geometry = msg.rr_statusType2.geometry;\nmsg.payload.voltage = msg.rr_statusType2.vin.cur;\nmsg.payload.uptime = msg.rr_statusType2.time;\n\n// remove all other objects\ndelete msg.rr_statusType2;\ndelete msg.redirectList;\n\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":600,"wires":[["cdfcda3.97f9da8","5be401d6.6b0668"]]},{"id":"abb30f62.e2ddc","type":"switch","z":"e411fa50.6266e8","name":"flow.ping true previously?","property":"ping","propertyType":"flow","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":300,"wires":[["53d893e5.28ea3c"],[]]},{"id":"b0df5cd9.c10ad","type":"link out","z":"e411fa50.6266e8","name":"Duet Outgoing - BLV mgn - Ping True","links":["11c87008.3a761","fc470618.7895f8"],"x":1095,"y":240,"wires":[]},{"id":"1e3f6153.348767","type":"link out","z":"e411fa50.6266e8","name":"Duet Outgoing - BLV mgn - Ping False","links":["fc2d450b.7fc198"],"x":595,"y":340,"wires":[]},{"id":"17675177.c2ef67","type":"comment","z":"e411fa50.6266e8","name":"Ping Test","info":"","x":180,"y":100,"wires":[]},{"id":"5c786c95.b44bbc","type":"comment","z":"e411fa50.6266e8","name":"Up - Update Periodically - Machine Overview","info":"","x":310,"y":520,"wires":[]},{"id":"15d4d77f.63d649","type":"comment","z":"e411fa50.6266e8","name":"Up - Update Frequently - Printer and Print Status","info":"","x":320,"y":740,"wires":[]},{"id":"6ae2a9c2.61caf","type":"comment","z":"e411fa50.6266e8","name":"Down - Update Once When Down - Printer Status and Clear Print Status","info":"","x":400,"y":1040,"wires":[]},{"id":"ac662990.e16b28","type":"delay","z":"e411fa50.6266e8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":320,"y":640,"wires":[["e1c2725.cb67c9"]]},{"id":"11c87008.3a761","type":"link in","z":"e411fa50.6266e8","name":"Duet Outgoing - BLV mgn - Update Periodically - Machine Overview","links":["b0df5cd9.c10ad"],"x":215,"y":600,"wires":[["ac662990.e16b28"]]},{"id":"e1c2725.cb67c9","type":"http request","z":"e411fa50.6266e8","name":"rr_statusType2","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_status?type=2","tls":"","x":440,"y":600,"wires":[["1850d58a.cc6da2"]]},{"id":"1850d58a.cc6da2","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_statusType2","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":640,"wires":[["feb4abb2.a77298"]]},{"id":"ce657a33.7a34d","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"statusCode","pt":"msg"},{"t":"delete","p":"responseUrl","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":640,"wires":[["ebad6a34.6e27f8"]]},{"id":"feb4abb2.a77298","type":"http request","z":"e411fa50.6266e8","name":"rr_disconnect","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_disconnect","tls":"","x":700,"y":600,"wires":[["ce657a33.7a34d"]]},{"id":"cdfcda3.97f9da8","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1130,"y":640,"wires":[]},{"id":"201825be.b0348a","type":"link in","z":"e411fa50.6266e8","name":"Duet Outgoing - BLV mgn - Send MQTT","links":["5be401d6.6b0668","cc2f6a2c.a2d248","dfc05cc5.12501","e334a43e.a0393","908a99ca.fd18d"],"x":1475,"y":340,"wires":[["403e3c8d.f9ed34"]]},{"id":"5be401d6.6b0668","type":"link out","z":"e411fa50.6266e8","name":"","links":["201825be.b0348a"],"x":1215,"y":600,"wires":[]},{"id":"ade36c25.3a5728","type":"comment","z":"e411fa50.6266e8","name":"Send MQTT","info":"","x":1450,"y":240,"wires":[]},{"id":"bb1c6a64.95621","type":"http request","z":"e411fa50.6266e8","name":"rr_fileinfo","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_fileinfo","tls":"","x":560,"y":840,"wires":[["d58cbf7e.06e1f"]]},{"id":"d58cbf7e.06e1f","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_fileinfo","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":800,"wires":[["91a07396.d09e08"]]},{"id":"b6e62470.6a7ec","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"statusCode","pt":"msg"},{"t":"delete","p":"responseUrl","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":800,"wires":[["37c6f5ee.eb86a2"]]},{"id":"91a07396.d09e08","type":"http request","z":"e411fa50.6266e8","name":"rr_disconnect","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_disconnect","tls":"","x":800,"y":840,"wires":[["b6e62470.6a7ec"]]},{"id":"fc470618.7895f8","type":"link in","z":"e411fa50.6266e8","name":"Duet Outgoing - BLV mgn - Update Frequently","links":["b0df5cd9.c10ad"],"x":215,"y":800,"wires":[["1b9d6f9c.011fa8"]]},{"id":"1b9d6f9c.011fa8","type":"http request","z":"e411fa50.6266e8","name":"rr_statusType3","method":"GET","ret":"obj","url":"http://192.168.8.15/rr_status?type=3","tls":"","x":340,"y":840,"wires":[["445da6dc.de473"]]},{"id":"445da6dc.de473","type":"change","z":"e411fa50.6266e8","name":"","rules":[{"t":"set","p":"rr_statusType3","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":800,"wires":[["bb1c6a64.95621"]]},{"id":"37c6f5ee.eb86a2","type":"function","z":"e411fa50.6266e8","name":"Format JSON String","func":"var duet = \"duet/\";\nvar name = \"BLVmgn\";\n\n// topic: duet/BLV mgn\nmsg.topic = duet + name;\n\nmsg.payload = {};\n\n//msg.payload.status = msg.rr_statusType3.status;\nswitch(msg.rr_statusType3.status) {\n case \"I\":\n msg.payload.status = \"Idle\";\n break;\n case \"P\":\n msg.payload.status = \"Printing from SD card\";\n break;\n case \"S\":\n msg.payload.status = \"Stopped\";\n break;\n case \"C\":\n msg.payload.status = \"Running Config File\";\n break;\n case \"A\":\n msg.payload.status = \"Paused\";\n break;\n case \"D\":\n msg.payload.status = \"Pausing\";\n break;\n case \"R\":\n msg.payload.status = \"Resuming from a pause\";\n break;\n case \"B\":\n msg.payload.status = \"Busy\";\n break;\n case \"F\":\n msg.payload.status = \"Performing firmware update\";\n break;\n default:\n // code block\n}\n\n//msg.payload.homex = msg.rr_statusType3.coords.axesHomed[0];\nswitch(msg.rr_statusType3.coords.axesHomed[0]) {\n case 1:\n msg.payload.homedX = \"True\";\n break;\n case 0:\n msg.payload.homedX = \"False\";\n break;\n default:\n // code block\n}\n\n//msg.payload.homey = msg.rr_statusType3.coords.axesHomed[1];\nswitch(msg.rr_statusType3.coords.axesHomed[1]) {\n case 1:\n msg.payload.homedY = \"True\";\n break;\n case 0:\n msg.payload.homedY = \"False\";\n break;\n default:\n // code block\n}\n\n//msg.payload.homez = msg.rr_statusType3.coords.axesHomed[2];\nswitch(msg.rr_statusType3.coords.axesHomed[2]) {\n case 1:\n msg.payload.homedZ = \"True\";\n break;\n case 0:\n msg.payload.homedZ = \"False\";\n break;\n default:\n // code block\n}\n\nmsg.payload.statusRaw = msg.rr_statusType3.status;\nmsg.payload.x = msg.rr_statusType3.coords.xyz[0];\nmsg.payload.y = msg.rr_statusType3.coords.xyz[1];\nmsg.payload.z = msg.rr_statusType3.coords.xyz[2];\nmsg.payload.speedRequested = msg.rr_statusType3.speeds.requested;\nmsg.payload.speedTop = msg.rr_statusType3.speeds.top;\nmsg.payload.currentTool = msg.rr_statusType3.currentTool;\nmsg.payload.speedFactor = msg.rr_statusType3.params.speedFactor;\nmsg.payload.extruderFactor = msg.rr_statusType3.params.extrFactors[0];\nmsg.payload.currentBedTemp = msg.rr_statusType3.temps.current[0];\nmsg.payload.currentHotendTemp = msg.rr_statusType3.temps.current[1]\t;\nmsg.payload.activeBedTemp = msg.rr_statusType3.temps.bed.active\t ;\nmsg.payload.activeHotendTemp = msg.rr_statusType3.temps.tools.active[0][0];\nmsg.payload.standbyBedTemp = msg.rr_statusType3.temps.bed.standby;\nmsg.payload.standbyHotendTemp = msg.rr_statusType3.temps.tools.standby[0][0];\nmsg.payload.printPercent = msg.rr_statusType3.fractionPrinted;\nmsg.payload.printDuration = msg.rr_statusType3.printDuration;\nmsg.payload.printTimeLeft = msg.rr_statusType3.timesLeft.filament;\n\nswitch(msg.rr_statusType3.temps.state[0]) {\n case 2:\n msg.payload.stateBed = \"Active\";\n break;\n case 1:\n msg.payload.stateBed = \"Standby\";\n break;\n case 0:\n msg.payload.stateBed = \"Off\";\n break;\n default:\n // code block\n}\n\nswitch(msg.rr_statusType3.temps.state[1]) {\n case 2:\n msg.payload.stateHotend = \"Active\";\n break;\n case 1:\n msg.payload.stateHotend = \"Standby\";\n break;\n case 0:\n msg.payload.stateHotend = \"Off\";\n break;\n default:\n // code block\n}\n\nmsg.payload.fileInfoError = msg.rr_fileinfo.err;\n\nif (!msg.rr_fileinfo.err){\n msg.payload.fileSize = msg.rr_fileinfo.size;\n msg.payload.fileLastModified = msg.rr_fileinfo.lastModified;\n msg.payload.fileName = msg.rr_fileinfo.fileName;\n} else {\n msg.payload.fileSize = null;\n msg.payload.fileLastModified = null;\n msg.payload.fileName = null;\n}\n\n//var ping = flow.get(\"ping\");\nif (flow.get(\"ping\")){\n msg.payload.online = \"Online\";\n} else {\n msg.payload.online = \"Offline\";\n}\n\n// remove all other objects\ndelete msg.rr_statusType3;\ndelete msg.rr_fileinfo;\ndelete msg.redirectList;\n\nreturn msg;","outputs":1,"noerr":0,"x":1080,"y":840,"wires":[["c9b09de7.588268","7b6ccf9c.39da"]]},{"id":"c9b09de7.588268","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1190,"y":880,"wires":[]},{"id":"2063141d.dc2414","type":"inject","z":"e411fa50.6266e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":880,"wires":[["1b9d6f9c.011fa8"]]},{"id":"cc2f6a2c.a2d248","type":"link out","z":"e411fa50.6266e8","name":"","links":["201825be.b0348a"],"x":1455,"y":800,"wires":[]},{"id":"d412e017.187ce","type":"function","z":"e411fa50.6266e8","name":"Format JSON String","func":"var duet = \"duet/\";\nvar name = \"BLVmgn\";\n\n// topic: duet/BLV mgn\nmsg.topic = duet + name;\n\n// payload.name: \"BLV mgn\"\n// firmware: \"RepRapFirmware for Duet 2 WiFi/Ethernet\"\n// geometry: \"coreXY\"\n// voltage: 23.9\n\nmsg.payload = {};\n\nmsg.payload.online = \"Offline\"\nmsg.payload.statePrinter = 0\nflow.set('statusPrevious', 0); //store statusPrevious flow variable\n\n// remove all other objects\ndelete msg.rr_statusType3;\ndelete msg.rr_fileinfo\ndelete msg.redirectList;\n\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":1180,"wires":[["de4a7cba.67d178","dfc05cc5.12501"]]},{"id":"de4a7cba.67d178","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":490,"y":1140,"wires":[]},{"id":"dfc05cc5.12501","type":"link out","z":"e411fa50.6266e8","name":"","links":["201825be.b0348a"],"x":575,"y":1180,"wires":[]},{"id":"fc2d450b.7fc198","type":"link in","z":"e411fa50.6266e8","name":"Duet Outgoing - BLV mgn - Update Once When Down","links":["1e3f6153.348767"],"x":235,"y":1120,"wires":[["d412e017.187ce"]]},{"id":"7b6ccf9c.39da","type":"function","z":"e411fa50.6266e8","name":"Create msg.payload.statePrinter","func":"//\n// statusRaw Key\n// I Idle\n// P Printing from SD card\n// S Stopped\n// C Running Config File\n// A Paused\n// D Pausing\n// R Resuming from a pause\n// B Busy\n// F Performing firmware update\n\n// 0 Offline\n// 1 Idle\n// 2 Loading Filament\n// 3 Finished Printing\n// 4 Filament Loaded\n// 5 Printing\n// 6 Paused - Was Printing\n// 7 Paused\n// 8 Printing - Was Paused\n\n//\nvar statusPrevious = flow.get('statusPrevious') || \"\"; //create statusPrevious flow variable\nvar loadingFilament = flow.get('loadingFilament') || \"\"; //create loadingFilament flow variable\nvar statusNow = msg.payload.statusRaw;\nvar ping = flow.get(\"ping\") || false;\n\n// save statusPrevious if empty\nif (statusPrevious === null) {\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n msg.payload.statePrinter = statusNow\n}\n\n// if print filename present\nelse if (msg.payload.fileName){\n \n // does filename include filament_load and is statusNow Printing?\n if (msg.payload.fileName.includes(\"filament_load\") && statusNow == \"P\") {\n //msg.payload.statePrinter = \"Loading Filament\"\n msg.payload.statePrinter = 2\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n flow.set('loadingFilament', true); //store loadingFilament flow variable\n }\n \n // now paused, was printing\n else if (statusNow === \"S\" && statusPrevious === \"P\"){\n //msg.payload.statePrinter = \"Paused - Was Printing\"\n msg.payload.statePrinter = 6\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n }\n \n // now printing, was paused\n else if (statusNow === \"P\" && statusPrevious === \"S\"){\n //msg.payload.statePrinter = \"Printing - Was Paused\"\n msg.payload.statePrinter = 8\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n }\n \n // now printing\n else if (statusNow === \"P\") {\n //msg.payload.statePrinter = \"Printing\"\n msg.payload.statePrinter = 5\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n }\n \n // now printing\n else if (statusNow === \"S\") {\n //msg.payload.statePrinter = \"Paused\"\n msg.payload.statePrinter = 7\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n }\n}\n\n// if busy, no change\nelse if (statusNow == \"B\") {\n flow.set('statusPrevious', statusPrevious); //store statusPrevious flow variable\n}\n\n// status is updated\nelse if (statusNow !== statusPrevious) {\n \n // now idle, was printing, loading filament true\n if (statusNow === \"I\" && statusPrevious === \"P\" && loadingFilament ){\n //msg.payload.statePrinter = \"Filament Loaded\"\n msg.payload.statePrinter = 4\n flow.set('loadingFilament', false); //store loadingFilament flow variable\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n }\n \n // now idle, was printing\n else if (statusNow === \"I\" && statusPrevious === \"P\"){\n //msg.payload.statePrinter = \"Finished Printing\"\n msg.payload.statePrinter = 3\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n }\n \n else if (statusNow === \"I\"){\n //msg.payload.statePrinter = \"Idle\"\n msg.payload.statePrinter = 1\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n \n }\n}\n\nelse if (statusNow == \"I\") {\n //msg.payload.statePrinter = \"Idle\"\n msg.payload.statePrinter = 1\n flow.set('statusPrevious', statusNow); //store statusPrevious flow variable\n}\n \nelse { \n \n // no change\n var statePrinter = flow.get('statePrinter') || \"\"; //create statePrinter flow variable\n msg.payload.statePrinter = statePrinter\n}\n\n//msg.payload = \"\"\nreturn msg;","outputs":1,"noerr":0,"x":1250,"y":800,"wires":[["ca2e35c.2471cc8","bf09cedf.3fb67"]]},{"id":"ca2e35c.2471cc8","type":"debug","z":"e411fa50.6266e8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1410,"y":760,"wires":[]},{"id":"bf09cedf.3fb67","type":"rbe","z":"e411fa50.6266e8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1390,"y":840,"wires":[["cc2f6a2c.a2d248"]]},{"id":"83ebccdc.c8317","type":"mqtt-broker","z":"","name":"HomeSeer (mosquitto)","broker":"192.168.8.2","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"undefined/NetworkPi/LWT","birthQos":"0","birthRetain":"false","birthPayload":"Online","closeTopic":"","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]