Skip to content

Instantly share code, notes, and snippets.

@mhelff

mhelff/README.md Secret

Last active August 16, 2023 13:30
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save mhelff/1f1c0dde4ff193e5c14d5b99442a7d00 to your computer and use it in GitHub Desktop.
Save mhelff/1f1c0dde4ff193e5c14d5b99442a7d00 to your computer and use it in GitHub Desktop.
Z2M Admin Panel

Node-Red-Dashboard web interface for controlling Zigbee2MQTT

Heavly inspired by Zigbee2MQTT Admin Panel

Features:

  • List all paired devices
  • Show device details including HW and SW version if available
  • Show last message from device
  • Rename devices
  • Remove devices
  • Add/Remove devices to groups
  • Bind/Unbind devices (typically dimmers to bulbs)
  • Manage groups (create/delete groups)
  • Trigger generate network map
  • Show network map in dashboard, select graphviz rendering type
  • Popup notifications indicating device pairing status (if pairing devices).
  • Set permit join
  • Set logging level

Instructions:

After importing the flow the following nodes in the upper area of the flow must be edited:

  • Adjust the MQTT server in the two MQTT nodes

Screenshot of admin panel: Admin panel

Screenshot of network map: Network map

[{"id":"1112a3ea.54efdc","type":"tab","label":"Z2M Admin","disabled":false,"info":""},{"id":"fe321b77.50b858","type":"function","z":"1112a3ea.54efdc","name":"Format Data","func":"var groupname = flow.get('groupname');\nvar device = flow.get('device');\n\nif (typeof groupname !== undefined && typeof device !== undefined) {\n var action = \"Adding \";\n var what = \" to group \";\n if(msg.payload == \"remove\") {\n action = \"Removing \";\n what = \" from group \";\n }\nvar msg1 = { payload: device, topic: \"zigbee2mqtt/bridge/group/\" + groupname + \"/\" + msg.payload};\nvar msg2 = { payload: action + \" \" + device + what + groupname };\n\nreturn [msg1, msg2];\n}","outputs":2,"noerr":0,"x":770,"y":1920,"wires":[["67f130eb.efef3"],["89490386.cf438"]]},{"id":"22d38d69.8b8e12","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"38009ddc.858562","order":9,"width":"3","height":"1","passthru":false,"label":"Add to group","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Add","payloadType":"str","topic":"","x":110,"y":1900,"wires":[["463d3907.451408"]]},{"id":"89490386.cf438","type":"ui_toast","z":"1112a3ea.54efdc","position":"top right","displayTime":"5","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"System Notification","name":"","x":810,"y":1980,"wires":[]},{"id":"d7c7c87a.3b1e58","type":"comment","z":"1112a3ea.54efdc","name":"Group management","info":"","x":130,"y":1460,"wires":[]},{"id":"fae942d1.d6e91","type":"function","z":"1112a3ea.54efdc","name":"Format Data","func":"var srcdev = flow.get('device');\nvar bindtarget = flow.get('bindtarget');\n\nif (typeof srcdev !== undefined && typeof bindtarget !== undefined) {\n msg1 = { 'payload': bindtarget, 'topic': 'zigbee2mqtt/bridge/' + msg.payload + '/' + srcdev};\n msg2 = { 'payload': msg.payload + ' ' + srcdev + ' to target ' + bindtarget };\n\n return [msg1, msg2];\n}","outputs":2,"noerr":0,"x":750,"y":2260,"wires":[["bf8faaff.5215b8"],["a7b346c6.0c9d18"]]},{"id":"a29bad1b.88ab","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"38009ddc.858562","order":13,"width":"3","height":"1","passthru":false,"label":"Bind device","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Bind","payloadType":"str","topic":"","x":110,"y":2240,"wires":[["4d02aaf3.2fbb24"]]},{"id":"1352a9c5.0a7b96","type":"mqtt in","z":"1112a3ea.54efdc","name":"","topic":"zigbee2mqtt/#","qos":"2","datatype":"utf8","broker":"f5594d13.23bec","x":110,"y":100,"wires":[["5564a681.f2b1d8"]]},{"id":"a600ffb3.fdd1b","type":"switch","z":"1112a3ea.54efdc","name":"log type","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"devices","vt":"str"},{"t":"eq","v":"groups","vt":"str"},{"t":"eq","v":"zigbee_publish_error","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":4,"x":540,"y":540,"wires":[["dc9da24.290da6"],["9cce1a99.a33f28"],["a4e5b5d9.2c3e88"],["e3b7ead2.4ac6f8"]]},{"id":"ba524055.a6136","type":"json","z":"1112a3ea.54efdc","name":"","property":"payload","action":"","pretty":false,"x":410,"y":540,"wires":[["a600ffb3.fdd1b"]]},{"id":"dc9da24.290da6","type":"link out","z":"1112a3ea.54efdc","name":"Z2M LOG DEVICELIST","links":["28c00ddc.4dea62","94e9b5e4.4a4158"],"x":695,"y":500,"wires":[]},{"id":"87ab5849.f09d28","type":"function","z":"1112a3ea.54efdc","name":"Reformat for list","func":"newPayload = [];\nmsg.payload.message.forEach(function(entry) {\n if(entry.type != 'Coordinator') {\n newentry = {'title': entry.friendly_name, \n 'description': entry.model + ' (' + entry.ieeeAddr + ')',\n 'icon': 'https://www.zigbee2mqtt.io/images/devices/' + entry.model.replace(new RegExp('/', 'g'), '-') + '.jpg'\n };\n newPayload.push(newentry);\n }\n});\n\nmsg.payload=newPayload;\nreturn msg;\n","outputs":1,"noerr":0,"x":180,"y":920,"wires":[["6c06b987.6f7098"]]},{"id":"28c00ddc.4dea62","type":"link in","z":"1112a3ea.54efdc","name":"Z2M DEV LIST INPUT","links":["dc9da24.290da6"],"x":55,"y":940,"wires":[["87ab5849.f09d28","f3505bcc.2352d8"]]},{"id":"6c06b987.6f7098","type":"ui_list","z":"1112a3ea.54efdc","group":"902c151e.212a38","name":"Devices","order":1,"width":"6","height":"11","lineType":"three","actionType":"click","allowHTML":true,"x":340,"y":920,"wires":[["9fa73b15.846b38"]]},{"id":"9fa73b15.846b38","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"device","pt":"flow","to":"payload.title","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":960,"wires":[["1a63fe7a.9d0142","4b968044.ca533","4d2d1114.f6adf"]]},{"id":"ab86c3a1.ed149","type":"mqtt out","z":"1112a3ea.54efdc","name":"Generic output","topic":"","qos":"","retain":"false","broker":"f5594d13.23bec","x":420,"y":160,"wires":[]},{"id":"398af7a3.80e388","type":"link in","z":"1112a3ea.54efdc","name":"Z2M GENERIC MQTT OUT","links":["67f130eb.efef3","458d2db0.4f1c14","3b86e8ee.a04ed8","632c3105.5495f","bf8faaff.5215b8","75d20744.52cef8","207b74ec.1d3f1c","699fc636.402658"],"x":55,"y":160,"wires":[["ab86c3a1.ed149"]]},{"id":"67f130eb.efef3","type":"link out","z":"1112a3ea.54efdc","name":"Z2M GROUP BIND OUT","links":["398af7a3.80e388"],"x":875,"y":1900,"wires":[]},{"id":"f3505bcc.2352d8","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"devices","pt":"flow","to":"payload.message","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":960,"wires":[[]]},{"id":"1a63fe7a.9d0142","type":"function","z":"1112a3ea.54efdc","name":"Lookup device details","func":"devices = flow.get('devices');\n\nfor (var i in devices) {\n if(devices[i].friendly_name == msg.payload.title) {\n flow.set('seldevice_details', devices[i]);\n msg.payload = devices[i];\n return msg;\n }\n}\n\nmsg.payload.friendly_name='unknown';\nreturn msg;\n","outputs":1,"noerr":0,"x":600,"y":960,"wires":[["46646ab3.510094"]]},{"id":"9de0998d.8b3668","type":"function","z":"1112a3ea.54efdc","name":"Reformat for dropdown","func":"newPayload = [];\nmsg.payload.message.forEach(function(entry) {\n newPayload.push(entry.friendly_name);\n});\n\nnewMsg = {'payload': flow.get('bindtarget'), 'options': newPayload};\n\nreturn newMsg;\n","outputs":1,"noerr":0,"x":200,"y":2180,"wires":[["ce73ad6f.0b69"]]},{"id":"94e9b5e4.4a4158","type":"link in","z":"1112a3ea.54efdc","name":"Z2M BIND LIST INPUT","links":["dc9da24.290da6"],"x":55,"y":2180,"wires":[["9de0998d.8b3668"]]},{"id":"ce73ad6f.0b69","type":"ui_dropdown","z":"1112a3ea.54efdc","name":"","label":"Target device","tooltip":"","place":"Select target device","group":"38009ddc.858562","order":12,"width":"6","height":"1","passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":410,"y":2180,"wires":[["74886cbc.2a0f14"]]},{"id":"74886cbc.2a0f14","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"bindtarget","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":2180,"wires":[[]]},{"id":"c1eb42c4.f454a","type":"inject","z":"1112a3ea.54efdc","name":"","topic":"","payload":"","payloadType":"date","repeat":"6","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":1140,"wires":[["ba7821e1.93e46"]]},{"id":"260ce836.2e4f98","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"bridgestate","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":480,"wires":[[]]},{"id":"450f3b02.985824","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"38009ddc.858562","order":10,"width":"3","height":"1","passthru":false,"label":"Remove from group","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Remove","payloadType":"str","topic":"","x":140,"y":1940,"wires":[["3b260768.9d2d38"]]},{"id":"14507948.bc92c7","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"38009ddc.858562","order":14,"width":"3","height":"1","passthru":false,"label":"Unbind device","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Unbind","payloadType":"str","topic":"","x":120,"y":2280,"wires":[["2862cc.8a6c4d34"]]},{"id":"463d3907.451408","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}} device <b>{{flow.device}}</b> in group <b>{{flow.groupname}}</b>?","output":"str","x":320,"y":1900,"wires":[["d1c4f87f.dbce28"]]},{"id":"d1c4f87f.dbce28","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"add","cancel":"cancel","topic":"Add to group","name":"","x":470,"y":1900,"wires":[["b7ebccd6.217c7"]]},{"id":"b7ebccd6.217c7","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"add","vt":"str"},{"t":"eq","v":"remove","vt":"str"},{"t":"eq","v":"cancel","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":630,"y":1920,"wires":[["fe321b77.50b858"],["fe321b77.50b858"],[]]},{"id":"3b260768.9d2d38","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}} device <b>{{flow.device}}</b> in group <b>{{flow.groupname}}</b>?","output":"str","x":320,"y":1940,"wires":[["99104ccd.a2827"]]},{"id":"99104ccd.a2827","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"remove","cancel":"cancel","topic":"Remove from group","name":"","x":470,"y":1940,"wires":[["b7ebccd6.217c7"]]},{"id":"4d02aaf3.2fbb24","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}} device <b>{{flow.device}}</b> to <b>{{flow.bindtarget}}</b>?","output":"str","x":280,"y":2240,"wires":[["28efb09d.6d9cb"]]},{"id":"28efb09d.6d9cb","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"bind","cancel":"cancel","topic":"Bind device","name":"","x":430,"y":2240,"wires":[["5f4235aa.d48c2c"]]},{"id":"2862cc.8a6c4d34","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}} device <b>{{flow.device}}</b> from <b>{{flow.bindtarget}}</b>?","output":"str","x":280,"y":2280,"wires":[["b41dcb39.fffc48"]]},{"id":"b41dcb39.fffc48","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"unbind","cancel":"cancel","topic":"Unbind device","name":"","x":430,"y":2280,"wires":[["5f4235aa.d48c2c"]]},{"id":"5f4235aa.d48c2c","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"bind","vt":"str"},{"t":"eq","v":"unbind","vt":"str"},{"t":"eq","v":"cancel","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":590,"y":2260,"wires":[["fae942d1.d6e91"],["fae942d1.d6e91"],[]]},{"id":"af2bd47b.bb43c8","type":"ui_text_input","z":"1112a3ea.54efdc","name":"","label":"New device name","tooltip":"","group":"38009ddc.858562","order":5,"width":"6","height":"1","passthru":true,"mode":"text","delay":"100","topic":"","x":130,"y":1860,"wires":[["740e14d9.a5ad0c"]]},{"id":"67a03950.a9be58","type":"comment","z":"1112a3ea.54efdc","name":"Device management","info":"","x":130,"y":1740,"wires":[]},{"id":"740e14d9.a5ad0c","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"newdevicename","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":1860,"wires":[[]]},{"id":"3f245891.878948","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"38009ddc.858562","order":6,"width":"6","height":"1","passthru":false,"label":"Rename device","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Rename","payloadType":"str","topic":"","x":120,"y":2080,"wires":[["16376b86.70cdb4"]]},{"id":"16376b86.70cdb4","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}} device <b>{{flow.device}}</b> to <b>{{flow.newdevicename}}</b>?","output":"str","x":280,"y":2080,"wires":[["1c5b4126.8d8daf"]]},{"id":"1c5b4126.8d8daf","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"rename","cancel":"cancel","topic":"Rename device","name":"","x":430,"y":2080,"wires":[["c65c2cb3.8fafb"]]},{"id":"c65c2cb3.8fafb","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"rename","vt":"str"},{"t":"eq","v":"cancel","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":570,"y":2080,"wires":[["6a0ab4e.825834c"],[]]},{"id":"6a0ab4e.825834c","type":"function","z":"1112a3ea.54efdc","name":"Format Data","func":"var oldname = flow.get('device');\nvar newname = flow.get('newdevicename');\n\nif (typeof oldname !== undefined && typeof newname !== undefined) {\n msg1 = { 'payload': {\"old\": oldname, \"new\": newname}, 'topic': 'zigbee2mqtt/bridge/config/rename'};\n msg2 = { 'payload': msg.payload + ' ' + oldname + ' to ' + newname };\n\n return [msg1, msg2];\n}","outputs":2,"noerr":0,"x":730,"y":2080,"wires":[["75d20744.52cef8"],["6c972cc3.1c1ce4"]]},{"id":"6c972cc3.1c1ce4","type":"ui_toast","z":"1112a3ea.54efdc","position":"top right","displayTime":"5","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"System Notification","name":"","x":790,"y":2140,"wires":[]},{"id":"6d78e825.7722f8","type":"switch","z":"1112a3ea.54efdc","name":"","property":"topic","propertyType":"msg","rules":[{"t":"regex","v":".*/bridge/state","vt":"str","case":false},{"t":"regex","v":".*/bridge/log","vt":"str","case":false},{"t":"regex","v":".*/bridge/config$","vt":"str","case":false},{"t":"regex","v":".*/networkmap/graphviz$","vt":"str","case":false},{"t":"regex","v":".*/bridge/config/.*","vt":"str","case":false},{"t":"regex","v":"^(?!.*get$|.*set$).*$","vt":"str","case":false}],"checkall":"false","repair":false,"outputs":6,"x":230,"y":540,"wires":[["260ce836.2e4f98"],["ba524055.a6136"],["3d8a0b9a.aa0504"],["162ed5bf.58dd8a"],[],["d3fbf1d9.d4525"]]},{"id":"3d8a0b9a.aa0504","type":"json","z":"1112a3ea.54efdc","name":"","property":"payload","action":"","pretty":false,"x":410,"y":620,"wires":[["619cfbc2.0293b4"]]},{"id":"619cfbc2.0293b4","type":"link out","z":"1112a3ea.54efdc","name":"Z2M BRIDGE CONFIG INPUT","links":["d983172a.616bc8"],"x":515,"y":620,"wires":[]},{"id":"61a80af8.34eb64","type":"ui_switch","z":"1112a3ea.54efdc","name":"","label":"Permit join","tooltip":"","group":"d40979a3.d11a08","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"zigbee2mqtt/bridge/config/permit_join","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":470,"y":1280,"wires":[["3b86e8ee.a04ed8"]]},{"id":"aef8aa15.a42ce8","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"move","p":"payload.permit_join","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":1280,"wires":[["61a80af8.34eb64"]]},{"id":"d983172a.616bc8","type":"link in","z":"1112a3ea.54efdc","name":"Z2M BRIDGE CONFIG","links":["619cfbc2.0293b4"],"x":55,"y":1280,"wires":[["aef8aa15.a42ce8","67251463.751fec","be14f64d.ceb358","56f299a2.6327d8"]]},{"id":"2efc8bac.a29ab4","type":"ui_dropdown","z":"1112a3ea.54efdc","name":"","label":"Log level","tooltip":"","place":"Select log level","group":"d40979a3.d11a08","order":2,"width":0,"height":0,"passthru":false,"options":[{"label":"Info","value":"info","type":"str"},{"label":"Debug","value":"debug","type":"str"},{"label":"Warn","value":"warn","type":"str"},{"label":"Error","value":"error","type":"str"}],"payload":"","topic":"zigbee2mqtt/bridge/config/log_level","x":460,"y":1320,"wires":[["3b86e8ee.a04ed8"]]},{"id":"3b86e8ee.a04ed8","type":"link out","z":"1112a3ea.54efdc","name":"Z2M BRIDGE CONFIG OUT","links":["398af7a3.80e388"],"x":615,"y":1300,"wires":[]},{"id":"67251463.751fec","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"move","p":"payload.log_level","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":240,"y":1320,"wires":[["2efc8bac.a29ab4"]]},{"id":"e3b7ead2.4ac6f8","type":"link out","z":"1112a3ea.54efdc","name":"Z2M NOTIFICATIONS OUT","links":["71034afb.6773f4"],"x":695,"y":600,"wires":[]},{"id":"b2123a08.a7deb8","type":"ui_toast","z":"1112a3ea.54efdc","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":840,"y":2600,"wires":[]},{"id":"71034afb.6773f4","type":"link in","z":"1112a3ea.54efdc","name":"Z2M NOTIFICATIONS INPUT","links":["e3b7ead2.4ac6f8"],"x":65,"y":2580,"wires":[["f24e73c5.e5cad"]]},{"id":"7d4fa71c.1ec908","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"payload.type","tot":"msg"},{"t":"move","p":"payload.message","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":2680,"wires":[["b2123a08.a7deb8"]]},{"id":"7475bcd5.f978c4","type":"comment","z":"1112a3ea.54efdc","name":"Bridge status","info":"","x":110,"y":1100,"wires":[]},{"id":"99d65db9.18641","type":"ui_button","z":"1112a3ea.54efdc","name":"remove device","group":"38009ddc.858562","order":3,"width":"6","height":"1","passthru":false,"label":"Remove device","tooltip":"","color":"","bgcolor":"","icon":"","payload":"remove","payloadType":"str","topic":"","x":120,"y":1820,"wires":[["d0e1401d.17d42"]]},{"id":"d0e1401d.17d42","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}} device <b>{{flow.device}}</b> permanently?","output":"str","x":280,"y":1820,"wires":[["215d69ec.df3ec6"]]},{"id":"215d69ec.df3ec6","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"remove","cancel":"cancel","topic":"Remove device","name":"","x":430,"y":1820,"wires":[["cc05901d.7d2bb"]]},{"id":"cc05901d.7d2bb","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"remove","vt":"str"},{"t":"eq","v":"cancel","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":570,"y":1820,"wires":[["d44c81f5.d4712"],[]]},{"id":"d44c81f5.d4712","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"zigbee2mqtt/bridge/config/remove","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"device","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":1820,"wires":[["207b74ec.1d3f1c"]]},{"id":"4fe45eac.983e","type":"ui_text","z":"1112a3ea.54efdc","group":"d40979a3.d11a08","order":4,"width":"0","height":"0","name":"","label":"Status","format":"{{msg.payload.bridgestate}}","layout":"row-left","x":510,"y":1200,"wires":[]},{"id":"d36f839f.5fd8a","type":"ui_text","z":"1112a3ea.54efdc","group":"d40979a3.d11a08","order":7,"width":"0","height":"0","name":"","label":"Devices","format":"{{msg.payload.numdevices}}","layout":"row-left","x":520,"y":1160,"wires":[]},{"id":"ba7821e1.93e46","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.numdevices","pt":"msg","to":"devices.length","tot":"flow"},{"t":"set","p":"payload.bridgestate","pt":"msg","to":"bridgestate","tot":"flow"},{"t":"set","p":"payload.nwlast","pt":"msg","to":"networkmap_last","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":1140,"wires":[["d36f839f.5fd8a","4fe45eac.983e","7e27d95b.8f7028"]]},{"id":"46646ab3.510094","type":"function","z":"1112a3ea.54efdc","name":"Reformat for details","func":"newPayload = [];\n\nnewentry = {\n 'title': msg.payload.friendly_name,\n 'description': 'zigbee2mqtt/' + msg.payload.friendly_name,\n 'icon': 'https://www.zigbee2mqtt.io/images/logo.png'\n};\nnewPayload.push(newentry);\nnewentry = {\n 'title': msg.payload.ieeeAddr,\n 'description': 'NwkAddr: ' + msg.payload.nwkAddr + ' / manufId: ' + msg.payload.manufId,\n 'icon_name': 'settings_input_antenna'\n};\nnewPayload.push(newentry);\nnewentry = { \n 'title': msg.payload.model,\n 'description': msg.payload.modelId,\n 'icon': 'https://www.zigbee2mqtt.io/images/devices/' + msg.payload.model.replace(new RegExp('/', 'g'), '-') + '.jpg'\n};\nnewPayload.push(newentry);\nnewentry = { \n 'title': msg.payload.manufName,\n 'description': 'HW: ' + msg.payload.hwVersion + ' / SW: ' + msg.payload.swBuildId,\n 'icon_name': 'bookmark'\n};\nnewPayload.push(newentry);\nvar type_icon = msg.payload.type=='Router' ? 'device_hub' : 'input';\nnewentry = {\n 'title': msg.payload.type,\n 'description': 'Powersource: ' + msg.payload.powerSource,\n 'icon_name': type_icon\n};\nnewPayload.push(newentry);\n\nmsg.payload=newPayload;\nreturn msg;\n","outputs":1,"noerr":0,"x":630,"y":1020,"wires":[["2694bda5.0e1732"]]},{"id":"162ed5bf.58dd8a","type":"change","z":"1112a3ea.54efdc","name":"save networkmap","rules":[{"t":"set","p":"networkmap","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"networkmap_last","pt":"flow","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":680,"wires":[["9596b7ff.dac428"]]},{"id":"5857ba56.3a5444","type":"http in","z":"1112a3ea.54efdc","name":"","url":"/z2mpanel/networkmap","method":"get","upload":false,"swaggerDoc":"","x":160,"y":3080,"wires":[["368af09e.feec5"]]},{"id":"368af09e.feec5","type":"template","z":"1112a3ea.54efdc","name":"Render page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <meta charset=\"utf-8\">\n <title>Network topology</title>\n <style>\n #graphviz_svg_div svg {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n </style>\n </head>\n <body>\n <div id=\"graphviz_svg_div\"></div>\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/viz.js@2.1.2/viz.js\"></script>\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/viz.js@2.1.2/full.render.js\"></script>\n <script language=\"javascript\" type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.0/dist/svg-pan-zoom.min.js\"></script>\n <script type=\"bogus\" id=\"graphviz_input\">\n {{{flow.networkmap}}}\n </script>\n <script language=\"javascript\" type=\"text/javascript\">\n document.addEventListener(\"DOMContentLoaded\", function(event) {\n var viz = new Viz();\n var svg = document.getElementById(\"graphviz_input\").innerHTML;\n viz.renderSVGElement(svg, {engine: \"{{{flow.nwrenderengine}}}\"})\n .then(function(element) {\n document.getElementById(\"graphviz_svg_div\").appendChild(element);\n panZoom = svgPanZoom(element, {\n zoomEnabled: true,\n controlIconsEnabled: true,\n fit: true,\n center: true,\n minZoom: 0.1\n });\n\n element.addEventListener('paneresize', function(e) {\n panZoom.resize();\n }, false);\n window.addEventListener('resize', function(e) {\n panZoom.resize();\n });\n })\n .catch(error => {\n // Create a new Viz instance (@see Caveats page for more info)\n viz = new Viz();\n\n // Possibly display the error\n console.error(error);\n });\n //var svg = Viz(document.getElementById(\"graphviz_input\").innerHTML, \"svg\", {render: \"circo\"});\n //document.getElementById(\"graphviz_svg_div\").innerHTML = svg;\n });\n </script>\n </body>\n</html>","output":"str","x":450,"y":3080,"wires":[["65139275.6e325c"]]},{"id":"65139275.6e325c","type":"http response","z":"1112a3ea.54efdc","name":"","statusCode":"","headers":{},"x":650,"y":3080,"wires":[]},{"id":"2ba4c4f9.de559c","type":"ui_template","z":"1112a3ea.54efdc","group":"fd4925c4.d13458","name":"iframe nw map","order":0,"width":"27","height":"11","format":"<iframe frameborder=\"0\" width=\"100%\" height=\"100%\" src=\"/z2mpanel/networkmap\"></iframe>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":120,"y":3040,"wires":[[]]},{"id":"2694bda5.0e1732","type":"ui_list","z":"1112a3ea.54efdc","group":"ee188496.59ff28","name":"Selected device","order":1,"width":"6","height":"7","lineType":"three","actionType":"none","allowHTML":true,"x":820,"y":1020,"wires":[[]]},{"id":"5821943.e8f1e6c","type":"comment","z":"1112a3ea.54efdc","name":"Device list & selected device","info":"","x":160,"y":880,"wires":[]},{"id":"202259f7.b7a9c6","type":"inject","z":"1112a3ea.54efdc","name":"Create network map","topic":"zigbee2mqtt/bridge/networkmap","payload":"graphviz","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"10","x":130,"y":200,"wires":[["ab86c3a1.ed149"]]},{"id":"dcf15903.6ff8e8","type":"inject","z":"1112a3ea.54efdc","name":"Request Device List","topic":"zigbee2mqtt/bridge/config/devices/get","payload":"","payloadType":"date","repeat":"5","crontab":"","once":true,"onceDelay":0.1,"x":140,"y":240,"wires":[["ab86c3a1.ed149"]]},{"id":"62a2e5be.e305bc","type":"ui_button","z":"1112a3ea.54efdc","name":"Create nw map","group":"d40979a3.d11a08","order":12,"width":"1","height":"1","passthru":false,"label":"","tooltip":"Refresh network map","color":"","bgcolor":"","icon":"refresh","payload":"graphviz","payloadType":"str","topic":"zigbee2mqtt/bridge/networkmap","x":120,"y":2880,"wires":[["632c3105.5495f"]]},{"id":"632c3105.5495f","type":"link out","z":"1112a3ea.54efdc","name":"Z2M NW MAP GEN","links":["398af7a3.80e388"],"x":255,"y":2880,"wires":[]},{"id":"f24e73c5.e5cad","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"pairing","vt":"str"},{"t":"eq","v":"device_connected","vt":"str"},{"t":"eq","v":"device_removed","vt":"str"},{"t":"istype","v":"object","vt":"object"},{"t":"else"}],"checkall":"false","repair":false,"outputs":5,"x":160,"y":2580,"wires":[["1e0e2fff.2eee5"],["eaaa0045.a639"],["51ff0ea1.0a919"],["8ae66b7.1c0af98"],["7d4fa71c.1ec908"]]},{"id":"1e0e2fff.2eee5","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload.message","propertyType":"msg","rules":[{"t":"eq","v":"connecting with device","vt":"str"},{"t":"eq","v":"device incoming","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":320,"y":2480,"wires":[["2d86241a.ba284c"],["7fc722db.eb28ac"]]},{"id":"2d86241a.ba284c","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"A device is attempting to pair...","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":2460,"wires":[["b2123a08.a7deb8"]]},{"id":"7fc722db.eb28ac","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"A device is incoming or repairing...","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":2500,"wires":[["b2123a08.a7deb8"]]},{"id":"eaaa0045.a639","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Device paired successfully: {{msg.payload.message}}","output":"str","x":330,"y":2540,"wires":[["b2123a08.a7deb8"]]},{"id":"51ff0ea1.0a919","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Deviced removed: {{msg.payload.message}}","output":"str","x":330,"y":2580,"wires":[["b2123a08.a7deb8"]]},{"id":"61db4308.05a59c","type":"comment","z":"1112a3ea.54efdc","name":"Notifications","info":"","x":120,"y":2420,"wires":[]},{"id":"a7b346c6.0c9d18","type":"ui_toast","z":"1112a3ea.54efdc","position":"top right","displayTime":"5","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"System Notification","name":"","x":790,"y":2320,"wires":[]},{"id":"bf8faaff.5215b8","type":"link out","z":"1112a3ea.54efdc","name":"Z2M BINDING OUT","links":["398af7a3.80e388"],"x":875,"y":2240,"wires":[]},{"id":"75d20744.52cef8","type":"link out","z":"1112a3ea.54efdc","name":"Z2M RENAME OUT","links":["398af7a3.80e388"],"x":855,"y":2060,"wires":[]},{"id":"207b74ec.1d3f1c","type":"link out","z":"1112a3ea.54efdc","name":"Z2M REMOVE OUT","links":["398af7a3.80e388"],"x":835,"y":1820,"wires":[]},{"id":"6e76defe.80e97","type":"comment","z":"1112a3ea.54efdc","name":"Zigbee2Mqtt Admin Panel","info":"","x":150,"y":40,"wires":[]},{"id":"638e5203.cd6f8c","type":"comment","z":"1112a3ea.54efdc","name":"---- Dont change things down here ----","info":"","x":190,"y":400,"wires":[]},{"id":"8ae66b7.1c0af98","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload.type.group","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":2620,"wires":[["587b2872.f7c9c8"]]},{"id":"587b2872.f7c9c8","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Succesfully changed device {{payload.type.device}} in group {{payload.type.group}}","output":"str","x":570,"y":2620,"wires":[["b2123a08.a7deb8"]]},{"id":"cd065e2e.3e334","type":"ui_toast","z":"1112a3ea.54efdc","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":880,"y":640,"wires":[]},{"id":"9596b7ff.dac428","type":"debug","z":"1112a3ea.54efdc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":680,"wires":[]},{"id":"7e27d95b.8f7028","type":"ui_text","z":"1112a3ea.54efdc","group":"d40979a3.d11a08","order":9,"width":"0","height":"0","name":"","label":"Last created","format":"{{msg.payload.nwlast | date:'dd.MM.yy HH:mm'}}","layout":"row-spread","x":530,"y":1120,"wires":[]},{"id":"d0f962f1.6e1fd","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"d40979a3.d11a08","order":11,"width":"5","height":"1","passthru":false,"label":"Show network map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"tab\":\"Z2M Network map\"}","payloadType":"json","topic":"","x":130,"y":2920,"wires":[["d64445e4.511f88"]]},{"id":"d64445e4.511f88","type":"ui_ui_control","z":"1112a3ea.54efdc","name":"","x":340,"y":2920,"wires":[[]]},{"id":"4b968044.ca533","type":"link out","z":"1112a3ea.54efdc","name":"Z2M FLOW DEV TRIGGER","links":["f7eaa817.70bfd8","ced9b243.c5dfc","afb0f244.23a25","d8fc6e0f.d831c"],"x":475,"y":1020,"wires":[]},{"id":"5bdeb97.e5ea048","type":"inject","z":"1112a3ea.54efdc","name":"","topic":"","payload":"","payloadType":"date","repeat":"5","crontab":"","once":true,"onceDelay":0.1,"x":330,"y":1020,"wires":[["4b968044.ca533"]]},{"id":"a4e5b5d9.2c3e88","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.message}} to device {{payload.meta.entity.friendlyName}}\nOriginal message: {{payload.meta.message}}","output":"str","x":780,"y":580,"wires":[["cd065e2e.3e334","aab0241a.1dabd8"]]},{"id":"aab0241a.1dabd8","type":"link out","z":"1112a3ea.54efdc","name":"PUBLISH ERROR TO TELEGRAM","links":["34d4fa40.340716","237ac04e.ab42b"],"x":895,"y":560,"wires":[]},{"id":"d595fafe.6834b8","type":"inject","z":"1112a3ea.54efdc","name":"Request Group List","topic":"zigbee2mqtt/bridge/config/groups","payload":"","payloadType":"date","repeat":"5","crontab":"","once":true,"onceDelay":0.1,"x":140,"y":280,"wires":[["ab86c3a1.ed149"]]},{"id":"9cce1a99.a33f28","type":"link out","z":"1112a3ea.54efdc","name":"Z2M LOG GROUPLIST","links":["7ede0202.b35fec","b259a6a5.f45d38","a5f793a4.b6462"],"x":695,"y":540,"wires":[]},{"id":"1109a698.6fc9c9","type":"comment","z":"1112a3ea.54efdc","name":"Networkmap","info":"","x":110,"y":2840,"wires":[]},{"id":"bfd5d37c.7ca3f","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"groupname","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":2020,"wires":[[]]},{"id":"b259a6a5.f45d38","type":"link in","z":"1112a3ea.54efdc","name":"Z2M GROUP UI","links":["9cce1a99.a33f28"],"x":55,"y":2020,"wires":[["58f4d54b.e434ac"]]},{"id":"58f4d54b.e434ac","type":"function","z":"1112a3ea.54efdc","name":"Reformat for list","func":"newPayload = [];\nObject.keys(msg.payload.message).forEach(function(key) {\n var msgKey = msg.payload.message[key].friendly_name + \" (ID: \" + key + \")\";\n var msgVar = msg.payload.message[key].friendly_name;\n newentry = '{\"'+msgKey+'\":\" '+ msgVar+'\"}';\n newPayload.push(msg.payload.message[key].friendly_name);\n});\n\nnewMsg = {'payload': flow.get('groupname'), 'options': newPayload}\nreturn newMsg;\n","outputs":1,"noerr":0,"x":170,"y":2020,"wires":[["1610ed0c.d0e1e3"]]},{"id":"be14f64d.ceb358","type":"ui_text","z":"1112a3ea.54efdc","group":"d40979a3.d11a08","order":5,"width":"0","height":"0","name":"","label":"Zigbee2MQTT version","format":"{{msg.payload.version}}","layout":"row-left","x":220,"y":1180,"wires":[]},{"id":"56f299a2.6327d8","type":"ui_text","z":"1112a3ea.54efdc","group":"d40979a3.d11a08","order":6,"width":"0","height":"0","name":"","label":"Coordinator firmware","format":"{{msg.payload.coordinator_firmware}}","layout":"row-left","x":220,"y":1220,"wires":[]},{"id":"f94fee3a.19978","type":"inject","z":"1112a3ea.54efdc","name":"Reset CC253x","topic":"zigbee2mqtt/bridge/config/reset","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":320,"wires":[["ab86c3a1.ed149"]]},{"id":"1610ed0c.d0e1e3","type":"ui_dropdown","z":"1112a3ea.54efdc","name":"Groups","label":"Group","tooltip":"","place":"Select group","group":"38009ddc.858562","order":8,"width":"6","height":"1","passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":340,"y":2020,"wires":[["bfd5d37c.7ca3f"]]},{"id":"ce7e9b39.36a138","type":"ui_text_input","z":"1112a3ea.54efdc","name":"Selected device","label":"Selected device","tooltip":"Select device in device list","group":"38009ddc.858562","order":2,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"","x":420,"y":1780,"wires":[[]]},{"id":"d8fc6e0f.d831c","type":"link in","z":"1112a3ea.54efdc","name":"Z2M BIND DEVICE INP","links":["4b968044.ca533"],"x":55,"y":1780,"wires":[["90333b0d.d35758"]]},{"id":"90333b0d.d35758","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"device","tot":"flow"},{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":180,"y":1780,"wires":[["ce7e9b39.36a138"]]},{"id":"3becb9b5.67b2a6","type":"ui_toast","z":"1112a3ea.54efdc","position":"top right","displayTime":"5","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"System Notification","name":"","x":810,"y":1580,"wires":[]},{"id":"48a7a523.1678fc","type":"function","z":"1112a3ea.54efdc","name":"Format Data","func":"\nif (msg.payload == \"add\") {\n var action = \"Adding \";\n var what = \"group \";\n var cmd = \"add_group\";\n var groupname = flow.get('newgroupname');\n}\nif(msg.payload == \"remove\") {\n action = \"Removing \";\n what = \"group \";\n cmd = \"remove_group\";\n groupname = flow.get('groupname2');\n}\nvar msg1 = { payload: groupname, topic: \"zigbee2mqtt/bridge/config/\" + cmd};\nvar msg2 = { payload: action + what + groupname };\n\nreturn [msg1, msg2];\n","outputs":2,"noerr":0,"x":770,"y":1520,"wires":[["699fc636.402658"],["3becb9b5.67b2a6"]]},{"id":"699fc636.402658","type":"link out","z":"1112a3ea.54efdc","name":"Z2M GROUP BIND OUT","links":["398af7a3.80e388"],"x":875,"y":1500,"wires":[]},{"id":"1eab9c80.093434","type":"switch","z":"1112a3ea.54efdc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"add","vt":"str"},{"t":"eq","v":"remove","vt":"str"},{"t":"eq","v":"cancel","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":630,"y":1520,"wires":[["48a7a523.1678fc"],["48a7a523.1678fc"],[]]},{"id":"c4fe2b67.cf9738","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"add","cancel":"cancel","topic":"Add group","name":"","x":470,"y":1500,"wires":[["1eab9c80.093434"]]},{"id":"aea3baea.3e1e18","type":"ui_toast","z":"1112a3ea.54efdc","position":"dialog","displayTime":"3","highlight":"","outputs":1,"ok":"remove","cancel":"cancel","topic":"Remove group","name":"","x":470,"y":1540,"wires":[["1eab9c80.093434"]]},{"id":"cc1b1b4c.c16468","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Add group <b>{{flow.newgroupname}}</b>?","output":"str","x":320,"y":1500,"wires":[["c4fe2b67.cf9738"]]},{"id":"60051e06.1b187","type":"template","z":"1112a3ea.54efdc","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Remove group <b>{{flow.groupname2}}</b>?","output":"str","x":320,"y":1540,"wires":[["aea3baea.3e1e18"]]},{"id":"bc9a1621.4bf0d8","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"d9a11d4b.0417f","order":15,"width":"6","height":"1","passthru":false,"label":"Add group","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Add","payloadType":"str","topic":"","x":110,"y":1500,"wires":[["cc1b1b4c.c16468"]]},{"id":"d87bfe09.f0b49","type":"ui_button","z":"1112a3ea.54efdc","name":"","group":"d9a11d4b.0417f","order":17,"width":"6","height":"1","passthru":false,"label":"Remove group","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Remove","payloadType":"str","topic":"","x":120,"y":1540,"wires":[["60051e06.1b187"]]},{"id":"9f335ddf.67d2b","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"groupname2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":1580,"wires":[[]]},{"id":"a5f793a4.b6462","type":"link in","z":"1112a3ea.54efdc","name":"Z2M GROUP UI","links":["9cce1a99.a33f28"],"x":55,"y":1580,"wires":[["78d47084.a872f"]]},{"id":"78d47084.a872f","type":"function","z":"1112a3ea.54efdc","name":"Reformat for list","func":"newPayload = [];\nObject.keys(msg.payload.message).forEach(function(key) {\n var msgKey = msg.payload.message[key].friendly_name + \" (ID: \" + key + \")\";\n var msgVar = msg.payload.message[key].friendly_name;\n newentry = '{\"'+msgKey+'\":\" '+ msgVar+'\"}';\n newPayload.push(msg.payload.message[key].friendly_name);\n});\n\nnewMsg = {'payload': flow.get('groupname2'), 'options': newPayload}\nreturn newMsg;\n","outputs":1,"noerr":0,"x":170,"y":1580,"wires":[["45acd531.d9045c"]]},{"id":"45acd531.d9045c","type":"ui_dropdown","z":"1112a3ea.54efdc","name":"Groups","label":"","tooltip":"Selected group","place":"Select group","group":"d9a11d4b.0417f","order":16,"width":"6","height":"1","passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":340,"y":1580,"wires":[["9f335ddf.67d2b"]]},{"id":"dcb4f7a6.e845b8","type":"ui_text_input","z":"1112a3ea.54efdc","name":"","label":"New group name","tooltip":"","group":"d9a11d4b.0417f","order":14,"width":"6","height":"1","passthru":true,"mode":"text","delay":"100","topic":"","x":130,"y":1640,"wires":[["bcb48a8a.a55288"]]},{"id":"bcb48a8a.a55288","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"newgroupname","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":1640,"wires":[[]]},{"id":"1ba11ffa.fb4e","type":"ui_text","z":"1112a3ea.54efdc","group":"38009ddc.858562","order":7,"width":"6","height":"1","name":"Group membership","label":"<h3>Device group membership</h3>","format":"","layout":"row-left","x":130,"y":1980,"wires":[]},{"id":"1303ac28.147ee4","type":"ui_text","z":"1112a3ea.54efdc","group":"38009ddc.858562","order":11,"width":"6","height":"1","name":"Bind device label","label":"<h3>Bind device</h3>","format":"","layout":"row-left","x":130,"y":2140,"wires":[]},{"id":"60a53cc.67bb1c4","type":"ui_text","z":"1112a3ea.54efdc","group":"d40979a3.d11a08","order":3,"width":0,"height":0,"name":"bridge status label","label":"<h3>Bridge status</h3>","format":"","layout":"row-left","x":140,"y":1380,"wires":[]},{"id":"9377320a.f91bf","type":"ui_text","z":"1112a3ea.54efdc","group":"38009ddc.858562","order":4,"width":0,"height":0,"name":"rename device label","label":"<h3>Rename device</h3>","format":"","layout":"row-left","x":660,"y":1780,"wires":[]},{"id":"7c8cc223.0d85cc","type":"debug","z":"1112a3ea.54efdc","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":740,"wires":[]},{"id":"4a76279b.a9ad98","type":"ui_dropdown","z":"1112a3ea.54efdc","name":"renderer","label":"Renderer","tooltip":"Graphviz renderer","place":"Select renderer","group":"d40979a3.d11a08","order":10,"width":"0","height":"0","passthru":false,"options":[{"label":"Circo","value":"circo","type":"str"},{"label":"Dot","value":"dot","type":"str"},{"label":"Neato","value":"neato","type":"str"},{"label":"Twopi","value":"twopi","type":"str"},{"label":"Fdp","value":"fdp","type":"str"}],"payload":"","topic":"","x":340,"y":2960,"wires":[["884ed07d.681f1"]]},{"id":"884ed07d.681f1","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"nwrenderengine","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":2960,"wires":[[]]},{"id":"b6513876.8ae868","type":"inject","z":"1112a3ea.54efdc","name":"","topic":"","payload":"nwrenderengine","payloadType":"flow","repeat":"","crontab":"","once":true,"onceDelay":"1","x":140,"y":2960,"wires":[["4a76279b.a9ad98"]]},{"id":"829ae398.1035","type":"ui_text","z":"1112a3ea.54efdc","group":"d40979a3.d11a08","order":8,"width":0,"height":0,"name":"nw map label","label":"<h3>Network map</h3>","format":"","layout":"row-left","x":430,"y":2880,"wires":[]},{"id":"5564a681.f2b1d8","type":"link out","z":"1112a3ea.54efdc","name":"Z2M GENERIC IN","links":["f0917fb5.7bbd7"],"x":255,"y":100,"wires":[]},{"id":"f0917fb5.7bbd7","type":"link in","z":"1112a3ea.54efdc","name":"Z2M INPUT","links":["5564a681.f2b1d8"],"x":75,"y":540,"wires":[["6d78e825.7722f8"]]},{"id":"7eec6698.521ae8","type":"inject","z":"1112a3ea.54efdc","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":470,"y":320,"wires":[["af2ee649.26fd78"]]},{"id":"af2ee649.26fd78","type":"change","z":"1112a3ea.54efdc","name":"","rules":[{"t":"set","p":"nwrenderengine","pt":"flow","to":"circo","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":320,"wires":[[]]},{"id":"f0e7e75a.3440d8","type":"function","z":"1112a3ea.54efdc","name":"Save last msg","func":"lastDevMsgs = flow.get('lastdevmsgs')||{};\n\nlastDevMsgs[msg.topic] = msg.payload;\nflow.set('lastdevmsgs', lastDevMsgs);\n\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":740,"wires":[["7c8cc223.0d85cc"]]},{"id":"4d2d1114.f6adf","type":"function","z":"1112a3ea.54efdc","name":"Lookup device last msg","func":"lastmsgs = flow.get('lastdevmsgs');\n\nentry=lastmsgs[\"zigbee2mqtt/\"+msg.payload.title];\n\nnewPayload = [];\n\nnewentry = {\n 'title': '<h3>Last message</h3>'\n};\nnewPayload.push(newentry);\n\nfor(var prop in entry) {\n newentry = {\n 'title': '<b>' + prop + '</b>: ' + entry[prop],\n 'description': entry[prop]\n };\n newPayload.push(newentry);\n}\n\nmsg.payload = newPayload;\nreturn msg;\n","outputs":1,"noerr":0,"x":610,"y":920,"wires":[["3d3db415.2dcb2c"]]},{"id":"d3fbf1d9.d4525","type":"json","z":"1112a3ea.54efdc","name":"","property":"payload","action":"","pretty":false,"x":390,"y":740,"wires":[["f0e7e75a.3440d8"]]},{"id":"3d3db415.2dcb2c","type":"ui_list","z":"1112a3ea.54efdc","group":"ee188496.59ff28","name":"Selected device msg","order":2,"width":"6","height":"6","lineType":"one","actionType":"none","allowHTML":true,"x":840,"y":920,"wires":[[]]},{"id":"38009ddc.858562","type":"ui_group","z":"","name":"Device management","tab":"4d997c7f.f72024","order":3,"disp":true,"width":"6","collapse":false},{"id":"f5594d13.23bec","type":"mqtt-broker","z":"","name":"mqtt","broker":"mqtt","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"902c151e.212a38","type":"ui_group","z":"","name":"Device list","tab":"4d997c7f.f72024","order":1,"disp":true,"width":"6","collapse":false},{"id":"d40979a3.d11a08","type":"ui_group","z":"","name":"Bridge configuration","tab":"4d997c7f.f72024","order":5,"disp":true,"width":"6","collapse":true},{"id":"fd4925c4.d13458","type":"ui_group","z":"","name":"Network map","tab":"6db85f70.6d8a2","disp":false,"width":"27","collapse":false},{"id":"ee188496.59ff28","type":"ui_group","z":"","name":"Device details","tab":"4d997c7f.f72024","order":2,"disp":true,"width":"6","collapse":false},{"id":"d9a11d4b.0417f","type":"ui_group","z":"","name":"Group configuration","tab":"4d997c7f.f72024","order":4,"disp":true,"width":"6","collapse":true},{"id":"4d997c7f.f72024","type":"ui_tab","z":"","name":"Z2M Admin","icon":"dashboard","disabled":false,"hidden":false},{"id":"6db85f70.6d8a2","type":"ui_tab","z":"","name":"Z2M Network map","icon":"dashboard","disabled":false,"hidden":true}]
@spider7611
Copy link

Not working for me. I see only the right panel like Mihalski posted before. No devices show. What can I do with this?

@Dylantje
Copy link

Please also some help
Did everthing i did before... only no ui to find
Are there some install other needed?

@cbrandlehner
Copy link

Works for me. Those who face problems should share more information, otherwise helping seems impossible.

@Dylantje
Copy link

Works for me. Those who face problems should share more information, otherwise helping seems impossible.

Ok...
Only what information you need.?
I import the fow the first time, change the mqqt and works fine

New setup, i import the flow, did the same, only no ui to find..

are there thing that i need to import for the flow?
Or is there some check so i can see the flow is ok?
I get no error...

@cbrandlehner
Copy link

So you have two different environments (computers?) and while it works in one environment it fails for the other one?
What do you mean by "no ui to find"? As it work on one computer, I am pretty sure you know the URL, so what is the problem?

@Dylantje
Copy link

no was old system new setup...
when i type ip:1880/ui is there no w2z admin panle and the mqqt is connected

@Dylantje
Copy link

new setup some errors,
image
And cannot get them installed?

@cbrandlehner
Copy link

I see. This looks like a setup problem with node-red-dashboard. I had some weird effects too when I pasted the code twice by accident.
You might want to try to setup a new clean installation of node-red. Then configure node-red-dashboard and create some dummy ui page to know it is running fine.
Then import the flow and test again. Even if the mqtt setting is incorrect, you should see the UI.
Then change the config and reload the UI.

I had some problem as there seem to be TWO different plugins to provide "ui-list". I can not remember exactly how I installed this, but on my working instance I am running this version of "ui-list": https://registry.npmjs.org/node-red-node-ui_list/-/node-red-node-ui_list-0.1.5.tgz

@Dylantje
Copy link

ok how can remove a plugin when it is in use?

@cbrandlehner
Copy link

Looking at the screenshot, you missed to install node-red-dashboard and the other dependencies before importing the flow.

@Dylantje
Copy link

image

Now this ok?
What now?

@Dylantje
Copy link

Should this be a problem?
"↵↵---------------------------------------------------------------------↵Your flow credentials file is encrypted using a system-generated key.↵↵If the system-generated key is lost for any reason, your credentials↵file will not be recoverable, you will have to delete it and re-enter↵your credentials.↵↵You should set your own key using the 'credentialSecret' option in↵your settings file. Node-RED will then re-encrypt your credentials↵file using your chosen key the next time you deploy a change.↵----------------------------------------------------

@cbrandlehner
Copy link

Message above is not related to your problem, look into it later.
Now as you have node-red-dashboard running, let's see if the UI is up. This is a dummy flow to see if it displays anything.
[{"id":"9e4582cc.99f1","type":"inject","z":"c28437b7.8fd6b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":142.03334045410156,"y":759.0666351318359,"wires":[["926116a6.0d84b8","8a85f3f6.78bcd"]]},{"id":"926116a6.0d84b8","type":"function","z":"c28437b7.8fd6b8","name":"0","func":"msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"x":293.53334045410156,"y":758.0666351318359,"wires":[["9e3d6423.83ec28"]]},{"id":"8a85f3f6.78bcd","type":"function","z":"c28437b7.8fd6b8","name":"false","func":"msg.payload = false;\nreturn msg;","outputs":1,"noerr":0,"x":292.53334045410156,"y":722.0666351318359,"wires":[["a0bbe4c3.23d4c8"]]},{"id":"cd73729d.e610d","type":"inject","z":"c28437b7.8fd6b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":143.03334045410156,"y":830.0666351318359,"wires":[["3bccc2e3.b7585e","9dc86a2c.cee7e"]]},{"id":"3bccc2e3.b7585e","type":"function","z":"c28437b7.8fd6b8","name":"7","func":"msg.payload = 7;\nreturn msg;","outputs":1,"noerr":0,"x":294.53334045410156,"y":829.0666351318359,"wires":[["9e3d6423.83ec28"]]},{"id":"9dc86a2c.cee7e","type":"function","z":"c28437b7.8fd6b8","name":"true","func":"msg.payload = true;\nreturn msg;","outputs":1,"noerr":0,"x":293.53334045410156,"y":793.0666351318359,"wires":[["a0bbe4c3.23d4c8"]]},{"id":"a0bbe4c3.23d4c8","type":"ui_switch","z":"c28437b7.8fd6b8","name":"","label":"PV overproduction","group":"877ef039.77e1b8","order":2,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":537.5333404541016,"y":758.0666351318359,"wires":[[]]},{"id":"9e3d6423.83ec28","type":"ui_gauge","z":"c28437b7.8fd6b8","name":"kW","group":"877ef039.77e1b8","order":3,"width":0,"height":0,"gtype":"gage","title":"kW","label":"kW","format":"{{value}}","min":0,"max":"10","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":496.53334045410156,"y":795.0666351318359,"wires":[]},{"id":"877ef039.77e1b8","type":"ui_group","z":"","name":"Photovoltaik","tab":"927f7c64.b2c9c","order":2,"disp":true,"width":"6","collapse":false},{"id":"927f7c64.b2c9c","type":"ui_tab","z":"","name":"go-eCharger","icon":"ev_station","order":2}]

@frustreermeneer
Copy link

I had an issue where the device list wasn't being populated. This was due to one of my devices not being recognized by zigbee2mqtt and the Reformatforlist function in the Device List section of the flow had an error when the model info wasn't available. My quick fix was to change line 7 to this:
'icon': 'https://www.zigbee2mqtt.io/images/devices/WSDCGQ01LM.jpg' // + entry.model.replace(new RegExp('/', 'g'), '-') + '.jpg'

This makes everything have the same icon, but it populates the list. It's not a fix, but it gets it working.

This works for me and shows the correct icons:

'icon': 'https://www.zigbee2mqtt.io/images/devices/' + String(entry.model).replace("/","-") + '.jpg'

For some reason entry.model wasn't a string which has the replace method.

@LeonDragon
Copy link

I can not visualize my Zigbee network map (in node red dashboard), everything works fine except this: error: Cannot GET /z2mpanel/networkmap

The Networkmap from home assistant (custom_components just work fine)

Any help please?

@umatz
Copy link

umatz commented Jun 10, 2020

I can not visualize my Zigbee network map (in node red dashboard), everything works fine except this: error: Cannot GET /z2mpanel/networkmap

Same here. I noticed the following error in the debug pane of node-red:

msg : string[40]
Unexpected token g in JSON at position 0

zigbee2mqtt/bridge/networkmap/graphviz : msg.payload : string[1363]
digraph G {node[shape=record];  "0x00124b0018e1a982" [style="bold, filled", fillcolor="#e04e5d", fontcolor="#ffffff", label="{Coordinator|0x00124b0018e1a982 (0)|2020-06-10T17:48:21+02:00}"];  "0x00124b0018e1a982" -> "0x00124b001bdae87e" [penwidth=0.5, weight=0, color="#994444", label="1"]  "0x00158d000274356e" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{garage_klima|0x00158d000274356e (3583)|Xiaomi Aqara temperature, humidity and pressure sensor (WSDCGQ11LM)|2020-06-10T17:33:25+02:00}"];  "0x00158d000274356e" -> "0x00124b0018e1a982" [penwidth=1, weight=0, color="#994444", label="47"]  "0x00158d0002743694" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{dach_klima|0x00158d0002743694 (7868)|Xiaomi Aqara temperature, humidity and pressure sensor (WSDCGQ11LM)|2020-06-10T17:41:26+02:00}"];  "0x00158d0002743694" -> "0x00124b001bdae87e" [penwidth=1, weight=0, color="#994444", label="82"]  "0x00124b001bdae87e" ...

@umatz
Copy link

umatz commented Jun 13, 2020

Nevermind, after I imported the flow again it works.

@VascoW
Copy link

VascoW commented Sep 27, 2020

awesome piece of flow! Thumbs up.

One hiccup: when you rename your starting oint (i.e. zigbee instead of zigbee2mqtt) the device list doesn't work. It appears the mqtt path is hard coded to zigbee2mqtt?
Once renamed to default it all seems to work fine!

@Clamb94
Copy link

Clamb94 commented Oct 5, 2020

Great work, thanks.
Any chance to add QoS settings for each device? Thanks

@jimmyeao
Copy link

Have tried to install this twice now, It seems to be talking to my MQTT bridge but isn't populating any devices:
image

What logs should I be looking at here to troubleshoot?

@cbrandlehner
Copy link

Had the same issue. zigbee2mqtt changed some context. The list of devices is no longer in /bridge/log/ but instead in /bridge/config/

@frustreermeneer
Copy link

The latest zigbee2mqtt version can do the same, see:
https://www.zigbee2mqtt.io/information/frontend.html

It does look a bit different though...
Clipboard01

In Domoticz there is an extra tab that can do it as well.

@rekcodocker
Copy link

Had

I found the same thing. I filed an issue at Zigbee2Mqtt, suggesting they keep this change (it's more logical) and also log groups to a different channel.

They are probably not going to revert the behaviour to suit Z2M :) I looked into the code of Z2M but it's going too deep; I don't know how Z2M expects to interprete the device-list.
For the author it's an easy fix.

See issue here:

Koenkk/zigbee2mqtt#5289

@elenhinan
Copy link

I got it working with 1.16.2 by making some small changes to reflect the devices ending up in config instead of logs and the message format being slightly different. Uploaded the changed flow here: https://wordpress.myon.no/wp-content/uploads/2020/12/zigbee2mqtt_1.16.2_admin.zip

@minskicat
Copy link

Thankyou, was just tearing my hair out for last hour trying to fix this.

@arneman
Copy link

arneman commented Dec 27, 2020

It's a bit more work to fix this. I think they changed the whole log behavior / log api of Z2M. The obvious thing you see this is the device list, because it has been moved to the config topic now. But the "real" log messages look different now, too. EDIT: see Koenkk/zigbee2mqtt#3281

Just handling config/* messages like log messages before will result in random notifications (My first approach was the same like @elenhinan).
Status and loglevel are also broken.
"zigbee_publish_error" wont be handled anymore (i dont expect them to be in config topic).

The whole flow needs a little bit further rework because of the latest Z2M changes.

@mhelff maybe you can put the flow to a github repo that users can report issues and contribute ?

BTW:
To stop Z2M Admin from pushing (empty) notifications all the time, I removed the 2 connections at the bottom of the "log type" switch from @elenhinan (above). As said before, this doesn't really fix anything, just disabling the not working parts

@pitschi
Copy link

pitschi commented Feb 6, 2022

I updated the flow to work with the new zigbee2mqtt stuff. How can I push it?

@DocMors
Copy link

DocMors commented Aug 14, 2023

Hello not sure why this is but this is not longer available through the nodered palette management. Is there still a way to install this? Thanks Mike

apologies, after logging into github it actually showed the installation instructions

@cbrandlehner
Copy link

Since Zigbee2MQTT now has an excellent Interface the Node-Red dashboard should be obsolete.

@DocMors
Copy link

DocMors commented Aug 16, 2023

Agreed, I've reinstalled from scratch and found that out :) Funny it's about 4 years since I last touched the whole z2m/mqtt stuff, it was almost as if I've never done it before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment