[ { "id": "1112a3ea.54efdc", "type": "tab", "label": "ZigBee Admin", "disabled": false, "info": "" }, { "id": "cd18862.f347778", "type": "ui_button", "z": "1112a3ea.54efdc", "name": "", "group": "c2461909.a73be8", "order": 1, "width": 0, "height": 0, "passthru": true, "label": "Refresh Device List", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 650, "y": 200, "wires": [["7cb3ca31.7a86e4"]] }, { "id": "5d5263c6.4f433c", "type": "mqtt out", "z": "1112a3ea.54efdc", "name": "", "topic": "", "qos": "", "retain": "", "broker": "f6b79a88.16cef8", "x": 850, "y": 580, "wires": [] }, { "id": "962aa5c5.31faf8", "type": "mqtt in", "z": "1112a3ea.54efdc", "name": "", "topic": "zigbee2mqtt/bridge/config/devices", "qos": "2", "datatype": "auto", "broker": "f6b79a88.16cef8", "x": 180, "y": 100, "wires": [["92e8272f.0badc8"]] }, { "id": "4fdf8115.9db9f", "type": "ui_list", "z": "1112a3ea.54efdc", "group": "c2461909.a73be8", "name": "", "order": 2, "width": "12", "height": "12", "lineType": "three", "actionType": "click", "allowHTML": true, "outputs": 1, "topic": "", "x": 690, "y": 100, "wires": [["4ca5cd33.85ccc4"]] }, { "id": "9e1ba0c0.58111", "type": "function", "z": "1112a3ea.54efdc", "name": "", "func": "list = [];\nicons = {\n 'Coordinator': 'fa-wifi',\n 'Router': 'fa-arrows-alt',\n 'EndDevice': 'fa-circle'\n};\nimageRoot = '/images/'\nimages = {\n 'E1743': 'dimmer.png',\n 'AB3257001NJ': 'OSRAM_Smart-Plug.png',\n 'LED1836G9': 'led1836g9.png',\n 'RTCGQ01LM': 'Xaomi_move.png'\n}\nmsg.payload.forEach(function(device){\n item = { \n title: device.friendly_name + ' (' + device.ieeeAddr + ')',\n icon_name: 'fa-circle',\n description: ''\n };\n if (images.hasOwnProperty(device.model)) {\n delete item.icon_name;\n item.icon = imageRoot + images[device.model];\n } else if (icons.hasOwnProperty(device.type)) {\n item.icon_name = icons[device.type];\n }\n if (device.type != 'Coordinator') {\n item.description +=\n device.vendor + ' ' + \n device.description + ' ' +\n device.model + ', ';\n item.menu = [\n 'Rename',\n 'Delete'\n ];\n }\n item.description += 'Last seen: ' + dtString(device.lastSeen)\n list.push(item);\n});\nreturn {payload: list.sort((a,b) => a.title > b.title ? 1 : -1)};\n\nfunction dtString(timestamp){\n date = new Date(timestamp);\n return date.toLocaleDateString()+' '+date.toLocaleTimeString();\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 540, "y": 100, "wires": [["4fdf8115.9db9f"]] }, { "id": "92e8272f.0badc8", "type": "json", "z": "1112a3ea.54efdc", "name": "", "property": "payload", "action": "", "pretty": false, "x": 390, "y": 100, "wires": [["9e1ba0c0.58111"]] }, { "id": "489eb11f.8574a", "type": "ui_button", "z": "1112a3ea.54efdc", "name": "", "group": "241ead91.463d32", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "Rename", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "zigbee2mqtt/bridge/config/rename", "x": 100, "y": 260, "wires": [["360e53c6.6f2ddc"]] }, { "id": "25195620.d91b4a", "type": "ui_text_input", "z": "1112a3ea.54efdc", "name": "", "label": "Old Name", "tooltip": "", "group": "241ead91.463d32", "order": 1, "width": 0, "height": 0, "passthru": true, "mode": "text", "delay": 300, "topic": "", "x": 500, "y": 380, "wires": [["d2c9b4c9.23f828"]] }, { "id": "401a3b8.af5c8c4", "type": "ui_text_input", "z": "1112a3ea.54efdc", "name": "", "label": "New Name", "tooltip": "", "group": "241ead91.463d32", "order": 2, "width": 0, "height": 0, "passthru": true, "mode": "text", "delay": 300, "topic": "", "x": 490, "y": 320, "wires": [["f27ec69f.c469d8"]] }, { "id": "4ca5cd33.85ccc4", "type": "function", "z": "1112a3ea.54efdc", "name": "selected friendly_name", "func": "msg1 = {payload: msg.payload.title.replace(/ \\(.*/,'')};\nmsg2 = {payload: \"zigbee2mqtt/\" + msg1.payload};\nreturn [msg1,msg2];", "outputs": 2, "noerr": 0, "initialize": "", "finalize": "", "x": 890, "y": 100, "wires": [["7f939970.53b218"], ["32f00dae.3da5d2"]] }, { "id": "d2c9b4c9.23f828", "type": "function", "z": "1112a3ea.54efdc", "name": "flow.set", "func": "flow.set(\"oldName\", msg.payload);\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 680, "y": 380, "wires": [[]] }, { "id": "f27ec69f.c469d8", "type": "function", "z": "1112a3ea.54efdc", "name": "flow.set", "func": "flow.set(\"newName\",msg.payload);\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 680, "y": 320, "wires": [[]] }, { "id": "360e53c6.6f2ddc", "type": "function", "z": "1112a3ea.54efdc", "name": "payload", "func": "msg.payload=JSON.stringify({\n \"old\":flow.get(\"oldName\"), \n \"new\":flow.get(\"newName\")\n});\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 260, "y": 260, "wires": [["f1283f5.c6756c", "eda28ddc.cc2"]] }, { "id": "f1283f5.c6756c", "type": "mqtt out", "z": "1112a3ea.54efdc", "name": "", "topic": "zigbee2mqtt/bridge/config/rename", "qos": "", "retain": "", "broker": "f6b79a88.16cef8", "x": 940, "y": 260, "wires": [] }, { "id": "6377a4c3.c4ea5c", "type": "inject", "z": "1112a3ea.54efdc", "name": "", "props": [{ "p": "payload" }, { "p": "topic", "vt": "str" }], "repeat": "", "crontab": "", "once": true, "onceDelay": "2", "topic": "", "payload": "", "payloadType": "str", "x": 120, "y": 320, "wires": [["401a3b8.af5c8c4"]] }, { "id": "eda28ddc.cc2", "type": "delay", "z": "1112a3ea.54efdc", "name": "", "pauseType": "delay", "timeout": "1", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 460, "y": 200, "wires": [["cd18862.f347778"]] }, { "id": "1f26781f.7d0968", "type": "ui_dropdown", "z": "1112a3ea.54efdc", "name": "", "label": "Join", "tooltip": "", "place": "Select option", "group": "7b37feaf.b63ae", "order": 7, "width": 0, "height": 0, "passthru": true, "multiple": false, "options": [ { "label": "Permit", "value": true, "type": "bool" }, { "label": "Deny", "value": false, "type": "bool" } ], "payload": "", "topic": "", "x": 110, "y": 680, "wires": [["69bca007.01b0b"]] }, { "id": "69bca007.01b0b", "type": "function", "z": "1112a3ea.54efdc", "name": "payload", "func": "flow.set(\"permit_join\", msg.payload);\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 280, "y": 680, "wires": [["178a8d6d.a5de03"]] }, { "id": "178a8d6d.a5de03", "type": "mqtt out", "z": "1112a3ea.54efdc", "name": "", "topic": "zigbee2mqtt/bridge/config/permit_join", "qos": "", "retain": "", "broker": "f6b79a88.16cef8", "x": 930, "y": 680, "wires": [] }, { "id": "5d546b89.766614", "type": "mqtt in", "z": "1112a3ea.54efdc", "name": "", "topic": "zigbee2mqtt/#", "qos": "2", "datatype": "auto", "broker": "f6b79a88.16cef8", "x": 130, "y": 800, "wires": [["96643743.c8e588"]] }, { "id": "96643743.c8e588", "type": "function", "z": "1112a3ea.54efdc", "name": "", "func": " topic = msg.topic.replace('zigbee2mqtt/','');\n time = (new Date()).toLocaleTimeString();\n header = \"