zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Visualise ZigBee network

Open 57k opened this issue 8 years ago • 28 comments

Hi everybody, in order to understand my current Zigbee Network more easily, I would like to use a simple software, that can visualize my network. Which tools are you using? Thanks in advance Jens

57k avatar Sep 28 '18 06:09 57k

You can use: http://www.webgraphviz.com/

Koenkk avatar Sep 28 '18 07:09 Koenkk

Does this mean, zigbee2mqtt can output the structure of the Zigbee network as graphviz? What is the command for it?

avanc avatar Sep 28 '18 19:09 avanc

just publish via mqtt

zigbee2mqtt/bridge/networkmap

the value

graphviz

at the same time subscribe to

zigbee2mqtt/bridge/networkmap/graphviz

my next problem is that I do not get all attached devices.

57k avatar Sep 28 '18 20:09 57k

I think it'd be easier to read the graphs if the friendly names were used as labels (vs. the numerical code). Does it make sense?

kimonm avatar Sep 28 '18 23:09 kimonm

I think it'd be easier to read the graphs if the friendly names were used as labels (vs. the numerical code). Does it make sense?

https://github.com/Koenkk/zigbee2mqtt/commit/845a5cdce89c69dbeb3e1303f7d9496c6e58f295

;)

thomasvt1 avatar Sep 29 '18 08:09 thomasvt1

@kimonm it's already in the dev branch (will be in new zigbee2mqtt release)

Koenkk avatar Sep 29 '18 20:09 Koenkk

Graphviz only shows 11 from 20 devices and the routers are shown as normal devices and not routers.

kaelsaes avatar Sep 30 '18 07:09 kaelsaes

Hi, I used this command:

mosquitto_sub -h $MQTT_SRV -C 1 -t zigbee2mqtt/bridge/networkmap/graphviz | sfdp -Tpng > /tmp/map.$(date +%Y%m%d%H%M%S).png

It's created a image file in tmp folder, but nothing in there (0 KB).

mrfoxbit avatar Oct 05 '18 07:10 mrfoxbit

just publish via mqtt

zigbee2mqtt/bridge/networkmap

the value

graphviz

at the same time subscribe to

zigbee2mqtt/bridge/networkmap/graphviz

my next problem is that I do not get all attached devices.

tried this, but in logfile i get zigbee2mqtt:warn 2018-10-5 18:05:50 Cannot handle MQTT message with topic 'zigbee2mqtt/bridge/networkmap' and message 'graphviz

do i need to install anything extra, i am using the latest-dev docker image

aidbish avatar Oct 05 '18 08:10 aidbish

@hoangtuit does the command return immediatly ? you don't have to ctrl-c it do you ? what's the result of mosquitto_sub -h $MQTT_SRV -C 1 -t zigbee2mqtt/bridge/networkmap/graphviz when you send the graphviz command ? it should output graphviz text data that you could either use with graphviz commands or http://www.webgraphviz.com/

@aidbish looks like your not running the latest version (1.0.6 atm) sorry but I'm clueless about docker.

lolorc avatar Oct 05 '18 08:10 lolorc

it was the formatting of my publish command that was incorrect i now can see a scan starting in the logs, but it finishes within 1 second and nothing is shown if i subscribe to the topic

i have tried the following sub commands

mosquitto_sub -h 10.0.0.18 -C 1 -t zigbee2mqtt/bridge/networkmap/graphviz

mosquitto_sub -h 10.0.0.18 -C 1 -t zigbee2mqtt/bridge/networkmap/graphviz | sfdp -Tpng | display -

i have to ctrl-c as they never seem to complete

aidbish avatar Oct 05 '18 08:10 aidbish

@lolorc the command don't return. When i run graphviz command

mosquitto_sub -h $MQTT_SRV -C 1 -t zigbee2mqtt/bridge/networkmap/graphviz

Nothing to return. I have 1 coordinator and 10 devices in my network

mrfoxbit avatar Oct 05 '18 08:10 mrfoxbit

Are you both using dev with the latest commits ? if so, a bug has be introduced with the latest network map change (display friendlyname). You might want to check my PR to see if it fixes it https://github.com/Koenkk/zigbee2mqtt/pull/443 or you can also edit https://github.com/Koenkk/zigbee2mqtt/blob/dev/lib/extension/networkMap.js#L41 and replace

const friendlyName = settings.getDevice(item.ieeeAddr).friendly_name;

by

const friendlyName = settings.getDevice(item.ieeeAddr) ? settings.getDevice(item.ieeeAddr).friendly_name : "";

lolorc avatar Oct 05 '18 09:10 lolorc

I did. But nothing happened.

mrfoxbit avatar Oct 05 '18 16:10 mrfoxbit

dunno what you did :-) but you might want to join some debug log.

lolorc avatar Oct 05 '18 16:10 lolorc

My stupid, It worked. Tks @lolorc

mrfoxbit avatar Oct 05 '18 16:10 mrfoxbit

Are you both using dev with the latest commits ? if so, a bug has be introduced with the latest network map change (display friendlyname). You might want to check my PR to see if it fixes it #443 or you can also edit https://github.com/Koenkk/zigbee2mqtt/blob/dev/lib/extension/networkMap.js#L41 and replace

const friendlyName = settings.getDevice(item.ieeeAddr).friendly_name;

by

const friendlyName = settings.getDevice(item.ieeeAddr) ? settings.getDevice(item.ieeeAddr).friendly_name : "";

Yes i was using latest dev version, gone back to stable and can now generate network map

aidbish avatar Oct 05 '18 22:10 aidbish

@aidbish it should be better with latest dev now

@kaelsaes I also had devices not displayed on the network map, with latest dev they would appear unlinked. I've just repaired my unlinked devices and I can now see them linked on the network map. (the pairing process is kinda picky with cc253x)

lolorc avatar Oct 08 '18 22:10 lolorc

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 07 '18 22:12 stale[bot]

worked great with http://www.webgraphviz.com.

Is there a way to visualize this directly in home assistant. Maybe someone here already did this?

hassio; zigbee2mqtt addon

h4nc avatar Dec 23 '18 07:12 h4nc