[ { "id": "539047f7be891c5b", "type": "tab", "label": "Olock Config", "disabled": false, "info": "" }, { "id": "1ad2b2282e1c81d2", "type": "mqtt in", "z": "539047f7be891c5b", "name": "", "topic": "alive", "qos": "2", "datatype": "auto", "broker": "d673318d.98d7b", "nl": false, "rap": false, "inputs": 0, "x": 90, "y": 80, "wires": [ [ "5206d33d53c49d75" ] ] }, { "id": "b6458e89decce262", "type": "ui_text", "z": "539047f7be891c5b", "group": "6a51d5054241a0c1", "order": 0, "width": 0, "height": 0, "name": "Последно устройство", "label": "Последно устройство", "format": "{{msg.payload}}", "layout": "col-center", "x": 820, "y": 200, "wires": [] }, { "id": "565d92376fedc262", "type": "function", "z": "539047f7be891c5b", "name": "", "func": "var mac=msg.payload.split('/')[0];\nmsg.payload=mac;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 460, "y": 160, "wires": [ [ "b6458e89decce262", "21dee48c65e6dee0", "277e6e6774c4a62c", "a4975979e3333430" ] ] }, { "id": "2aa8543fcf94605d", "type": "debug", "z": "539047f7be891c5b", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1050, "y": 340, "wires": [] }, { "id": "21dee48c65e6dee0", "type": "ui_form", "z": "539047f7be891c5b", "name": "Конфигуриране на устройство", "label": "Параметри на устройството", "group": "6a51d5054241a0c1", "order": 1, "width": 0, "height": 0, "options": [ { "label": "Номер на стая", "value": "room", "type": "number", "required": true, "rows": null }, { "label": "Номер на група", "value": "group", "type": "number", "required": false, "rows": null }, { "label": "Номер на хотел", "value": "hotel_code", "type": "number", "required": false, "rows": null }, { "label": "MAC", "value": "device_mac", "type": "text", "required": false, "rows": null } ], "formValue": { "room": "", "group": "", "hotel_code": "", "device_mac": "" }, "payload": "", "submit": "Изпращане", "cancel": "Отказ", "topic": "topic", "topicType": "msg", "splitLayout": "", "className": "", "x": 650, "y": 280, "wires": [ [ "0471f28bd19aa3b4" ] ] }, { "id": "277e6e6774c4a62c", "type": "change", "z": "539047f7be891c5b", "name": "", "rules": [ { "t": "set", "p": "device", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 800, "y": 140, "wires": [ [ "ca34c0ed2bf72f5e" ] ] }, { "id": "0471f28bd19aa3b4", "type": "change", "z": "539047f7be891c5b", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "device", "tot": "flow" }, { "t": "set", "p": "payload.hotel_code", "pt": "msg", "to": "4", "tot": "str" }, { "t": "set", "p": "payload.group", "pt": "msg", "to": "1", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 560, "y": 420, "wires": [ [ "2aa8543fcf94605d", "c32044d8ea0afed3", "7919e726923797ef", "24e950619ffaff9b" ] ] }, { "id": "ca34c0ed2bf72f5e", "type": "debug", "z": "539047f7be891c5b", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1030, "y": 140, "wires": [] }, { "id": "c32044d8ea0afed3", "type": "mqtt out", "z": "539047f7be891c5b", "name": "", "topic": "", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "d673318d.98d7b", "x": 1090, "y": 480, "wires": [] }, { "id": "a4975979e3333430", "type": "ui_toast", "z": "539047f7be891c5b", "position": "top right", "displayTime": "3", "highlight": "", "sendall": true, "outputs": 0, "ok": "OK", "cancel": "", "raw": false, "topic": "", "name": "", "x": 800, "y": 60, "wires": [] }, { "id": "7919e726923797ef", "type": "delay", "z": "539047f7be891c5b", "name": "", "pauseType": "delay", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "outputs": 1, "x": 720, "y": 600, "wires": [ [ "1aa594ada18b12ba" ] ] }, { "id": "1aa594ada18b12ba", "type": "change", "z": "539047f7be891c5b", "name": "go sleep", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "sleep/100", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 910, "y": 620, "wires": [ [ "c32044d8ea0afed3" ] ] }, { "id": "e5dca44a4ce5f8a2", "type": "debug", "z": "539047f7be891c5b", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 510, "y": 60, "wires": [] }, { "id": "5206d33d53c49d75", "type": "switch", "z": "539047f7be891c5b", "name": "filter new room", "property": "payload", "propertyType": "msg", "rules": [ { "t": "cont", "v": "/1/", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 260, "y": 120, "wires": [ [ "565d92376fedc262", "e5dca44a4ce5f8a2" ] ] }, { "id": "24e950619ffaff9b", "type": "function", "z": "539047f7be891c5b", "d": true, "name": "", "func": "if(!msg.payload.device_mac.equals(\"\"));\nmsg.topic=msg.payload.device_mac;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 480, "y": 500, "wires": [ [ "41b12da5160d9187" ] ] }, { "id": "41b12da5160d9187", "type": "debug", "z": "539047f7be891c5b", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 690, "y": 700, "wires": [] }, { "id": "d673318d.98d7b", "type": "mqtt-broker", "name": "Local", "broker": "localhost", "port": "1883", "clientid": "", "autoConnect": true, "usetls": false, "compatmode": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "sessionExpiry": "" }, { "id": "6a51d5054241a0c1", "type": "ui_group", "name": "Конфигурация", "tab": "9335e53ea3f94ae1", "order": 4, "disp": true, "width": "6", "collapse": false, "className": "" }, { "id": "9335e53ea3f94ae1", "type": "ui_tab", "name": "Конфигурация", "icon": "dashboard", "order": 2, "disabled": false, "hidden": false } ]