From 10a21fb35c965e786d62fec4c261ac03a1a86140 Mon Sep 17 00:00:00 2001 From: David Keen Date: Thu, 7 Nov 2024 07:39:21 +1100 Subject: [PATCH] Release 3.4.3: Fix Grafana dashboard to align with db schema change --- pom.xml | 2 +- src/main/resources/grafana/Solar.json | 249 +++++++++++++++++++------- 2 files changed, 190 insertions(+), 61 deletions(-) diff --git a/pom.xml b/pom.xml index 25ac51c..256436d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.keen solar - 3.4.2 + 3.4.3 solar Retrieves solar data from a Fronius inverter and persists it to a data store. diff --git a/src/main/resources/grafana/Solar.json b/src/main/resources/grafana/Solar.json index c53d0f1..cb6bb91 100644 --- a/src/main/resources/grafana/Solar.json +++ b/src/main/resources/grafana/Solar.json @@ -21,13 +21,13 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "10.1.2" + "version": "11.3.0" }, { "type": "datasource", "id": "mysql", "name": "MySQL", - "version": "1.0.0" + "version": "11.3.0-pre" }, { "type": "panel", @@ -63,7 +63,6 @@ "graphTooltip": 0, "id": null, "links": [], - "liveNow": false, "panels": [ { "datasource": { @@ -122,8 +121,9 @@ "y": 0 }, "id": 6, - "links": [], "options": { + "minVizHeight": 75, + "minVizWidth": 75, "orientation": "horizontal", "reduceOptions": { "calcs": [ @@ -134,20 +134,22 @@ }, "showThresholdLabels": false, "showThresholdMarkers": true, + "sizing": "auto", "text": {} }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_SOLAR_APP DB}" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n inverter_epoch_timestamp AS \"time\",\n generation + consumption as \"available power\"\nFROM current_power\nWHERE\n $__unixEpochFilter(inverter_epoch_timestamp)\nORDER BY inverter_epoch_timestamp", + "rawSql": "SELECT\n epoch_timestamp AS \"time\",\n generation + consumption as \"available power\"\nFROM current_power\nWHERE\n $__unixEpochFilter(epoch_timestamp)\nORDER BY epoch_timestamp", "refId": "A", "select": [ [ @@ -159,6 +161,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "current_power", "timeColumn": "timestamp", "timeColumnType": "timestamp", @@ -205,18 +224,18 @@ }, "gridPos": { "h": 3, - "w": 4, + "w": 3, "x": 12, "y": 0 }, "id": 11, - "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -224,21 +243,24 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_SOLAR_APP DB}" }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT sum(generation)/3600\nFROM current_power\nWHERE $__unixEpochFilter(inverter_epoch_timestamp)", + "rawSql": "SELECT sum(generation)/3600\nFROM current_power\nWHERE $__unixEpochFilter(epoch_timestamp)", "refId": "A", "select": [ [ @@ -250,6 +272,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -294,18 +333,18 @@ }, "gridPos": { "h": 3, - "w": 4, - "x": 16, + "w": 3, + "x": 15, "y": 0 }, "id": 12, - "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -313,21 +352,24 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_SOLAR_APP DB}" }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT -sum(consumption)/3600\nFROM current_power\nWHERE $__unixEpochFilter(inverter_epoch_timestamp)", + "rawSql": "SELECT -sum(consumption)/3600\nFROM current_power\nWHERE $__unixEpochFilter(epoch_timestamp)", "refId": "A", "select": [ [ @@ -339,6 +381,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -385,18 +444,18 @@ }, "gridPos": { "h": 3, - "w": 4, - "x": 12, - "y": 3 + "w": 3, + "x": 18, + "y": 0 }, "id": 13, - "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -404,21 +463,24 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_SOLAR_APP DB}" }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT (sum(generation)+sum(consumption))/3600\r\nFROM current_power\r\nWHERE $__unixEpochFilter(inverter_epoch_timestamp)\r\nAND (generation + consumption) > 0", + "rawSql": "SELECT (sum(generation)+sum(consumption))/3600\r\nFROM current_power\r\nWHERE $__unixEpochFilter(epoch_timestamp)\r\nAND (generation + consumption) > 0", "refId": "A", "select": [ [ @@ -430,6 +492,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -475,18 +554,18 @@ }, "gridPos": { "h": 3, - "w": 4, - "x": 16, - "y": 3 + "w": 3, + "x": 21, + "y": 0 }, "id": 14, - "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -494,21 +573,24 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_SOLAR_APP DB}" }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT -(sum(generation)+sum(consumption))/3600\r\nFROM current_power\r\nWHERE $__unixEpochFilter(inverter_epoch_timestamp)\r\nAND (generation + consumption) < 0", + "rawSql": "SELECT -(sum(generation)+sum(consumption))/3600\r\nFROM current_power\r\nWHERE $__unixEpochFilter(epoch_timestamp)\r\nAND (generation + consumption) < 0", "refId": "A", "select": [ [ @@ -520,6 +602,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -545,11 +644,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -597,7 +698,7 @@ "h": 8, "w": 12, "x": 12, - "y": 6 + "y": 3 }, "id": 16, "options": { @@ -612,7 +713,7 @@ "sort": "none" } }, - "pluginVersion": "8.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -693,11 +794,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -816,7 +919,6 @@ }, "hideTimeOverride": true, "id": 8, - "interval": "", "options": { "legend": { "calcs": [], @@ -829,7 +931,7 @@ "sort": "none" } }, - "pluginVersion": "8.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -897,11 +999,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -966,7 +1070,7 @@ "h": 9, "w": 12, "x": 12, - "y": 14 + "y": 11 }, "id": 2, "options": { @@ -986,18 +1090,19 @@ "sort": "none" } }, - "pluginVersion": "8.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_SOLAR_APP DB}" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n inverter_epoch_timestamp AS \"time\",\n generation\nFROM current_power\nWHERE\n $__unixEpochFilter(inverter_epoch_timestamp)\nORDER BY inverter_epoch_timestamp", + "rawSql": "SELECT\n epoch_timestamp AS \"time\",\n generation\nFROM current_power\nWHERE\n $__unixEpochFilter(epoch_timestamp)\nORDER BY epoch_timestamp", "refId": "A", "select": [ [ @@ -1009,6 +1114,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "current_power", "timeColumn": "inverter_epoch_timestamp", "timeColumnType": "bigint", @@ -1036,11 +1158,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -1136,7 +1260,6 @@ }, "hideTimeOverride": true, "id": 9, - "interval": "", "options": { "legend": { "calcs": [], @@ -1149,7 +1272,7 @@ "sort": "none" } }, - "pluginVersion": "8.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1217,11 +1340,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -1301,7 +1426,7 @@ "h": 8, "w": 12, "x": 12, - "y": 23 + "y": 20 }, "id": 4, "options": { @@ -1321,18 +1446,19 @@ "sort": "none" } }, - "pluginVersion": "8.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_SOLAR_APP DB}" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n inverter_epoch_timestamp AS \"time\",\n -consumption\nFROM current_power\nWHERE\n $__unixEpochFilter(inverter_epoch_timestamp)\nORDER BY inverter_epoch_timestamp", + "rawSql": "SELECT\n epoch_timestamp AS \"time\",\n -consumption\nFROM current_power\nWHERE\n $__unixEpochFilter(epoch_timestamp)\nORDER BY epoch_timestamp", "refId": "A", "select": [ [ @@ -1344,6 +1470,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "current_power", "timeColumn": "inverter_epoch_timestamp", "timeColumnType": "bigint", @@ -1361,8 +1504,7 @@ } ], "refresh": "10s", - "schemaVersion": 38, - "style": "dark", + "schemaVersion": 40, "tags": [], "templating": { "list": [] @@ -1371,23 +1513,10 @@ "from": "now/d", "to": "now" }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, + "timepicker": {}, "timezone": "", "title": "Solar", "uid": "rOPWd5uWz", - "version": 7, + "version": 9, "weekStart": "" } \ No newline at end of file