Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/happyleavesaoc/home-assistant-graph
https://github.com/happyleavesaoc/home-assistant-graph
graphviz home-assistant home-assistant-config
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/happyleavesaoc/home-assistant-graph
- Owner: happyleavesaoc
- License: mit
- Created: 2017-02-03T01:30:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-15T17:50:07.000Z (over 7 years ago)
- Last Synced: 2024-09-30T08:04:43.587Z (4 months ago)
- Topics: graphviz, home-assistant, home-assistant-config
- Language: Python
- Size: 90.8 KB
- Stars: 30
- Watchers: 8
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# home-assistant-graph [![PyPI version](https://badge.fury.io/py/hagraph.svg)](https://badge.fury.io/py/hagraph)
![Graph](graph-example.png)
## Demo
https://happyleavesaoc.github.io/hagraph.html
## Install
Install `graphviz`:
```
yum install graphviz graphviz-devel # RHEL/CentOS
apt-get install graphviz graphviz-dev # Ubuntu/Rasbian
```Install `hagraph`:
`pip install hagraph`Errors about `pygraphviz`? Try:
`pip install git+https://github.com/pygraphviz/pygraphviz.git --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"`
## Run
`python3 -m hagraph -i -o `
## Suggested Integration
### Home Assistant Configuration
```yaml
panel_iframe:
graph:
title: Graph
icon: mdi:vector-polyline
url: "https://your.hass/local/graph.html"shell_command:
generate_graph: "python3 -m hagraph -i -o graph.svg"automation:
- alias: Generate graph
trigger:
platform: event
event_type: homeassistant_start
action:
- service: shell_command.generate_graph
```### graph.html
In your `/www`:
```html
body { margin: 0; padding: 0; }
window.onload = function() {
svgPanZoom('#graph', {
controlIconsEnabled: false,
zoomScaleSensitivity: 0.7,
minZoom: 1
});
};
```
Be sure to get [svg-pan-zoom.min.js](https://github.com/ariutta/svg-pan-zoom) as well.