Grafana
Revision as of 16:08, 7 October 2023 by Torben (talk | contribs) (→Convert cummulated kWh data to hourly or daily differences)
Install on Raspberry Pi in Raspbian
Howto: [1]
fetch newest release from [2] -> Ubuntu & Debian(ARMv7)
wget https://dl.grafana.com/oss/release/grafana_6.2.5_armhf.deb sudo dpkg -i grafana_6.2.5_armhf.deb sudo apt-get update sudo apt-get install grafana sudo apt --fix-broken install
in /etc/grafana/grafana.ini set the admin user and password
- Start Grafana by running:
sudo service grafana-server start
Autostart at boot time
sudo systemctl enable grafana-server.service sudo update-rc.d grafana-server defaults
default port: http://raspi:3000
Queries
Display Table of Influx DB data field "active" contains 1 if a given "hostname" is online Query
WHERE time > now()-5m and field(active) != null SELECT field(active) distinct() alias(online) GROUP BY time($__interval), tag(hostname) FORMAT AS Table Min time interval = 5m
Visualization
Column Style -> Type Hidden for columns named online
Convert cummulated kWh data to hourly or daily differences
SELECT spread("kWh_total") FROM "Shelly3" WHERE ("room"::tag =~ /^$room$/) AND $timeFilter GROUP BY time($__interval) fill(null)
With "Query Options" -> "Min interval"=1h or 1d and maybe "Relative time" = now-7d
Color of fill area based on threshold (e.g. red for negative values)
Gradient mode -> Schema Color scheme -> From threshold Fill opacity -> 25