diff --git a/Flows_MQTT.json b/Flows_MQTT.json new file mode 100644 index 0000000000000000000000000000000000000000..84c7e99242499b2ab6113509028664107c4d92fe --- /dev/null +++ b/Flows_MQTT.json @@ -0,0 +1,535 @@ +[ + { + "id": "d8a10b909648bdec", + "type": "tab", + "label": "Flow 2", + "disabled": true, + "info": "", + "env": [] + }, + { + "id": "82004a1cb265525c", + "type": "mqtt in", + "z": "d8a10b909648bdec", + "name": "", + "topic": "DHHZ/024/MiddleArea/Motion2", + "qos": "1", + "datatype": "json", + "broker": "a68f63d3c055fb46", + "nl": false, + "rap": true, + "rh": 0, + "inputs": 0, + "x": 210, + "y": 320, + "wires": [ + [ + "9d4904ef4a2c61a7" + ] + ] + }, + { + "id": "9d4904ef4a2c61a7", + "type": "function", + "z": "d8a10b909648bdec", + "name": "", + "func": "if (msg.payload.occupancy == false) {\n msg.payload = 0;\n node.send(msg);\n}\n\n\nelse {\n msg.payload = 1;\n node.send(msg);\n}\n\nreturn null;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 440, + "y": 320, + "wires": [ + [ + "a51f367f3a4cac76" + ] + ] + }, + { + "id": "a51f367f3a4cac76", + "type": "switch", + "z": "d8a10b909648bdec", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "1", + "vt": "num" + }, + { + "t": "eq", + "v": "0", + "vt": "num" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 610, + "y": 320, + "wires": [ + [ + "1a8b3396aece6e4a", + "3b26b544ece35731" + ], + [ + "1a8b3396aece6e4a" + ] + ] + }, + { + "id": "1a8b3396aece6e4a", + "type": "trigger", + "z": "d8a10b909648bdec", + "name": "", + "op1": "", + "op2": "", + "op1type": "nul", + "op2type": "payl", + "duration": "15", + "extend": false, + "overrideDelay": false, + "units": "min", + "reset": "1", + "bytopic": "all", + "topic": "topic", + "outputs": 1, + "x": 630, + "y": 400, + "wires": [ + [ + "51b35ccc60efd508", + "9a72b5b4f8472ce5" + ] + ] + }, + { + "id": "3b26b544ece35731", + "type": "rbe", + "z": "d8a10b909648bdec", + "name": "", + "func": "rbe", + "gap": "", + "start": "", + "inout": "out", + "septopics": false, + "property": "payload", + "topi": "topic", + "x": 990, + "y": 440, + "wires": [ + [ + "8eb998f43095d394" + ] + ] + }, + { + "id": "24017a1058219ba1", + "type": "ui_toast", + "z": "d8a10b909648bdec", + "position": "top right", + "displayTime": "30", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "lightMsg", + "topic": "", + "name": "", + "x": 1480, + "y": 300, + "wires": [] + }, + { + "id": "8eb998f43095d394", + "type": "switch", + "z": "d8a10b909648bdec", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "1", + "vt": "num" + }, + { + "t": "eq", + "v": "0", + "vt": "num" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 990, + "y": 340, + "wires": [ + [ + "73f8f838f150d878", + "dcad29a7dccc9d4d" + ], + [ + "b86ce13afc985145", + "dcad29a7dccc9d4d" + ] + ] + }, + { + "id": "a604ca064397abc9", + "type": "ui_text", + "z": "d8a10b909648bdec", + "group": "c4234e7f95b0f351", + "order": 0, + "width": 0, + "height": 0, + "name": "", + "label": "Recommendation", + "format": "{{msg.payload}}", + "layout": "col-center", + "className": "", + "x": 1490, + "y": 380, + "wires": [] + }, + { + "id": "041a6e4296d5f979", + "type": "ui_toast", + "z": "d8a10b909648bdec", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "Yes", + "cancel": "Close Dialog Window", + "raw": false, + "className": "", + "topic": "", + "name": "", + "x": 630, + "y": 560, + "wires": [ + [ + "2946cfe9136e5eb5" + ] + ] + }, + { + "id": "51b35ccc60efd508", + "type": "stoptimer", + "z": "d8a10b909648bdec", + "duration": "1", + "units": "Minute", + "payloadtype": "num", + "payloadval": "", + "name": "", + "x": 1020, + "y": 540, + "wires": [ + [ + "3b26b544ece35731", + "082c8be9dfe11afe" + ], + [ + "3b26b544ece35731" + ] + ] + }, + { + "id": "9a72b5b4f8472ce5", + "type": "change", + "z": "d8a10b909648bdec", + "name": "", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Is someone in the room?", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 640, + "y": 480, + "wires": [ + [ + "041a6e4296d5f979" + ] + ] + }, + { + "id": "2946cfe9136e5eb5", + "type": "function", + "z": "d8a10b909648bdec", + "name": "", + "func": "//only accept OK button\nif (msg.payload == 'Yes') {\n msg.payload = 1;\n node.send(msg);\n\n}\nreturn null;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 620, + "y": 640, + "wires": [ + [ + "5778681bb9d43509", + "3b26b544ece35731" + ] + ] + }, + { + "id": "5778681bb9d43509", + "type": "change", + "z": "d8a10b909648bdec", + "name": "", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "stop", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 640, + "y": 720, + "wires": [ + [ + "51b35ccc60efd508" + ] + ] + }, + { + "id": "082c8be9dfe11afe", + "type": "function", + "z": "d8a10b909648bdec", + "name": "", + "func": "//send empty string to dialog\nif (msg.payload == '') {\n msg.payload= msg.value;\n node.send(msg);\n}\nreturn null;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1000, + "y": 640, + "wires": [ + [ + "041a6e4296d5f979" + ] + ] + }, + { + "id": "73f8f838f150d878", + "type": "change", + "z": "d8a10b909648bdec", + "name": "", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Motion detected", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1220, + "y": 300, + "wires": [ + [ + "a604ca064397abc9", + "24017a1058219ba1" + ] + ] + }, + { + "id": "b86ce13afc985145", + "type": "change", + "z": "d8a10b909648bdec", + "name": "", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "no motion, switch off the lights", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1220, + "y": 380, + "wires": [ + [ + "24017a1058219ba1", + "a604ca064397abc9" + ] + ] + }, + { + "id": "bbef351c4bb058b7", + "type": "change", + "z": "d8a10b909648bdec", + "name": "", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1440, + "y": 460, + "wires": [ + [ + "a604ca064397abc9" + ] + ] + }, + { + "id": "a015dcdc8eba749a", + "type": "ui_button", + "z": "d8a10b909648bdec", + "name": "", + "group": "c4234e7f95b0f351", + "order": 1, + "width": 0, + "height": 0, + "passthru": false, + "label": "Reset Motion Tracking", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "true", + "payloadType": "bool", + "topic": "topic", + "topicType": "msg", + "x": 1440, + "y": 520, + "wires": [ + [ + "bbef351c4bb058b7" + ] + ] + }, + { + "id": "1367a1bc8a3102a0", + "type": "comment", + "z": "d8a10b909648bdec", + "name": "DEMO MQTT", + "info": "", + "x": 130, + "y": 60, + "wires": [] + }, + { + "id": "dcad29a7dccc9d4d", + "type": "ui_led", + "z": "d8a10b909648bdec", + "order": 6, + "group": "c4234e7f95b0f351", + "width": 0, + "height": 0, + "label": "", + "labelPlacement": "right", + "labelAlignment": "left", + "colorForValue": [ + { + "color": "#ff0000", + "value": "0", + "valueType": "num" + }, + { + "color": "#008000", + "value": "1", + "valueType": "num" + } + ], + "allowColorForValueInMessage": false, + "shape": "circle", + "showGlow": true, + "name": "", + "x": 1190, + "y": 440, + "wires": [] + }, + { + "id": "a68f63d3c055fb46", + "type": "mqtt-broker", + "name": "", + "broker": "broker.digitalhhz.smartlab.local", + "port": "1883", + "clientid": "", + "autoConnect": true, + "usetls": false, + "protocolVersion": "4", + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "birthMsg": {}, + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "closeMsg": {}, + "willTopic": "", + "willQos": "0", + "willPayload": "", + "willMsg": {}, + "sessionExpiry": "" + }, + { + "id": "c4234e7f95b0f351", + "type": "ui_group", + "name": "Recommendation for light control", + "tab": "9a767a6f4dda0c97", + "order": 2, + "disp": true, + "width": "6", + "collapse": false, + "className": "" + }, + { + "id": "9a767a6f4dda0c97", + "type": "ui_tab", + "name": "HHZ Motion Detection", + "icon": "mi-directions_walk", + "disabled": false, + "hidden": false + } +] \ No newline at end of file