diff --git a/grafana.json b/grafana.json new file mode 100644 index 0000000..f84b14d --- /dev/null +++ b/grafana.json @@ -0,0 +1,291 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 13, + "links": [], + "panels": [ + { + "datasource": { + "default": false, + "type": "influxdb", + "uid": "f110f59b-a1c0-4b41-ad7e-89f14edac426" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "f110f59b-a1c0-4b41-ad7e-89f14edac426" + }, + "query": "from(bucket: \"electricity\")\n |> range(start: -5m, stop: now())\n |> filter(fn: (r) => r[\"_measurement\"] == \"electricity\")\n |> filter(fn: (r) => r[\"_field\"] == \"consumption\")\n |> sum()\n |> map(fn: (r) => ({r with _value: float(v: r._value) * 12.0}))\n", + "refId": "A" + } + ], + "title": "Current consumption", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "influxdb", + "uid": "f110f59b-a1c0-4b41-ad7e-89f14edac426" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "watt" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "f110f59b-a1c0-4b41-ad7e-89f14edac426" + }, + "query": "from(bucket: \"electricity\")\n |> range(start: -7d, stop: now())\n |> filter(fn: (r) => r[\"_measurement\"] == \"electricity\")\n |> filter(fn: (r) => r[\"_field\"] == \"consumption\")\n |> aggregateWindow(every: 1d, fn: sum, createEmpty: false)\n", + "refId": "A" + } + ], + "title": "Last 7 days", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "influxdb", + "uid": "f110f59b-a1c0-4b41-ad7e-89f14edac426" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "f110f59b-a1c0-4b41-ad7e-89f14edac426" + }, + "hide": false, + "query": "from(bucket: \"electricity\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"electricity\")\n |> filter(fn: (r) => r[\"_field\"] == \"consumption\")\n |> aggregateWindow(every: 5m, fn: sum, createEmpty: false)\n |> map(fn: (r) => ({r with _value: float(v: r._value) * 12.0}))\n", + "refId": "A" + } + ], + "title": "5m average consumption", + "type": "timeseries" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Electricity consumption", + "uid": "fdzs456q503r4f", + "version": 13, + "weekStart": "" +}