Zigbee2mqtt: show the networkmap in home assistant

youre right. you can add the fontname to the diagraph.

i´ve added

src = src.replace(“digraph G { node[shape=record”, “digraph G { graph [fontname = "Arial"]; edge [fontname = "Arial"]; node[shape=record fontname = "Arial"”);

to line 289 of viz.js and it works fine.

adding a function to map.html works also:

   function changeFont() {
      var texts = document.getElementsByTagName("text");
      for (var i = 0; i < texts.length; i++) {
        texts[i].attributes["font-family"].nodeValue = "Arial, sans-serif";
        texts[i].attributes["font-size"].nodeValue = texts[i].attributes["font-size"].nodeValue-1;
        texts[i].attributes["fill"].nodeValue = "#212121";
      }

I recently updated added a network key to my configuration. Because you need to re-pair all the devices again, I also updated my coordinator and router firmwares.

I also switched back to the standard version of zigbee2mqtt (because this one auto updates itself).

Before all of this I always had a map like the one shown by @Silicon_Avatar above.

Currently I get a map with a lot devices that are not linked at all, but they still work.
So I switched back to edge, as this is recommended above, but I still get this map (updated).

Does it take a while to show the mesh again?

Well a few days ago dev branch was the same as master, so there was no difference with edge (which follows dev, why TF the author of the addon didn’t call edge dev is a mystery). So you’ll see little difference at present.

But I reinstalled edge, so it should be the dev branch again, right?
Or is current edge = master.
I’m confused as you say “was the same”

EDIT: What can I do to fix this?

What I perhaps should have said is that master was updated a few days ago to dev, ie all the experimental stiff from edge was incorporated into the stable version, So at that point there would be no difference between the 2 addon versions. A few days later and dev says it is 19 commits (ie code changes) ahead of master.

Anyway, my point is that you shouldn’t get too much difference between edge and stable now, perhaps post a shot of your network map so someone can see what the problem might be. also the zigbee2mqtt log shows what code is generated when a map is generated, so that is likely to be illuminating.

I see. The log of a device that is not connected to any other device in the map looks like this (I think it’s not necessary to post the ful log):

"0xID1" [style="rounded, dashed", label="{Zigbee Button|EndDevice|Xiaomi Aqara wireless switch (WXKG11LM)|online}"];

One that is connected looks like this:

"0xID2" [style="rounded, dashed", label="{Zigbee Fenster SZ|EndDevice|Xiaomi Aqara door &amp; window contact sensor (MCCGQ11LM)|online}"]; "0xID2" -&gt; "0xID_COORD" [label="50"]

I changed the ID’s to ID1 ID2 and ID_COORD.

Does it take some time to get all of the data of the devices? As I said my coordinator got a new firmware some days ago and I re-paired all the devices yesterday.

For sure, mesh networks can take some time to build, and are constantly changing (or perhaps more accurately, have the capacity to constantly change).

However “yesterday” should be long enough to get everything rebuilt.

In my system, the every device that is connected gets two lines, one descibing the device, and another it’s connection. eg:

  "0x00158d00024def2d" [style="rounded, dashed", label="{0x00158d00024def2d|EndDevice|Xiaomi Aqara human body movement and illuminance sensor (RTCGQ11LM)|online}"];
  "0x00158d00024def2d" -> "0x00124b0012013c5a" [label="81"]

That second line is the connection from that device to the co-ordinator, with a signal strength of 81.

I edited the example above, the working sensor also has two lines.

However I have 5 of 14 devices that ave no second line, so they don’t show as connected.

I never had issues before setting the key, updating the firmware and repairing.
Hard to say now which step caused this.

Edit:
I opened an issue https://github.com/Koenkk/zigbee2mqtt/issues/1001

It would also be interesting to know if the connections are also missing in the “raw” map.

Small improvement: It is now possible to change the engine via a dropdown.

What browser are you using for the Engine: part?

I updated the html page but in firefox 65.0 all that part is not visible.
Also the characters inside the rectangles are much bigger. they go out of the rectangle.

This is most likely a problem with the browser cache, try to clear it.
I also have the problem with the characters outside the rectangle on the mobile phone, but not on the laptop. Unfortunately I have no influence on it.

Yes, clearing the browser cache fixed the data field. Not the rectangle thing.
fonts type unavailable?

I’m trying this but get an error about permission but the file “source.js” doesn’t even exist.

2019-02-03 12:12:48 ERROR (MainThread) [custom_components.zigbee2mqtt_networkmap] Exception in message_received when handling msg on 'zigbee2mqtt/bridge/networkmap/graphviz': 'digraph G {
node[shape=record];
  "0x00124b001936b4ad" [style="bold", label="{0x00124b001936b4ad|Coordinator|No model information available|online}"];
  "0x00158d0002795a74" [style="rounded, dashed", label="{Aqara Water 1|EndDevice|Xiaomi Aqara water leak sensor (SJCGQ11LM)|online}"];
  "0x00158d0002795a74" -> "0x00124b001936b4ad" [label="170"]
  "0x00158d00027b086a" [style="rounded, dashed", label="{Aqara Water 2|EndDevice|Xiaomi Aqara water leak sensor (SJCGQ11LM)|online}"];
  "0x00158d00027b086a" -> "0x00124b001936b4ad" [label="22"]
  "0x00124b001936b47c" [style="rounded", label="{Router 1|Router|Custom devices (DiY) [CC2530 router](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/) (CC2530.ROUTER)|online}"];
  "0x00124b001936b47c" -> "0x00124b001936b4ad" [style="dashed", label="0"]
<...cut....>
}'
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/zigbee2mqtt_networkmap.py", line 31, in message_received
    f = open(hass.config.path('www', 'zigbee2mqtt_networkmap', 'source.js'),"w")
PermissionError: [Errno 13] Permission denied: '/home/homeassistant/.homeassistant/www/zigbee2mqtt_networkmap/source.js'

The component writes the dot string returned by zigbee2mqtt to the source.js file. It looks like the user running your Homeassistant instance has no write permission to the www folder.

1 Like

Thanks! It works now. Change the rights from root to homeassistant.

Thanks! Great component!!!

I just migrated everything off my Xiaomi Hub to Zigbee2mqqt and this is perfect for monitoring the mesh. I have 7 battery powered Xiaomi devices and I put one of my Hue bulbs on it as a router. In two minds to move my 27 hue bulbs over as i use hue scenes a lot, but this map is excellent!

Thanks again for all your hard work!

Thanks for making the component better and better.

Still it would be really nice if you would add it to custom updater.
To that we could follow your updates easier. I’m not a dev but it seems like it isn’t that much work to implement that.

@Robin I brought this to the opened issue, so if you interessted see:

2 Likes

Love this network map! Great work Robin!
Would it be difficult to have an option to post the friendly name vs the entity ID?

Having just installed custom updater, I agree :slight_smile:
+1 for this.

Is it just me or the map isn’t updating with the 0.89.
There have been some structural changes in regards with custom components, is this the reason?