D3-graphviz monitoring a smart home zigbee network

As part of a raspberry pi smart home github repository, the zigbee/graph_view directory has a self contained web app to monitor a zigbee network

Projects github repo

Used dependencies

The link between the two is that the latest on MQTT request, answers with a dot language graph of the zigbee network.

It’s important to note that this is not to be used for a generic zigbee network (I wish zigbee sniffers adopt such functionality), but this feature is provided for devices joining the zigbee2mqtt network, which is by the way a great project that frees most of the available zigbee devices of their vendors lock in so that you can use them in your own MQTT environment and prevents useless duplication of gateway HW.

here an example of dot language graph
[dot verbose=true fit=true scale=0.5]

digraph G {
node[shape=record];
"0x00124b001d4a014b" [style="bold, filled", fillcolor="#e04e5d", fontcolor="#ffffff", label="{power lifo|0x00124b001d4a014b (0)|2020-06-11T11:12:06+02:00}"];
"0x00124b001d4a014b" -> "0x00124b001c2f1279" [penwidth=0.5, weight=0, color="#994444", label="82"]
"0xccccccfffee20ebd" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{tv button|0xccccccfffee20ebd (63571)|IKEA TRADFRI ON/OFF switch (E1743)|2020-06-11T04:32:53+02:00}"];
"0xccccccfffee20ebd" -> "0x00124b001d4a014b" [penwidth=1, weight=0, color="#994444", label="129"]
"0x00158d0001922d4f" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{bedroom heat|0x00158d0001922d4f (33527)|Eurotronic Thermostat|2020-06-11T11:07:31+02:00}"];
"0x00158d0001922d4f" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="84"]
"0x00158d0001922ce9" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{kitchen heat|0x00158d0001922ce9 (28534)|Eurotronic Thermostat|2020-06-11T11:12:00+02:00}"];
"0x00158d0001922ce9" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="79"]
"0x00158d000192dd3e" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{living heat|0x00158d000192dd3e (8691)|Eurotronic Thermostat|2020-06-11T10:40:05+02:00}"];
"0x00158d000192dd3e" -> "0x00124b001d4a014b" [penwidth=1, weight=0, color="#994444", label="115"]
"0x00124b001c2f1279" [style="rounded, filled", fillcolor="#4ea3e0", fontcolor="#ffffff", label="{power router|0x00124b001c2f1279 (54705)|CC2530.ROUTER|2020-06-11T11:11:07+02:00}"];
"0x00124b001c2f1279" -> "0x00124b001d4a014b" [penwidth=0.5, weight=0, color="#994444", label="87"]
"0x00158d0004240973" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{office window right|0x00158d0004240973 (62909)|Aqara contact MCCGQ11LM|2020-06-11T10:54:44+02:00}"];
"0x00158d0004240973" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="75"]
"0x00158d00041a3b31" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{kitchen window|0x00158d00041a3b31 (14027)|Aqara contact MCCGQ11LM|2020-06-11T11:00:34+02:00}"];
"0x00158d00041a3b31" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="105"]
"0x00158d0004237aad" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{office window left|0x00158d0004237aad (30339)|Aqara contact MCCGQ11LM|2020-06-11T10:51:44+02:00}"];
"0x00158d0004237aad" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="116"]
"0x00158d0002476b04" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{office weather|0x00158d0002476b04 (41726)|Aqara weather WSDCGQ11LM|2020-06-11T11:11:24+02:00}"];
"0x00158d0002476b04" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="78"]
"0x00158d00028f7fb5" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{office switch|0x00158d00028f7fb5 (16806)|Aqara wall switch WXKG03LM|2020-06-11T10:51:07+02:00}"];
"0x00158d00028f7fb5" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="83"]
"0x00158d00041a3bfe" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{bedroom window|0x00158d00041a3bfe (779)|Aqara contact MCCGQ11LM|2020-06-11T11:10:24+02:00}"];
"0x00158d00041a3bfe" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="119"]
"0x00158d0001922d10" [style="rounded, dashed, filled", fillcolor="#fff8ce", fontcolor="#000000", label="{bathroom heat|0x00158d0001922d10 (33522)|Eurotronic Thermostat|2020-06-11T11:10:48+02:00}"];
"0x00158d0001922d10" -> "0x00124b001c2f1279" [penwidth=1, weight=0, color="#994444", label="60"]
}

[/dot]

Such graphviz integrations are extremely helpful when someone is debugging a network with iot devices that constantly increase in number.

1 Like