This is a little project that takes your configuration.yaml and makes a graph based on the relationships between your components and entities. It’s a nice way to visualize your automations. I was able to identify many changes to make in my configuration based on what I saw on the graph.
I know this tool works on my config. It might not work on yours. If it doesn’t, paste the error here and if possible, link to your config.
Very cool… I’m getting an error when attempting to run:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pygraphviz/agraph.py", line 1289, in _get_prog
runprog = self._which(prog)
File "/usr/local/lib/python3.5/site-packages/pygraphviz/agraph.py", line 1523, in _which
raise ValueError("No prog %s in path." % name)
ValueError: No prog neato in path.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.5/site-packages/hagraph/__main__.py", line 30, in <module>
main()
File "/usr/local/lib/python3.5/site-packages/hagraph/__main__.py", line 26, in main
to_agraph(graph).draw(args.get('output_file'), prog=args.get('prog'))
File "/usr/local/lib/python3.5/site-packages/pygraphviz/agraph.py", line 1469, in draw
data = self._run_prog(prog, args)
File "/usr/local/lib/python3.5/site-packages/pygraphviz/agraph.py", line 1304, in _run_prog
runprog = r'"%s"' % self._get_prog(prog)
File "/usr/local/lib/python3.5/site-packages/pygraphviz/agraph.py", line 1291, in _get_prog
raise ValueError("Program %s not found in path." % prog)
ValueError: Program neato not found in path.
That did it, thanks! Also, the www folder… Should that exist already? I’m running in a docker container so the location differs a bit and I’m not seeing it.
so how does this work, does it read your yaml files or does it look at the events table in the history database? Just trying to decide if it would work for me since 90% of my automations are in AppDaemon and are driven by group memberships, not hard coded.
I’ve successfully installed hagraph, however, when runnign it, I get the error ValueError: no server
Full trace:
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/PlexMediaServer/hass/lib/python3.4/site-packages/hagraph/__main__.py", line 30, in <module>
main()
File "/PlexMediaServer/hass/lib/python3.4/site-packages/hagraph/__main__.py", line 25, in main
graph = make_graph(conf)
File "/PlexMediaServer/hass/lib/python3.4/site-packages/hagraph/__init__.py", line 236, in make_graph
add_core_edges(conf, graph)
File "/PlexMediaServer/hass/lib/python3.4/site-packages/hagraph/__init__.py", line 200, in add_core_edges
add_script(name, data, graph)
File "/PlexMediaServer/hass/lib/python3.4/site-packages/hagraph/__init__.py", line 170, in add_script
graph.add_edge(script_entity, target, label=get_service(step))
File "/PlexMediaServer/hass/lib/python3.4/site-packages/hagraph/__init__.py", line 125, in get_service
raise ValueError('no service')
ValueError: no service
Any ideas why this might happen? Also, my config is split up, maybe that’s why it doesn’t work?
I’ve added a quick print in the failing steps, it seems it fails on a dummy sensor I have, which only gets populated after I activated a script.
I’ve added the print at line 170 from init.py (printing the step), and it shows me this: OrderedDict([('condition', 'numeric_state'), ('entity_id', 'sensor.new_commits'), ('above', 1)])
perhaps it’s helpful to figure out the issue
Well, since I only recently started with H and don’t have a lot of stuff to integrate yet, I’ve got some default and dummy stuff configured, but almost nothing is connected yet,
seeing these items as single entries in the graph would show that they are tracked as well (since they are configured after all).
Perhaps as an optional parameter to include those entries so it’s not included by default, that way people can choose wether they want it or not