[ { "id": "50927f2afa2de4c4", "type": "tab", "label": "Flow 8", "disabled": false, "info": "", "env": [] }, { "id": "7f6d1af6894babf4", "type": "receiver-state", "z": "50927f2afa2de4c4", "name": "", "x": 820, "y": 300, "wires": [] }, { "id": "089f3132cb53fa42", "type": "inject", "z": "50927f2afa2de4c4", "name": "Set status 3", "props": [ { "p": "command", "v": "set", "vt": "str" }, { "p": "blockName", "v": "RFStatus", "vt": "str" }, { "p": "Flags", "v": "3", "vt": "num" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 370, "y": 360, "wires": [ [ "f49fd6a36f15ecad" ] ] }, { "id": "48d8a8730279cf6b", "type": "inject", "z": "50927f2afa2de4c4", "name": "Set status 0", "props": [ { "p": "command", "v": "set", "vt": "str" }, { "p": "blockName", "v": "RFStatus", "vt": "str" }, { "p": "Flags", "v": "0", "vt": "num" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 370, "y": 400, "wires": [ [ "f49fd6a36f15ecad" ] ] }, { "id": "7a786e8c3561c9e9", "type": "inject", "z": "50927f2afa2de4c4", "name": "Clear", "props": [ { "p": "command", "v": "clear", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 390, "y": 440, "wires": [ [ "f49fd6a36f15ecad" ] ] }, { "id": "f49fd6a36f15ecad", "type": "packet-replacer", "z": "50927f2afa2de4c4", "name": "", "initialRules": [], "x": 600, "y": 300, "wires": [ [ "7f6d1af6894babf4", "0a37e745adfb6288" ], [] ] }, { "id": "0a37e745adfb6288", "type": "function", "z": "50927f2afa2de4c4", "name": "To priority", "func": "if (msg.blockName == \"RFStatus\") {\n const flags = msg.block[\"Flags\"]\n let priority = 0;\n\n if (flags & 0b01) {\n priority -= 1;\n }\n\n if (flags & 0b10) {\n priority -= 1;\n }\n\n const msg_priority = {\n \"_parsed_by\": msg._parsed_by,\n \"command\": \"set\",\n \"priority\": priority\n }\n\n return [[msg_priority, msg]];\n}\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 800, "y": 260, "wires": [ [ "5bdace5ad5185194" ] ] }, { "id": "dae7d5fd522c7d00", "type": "receiver-state", "z": "50927f2afa2de4c4", "name": "", "x": 1280, "y": 400, "wires": [] }, { "id": "2d2092f96deffdda", "type": "receiver-state", "z": "50927f2afa2de4c4", "name": "", "x": 820, "y": 540, "wires": [] }, { "id": "95ec3b30bf082ab0", "type": "packet-replacer", "z": "50927f2afa2de4c4", "name": "", "initialRules": [], "x": 600, "y": 500, "wires": [ [ "2d2092f96deffdda", "8bd01bf2ea161f1d" ], [] ] }, { "id": "5bdace5ad5185194", "type": "bottleneck", "z": "50927f2afa2de4c4", "name": "", "allowMultiple": false, "x": 1070, "y": 360, "wires": [ [ "dae7d5fd522c7d00", "bb02f508a3e73018" ] ] }, { "id": "8bd01bf2ea161f1d", "type": "function", "z": "50927f2afa2de4c4", "name": "To priority", "func": "if (msg.blockName == \"RFStatus\") {\n const flags = msg.block[\"Flags\"]\n let priority = 0;\n\n if (flags & 0b01) {\n priority -= 1;\n }\n\n if (flags & 0b10) {\n priority -= 1;\n }\n\n const msg_priority = {\n \"_parsed_by\": msg._parsed_by,\n \"command\": \"set\",\n \"priority\": priority\n }\n\n return [[msg_priority, msg]];\n}\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 800, "y": 500, "wires": [ [ "5bdace5ad5185194" ] ] }, { "id": "b9dc1bcd01f8fd3e", "type": "sbf-parser", "z": "50927f2afa2de4c4", "name": "", "parser_name": "right", "x": 380, "y": 300, "wires": [ [ "f49fd6a36f15ecad" ] ] }, { "id": "1dead4ec4e10ae04", "type": "sbf-parser", "z": "50927f2afa2de4c4", "name": "", "parser_name": "left", "x": 380, "y": 500, "wires": [ [ "95ec3b30bf082ab0" ] ] }, { "id": "bb02f508a3e73018", "type": "serial out", "z": "50927f2afa2de4c4", "name": "", "serial": "a4af84c748f60b76", "x": 1260, "y": 340, "wires": [] }, { "id": "a948b2c19163b88c", "type": "serial in", "z": "50927f2afa2de4c4", "name": "Mosaic Left Side", "serial": "d56a1d37b95bd5ba", "x": 160, "y": 500, "wires": [ [ "1dead4ec4e10ae04" ] ] }, { "id": "129a9bee6f29d3e6", "type": "serial in", "z": "50927f2afa2de4c4", "name": "Mosaic Right Side", "serial": "d56a1d37b95bd5ba", "x": 170, "y": 300, "wires": [ [ "b9dc1bcd01f8fd3e" ] ] }, { "id": "84175e328befa2f9", "type": "inject", "z": "50927f2afa2de4c4", "name": "Set status 3", "props": [ { "p": "command", "v": "set", "vt": "str" }, { "p": "blockName", "v": "RFStatus", "vt": "str" }, { "p": "Flags", "v": "3", "vt": "num" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 370, "y": 580, "wires": [ [ "95ec3b30bf082ab0" ] ] }, { "id": "0a5bb48416403d13", "type": "inject", "z": "50927f2afa2de4c4", "name": "Set status 0", "props": [ { "p": "command", "v": "set", "vt": "str" }, { "p": "blockName", "v": "RFStatus", "vt": "str" }, { "p": "Flags", "v": "0", "vt": "num" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 370, "y": 620, "wires": [ [ "95ec3b30bf082ab0" ] ] }, { "id": "38d1981a6505798e", "type": "inject", "z": "50927f2afa2de4c4", "name": "Clear", "props": [ { "p": "command", "v": "clear", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 390, "y": 660, "wires": [ [ "95ec3b30bf082ab0" ] ] }, { "id": "a4af84c748f60b76", "type": "serial-port", "name": "Computer", "serialport": "/dev/ttyUSB0", "serialbaud": "115200", "databits": 8, "parity": "none", "stopbits": 1, "waitfor": "", "dtr": "none", "rts": "none", "cts": "none", "dsr": "none", "newline": "\\n", "bin": "false", "out": "char", "addchar": "", "responsetimeout": 10000 }, { "id": "d56a1d37b95bd5ba", "type": "serial-port", "name": "Mosaic ACM0", "serialport": "/dev/ttyACM0", "serialbaud": "115200", "databits": 8, "parity": "none", "stopbits": 1, "waitfor": "", "dtr": "none", "rts": "none", "cts": "none", "dsr": "none", "newline": "", "bin": "bin", "out": "count", "addchar": "", "responsetimeout": 10000 } ]