Graph your Z-Wave mesh automatically from within Home Assistant.
I wish they had a GitHub repository, but this gist seems to have the magic: https://gist.github.com/AdamNaj/cbf4d792a22f443fe9d354e4dca4de00
CREATE TOKEN(at the bottom)
config/shell_commands/z-wave-graph.yamlno longer tries to guess where the appropriate Python 3 is. Replace
/FULL/PATH/TO/HA's/python3with the correct path.
http://localhost:8123then you need to add
Docker Imagesection below.
--portflags have been removed. Set your
base_urlappropriately and it will work.
--sslto your invocation if your HA uses SSL directly (i.e. not through a proxy).
config/www/svg-pan-zoom.min.jsis no longer needed, you may delete it.
networkx Python module from INSIDE your venv if you use one:
(venv-hass) [email protected]: pip3 install networkx
Requires the following secret for the iframe url:
The Python script loads your HA configuration to try to pull out the details it needs. Some installations require more tweaks. See
~/z-wave-graph/bin/z-wave-graph.py --help for command line options.
Put all the files in their correct location (assuming you're using a split configuration):
automation: !include_dir_merge_list automations/ shell_command: !include_dir_merge_named shell_commands/ panel_iframe: !include_dir_merge_named panel_iframe/
Otherwise you will have to put the fiddly bits into the right place by hand.
Thanks to a diligent HA forum member the mystery of the script not running in Docker images has been solved. One fix is in the code. The other you will have to apply at your end to the
z_wave_graph: /usr/local/bin/python3 /config/**<YOUR-PATH>**/z-wave-graph.py
By default it is suppose to run every 5 minutes (
config/automations/z-wave-graph.yaml) loading the current Z-Wave mesh. I experimented with on startup and shutdown, but the Z-Wave mesh did not exist at that point so the results were wrong.
The graph is draggable and zoomable (mouse wheel).
The top node should be your Z-Wave controller, identified by primaryController in capabilities.
All nodes have mouse-over information with details. A + after the Node: id indicates a Z-Wave plus device.
The diffent levels should correspond to the hops in your mesh. You can click on a node to hilight the possible routes through other nodes.
Any battery powered devices will be rectangles and will have their battery level percent displayed in the mouse-over.
The nodes and their neighbors are pulled from the HA API. networkx is then used to find all the shortest paths for each node back to the Z-Wave hub. Those edges are then graphed.
This only shows the route possibilites as there is no way to know exactly what route any particular node uses.
Note: originally based on home-assistant-graph so parts may look very familiar