diff --git a/energy_dashboard.json b/energy_dashboard.json index 1749f8f..d3a54db 100644 --- a/energy_dashboard.json +++ b/energy_dashboard.json @@ -132,6 +132,8 @@ "measurement": "electricity", "orderByTime": "ASC", "policy": "default", + "query": "SELECT sum(\"consumption\") FROM \"electricity\" WHERE $timeFilter", + "rawQuery": true, "refId": "A", "resultFormat": "time_series", "select": [ @@ -243,7 +245,7 @@ "measurement": "electricity", "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(\"cost\")/100 FROM \"electricity\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT sum(\"cost\")/100 FROM \"electricity\" WHERE $timeFilter", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -356,7 +358,7 @@ "measurement": "electricity", "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(\"total_cost\")/100 FROM \"electricity\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT sum(\"total_cost\")/100 FROM \"electricity\" WHERE $timeFilter", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -390,6 +392,119 @@ ], "valueName": "total" }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_INFLUX}", + "decimals": 4, + "format": "currencyGBP", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 14, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "electricity", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT (sum(\"total_cost\") / sum(\"consumption\"))/100 FROM \"electricity\" WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cost" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "", + "title": "Electricity effective unit cost", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + }, { "aliasColors": {}, "bars": false, @@ -634,6 +749,8 @@ "measurement": "gas", "orderByTime": "ASC", "policy": "default", + "query": "SELECT sum(\"consumption\") FROM \"gas\" WHERE $timeFilter", + "rawQuery": true, "refId": "A", "resultFormat": "time_series", "select": [ @@ -745,7 +862,7 @@ "measurement": "electricity", "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(\"cost\")/100 FROM \"gas\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT sum(\"cost\")/100 FROM \"gas\" WHERE $timeFilter", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -858,7 +975,7 @@ "measurement": "electricity", "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(\"total_cost\")/100 FROM \"gas\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT sum(\"total_cost\")/100 FROM \"gas\" WHERE $timeFilter", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -892,6 +1009,119 @@ ], "valueName": "total" }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_INFLUX}", + "decimals": 4, + "format": "currencyGBP", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 18, + "y": 11 + }, + "id": 15, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "electricity", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT (sum(\"total_cost\") / sum(\"consumption\"))/100 FROM \"gas\" WHERE $timeFilter", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cost" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [] + } + ], + "thresholds": "", + "title": "Gas effective unit cost", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + }, { "aliasColors": {}, "bars": false, @@ -1098,5 +1328,5 @@ "timezone": "", "title": "Energy usage", "uid": "7Nqpoj-ik", - "version": 8 + "version": 11 } \ No newline at end of file diff --git a/app/example-octograph.ini b/example-octograph.ini similarity index 100% rename from app/example-octograph.ini rename to example-octograph.ini