New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new REST API endpoint for network map using DOT (graphviz) #4136
base: master
Are you sure you want to change the base?
Conversation
I have no clue on the code side, but this looks amazing. Thanks in advance! |
This is pretty cool, especially for headless setups. Note that there are always two LQI values between two routers and they can be quite different. |
Correct my self I see you already show two links :D |
Nice. What does the output look like? Is DOT based on JSON? |
I think it's even older than JSON, the examples give a good overview https://graphviz.org/Gallery/directed/bazel.html |
I like the functionality, but if it doesn't provide JSON output, it shouldn't be a REST API endpoint. |
The output looks like: digraph G { To my knowledge, a REST API (in general) is not limited to JSON. I also thought about putting the DOT representation inside JSON but this makes it much harder to process the output than it should be (e.g. dealing with newlines in DOT and extracting it from JSON to pipe it into graphviz). |
I think at a later stage there can be a call to enable and configure generation of the map via PUT. The map itself could be updated periodically and more importantly cached, so that not each GET call generates the map which perhaps can be costly in larger networks. Downloading non JSON content is okay as long as the MIME type is set correctly. Providing the network graph itself as JSON is also useful and on my personal plan, but that will be another endpoint. |
hi, this looks like a great idea !!! indeed related to my feature request #4326 perfect for headless setups and not touching the device hosting the GW |
Hello, any news about if this can be integrated ? would love to see this. Thank you and best regards. |
this is cool. i did a manual build of this and it's just great to use it on headless systems. integration is easy and it works great. |
Hi, any news on this? I need the LQI-data for my sensors using REST. |
Can this be merged anytime soon? |
Hi,
I created a new endpoint for the REST API that delivers the current network map (using Node::neighbors()) in the DOT language (similar to what Zigbee2MQTT can do). This graph representation can be easily converted to an image using graphviz, for example by passing it directly to dot, circo, etc.
I also added some GET-parameters, that allow the user to change some colors.
Example:
$ curl http://192.168.178.49:8080/api/<API_KEY>/map | circo -Gratio=0.56 -Tsvg -o map.svg
leads for my zigbee network to