Grafana for Volkszaehler
gravo - Grafana for Volkszaehler - is an adapter for using Grafana with Volkszaehler.
While it is possible to run Grafana against the Volkszaehler database directly using the Grafana MySQL datasource, gravo supports additional features:
Install Volkszaehler
Install Grafana and the JSON Datasource plugin. Simple JSON Datasource will also work but not allow you to specify additional query parameters.
gravo can either be run using docker or built manually:
docker run -p 8000:8000 andig/gravo -api http://myserver/middleware.php
Building and running gravo manually:
make
gravo -api http://myserver/middleware.php -url 0.0.0.0:8000
Create a Grafana Simple JSON Datasource and point it to gravo running on machine and port chosen before:
http://gravo-host:8000
To use gravo for querying Volkszaehler data. Create Grafana panels for gravo datasource and add metrics:
Using the JSON Datasource, the Volkszaehler query can further be tailored by adding “Additional JSON Data”:
To override the UUID with the channel name add:
{"name": "channel title"}
Volkszaehler can generate aggregated/averaged data by time period:
{"group": "hour/day/month"}
To improve Volkszaehler response times gravo is able to optimize queries. In order to do so the number of expected result tuples can be specified. If not specified Volkszaehler will return data in highest resultion which can potentially be millions of records:
{"tuples": 500}
This requires active data aggreation in the Volkszaehler installation.
Volkszaehler can also return “raw”, uninterpreted data which is e.g. useful for retrieving meter reading values or meters pulses without pulse to power conversion. Use the following to return daily consumption values:
{"options": "raw"}
"options"
can also be used to send other options that the Volkszaehler middleware accepts. One example is retrieving consumption data per period:
{
"group": "day",
"options": "consumption"
}
Note: consumption data requires volkszaehler next (andig/volkszaehler.org)
Below is an example of a complex Grafana dashboard for Volksaehler:
See json for the example dashboard source.