From a6cea611a403cef0b97a1b927bcf17596c93b585 Mon Sep 17 00:00:00 2001 From: JR Morgan Date: Thu, 18 Jul 2019 16:02:58 -0400 Subject: [PATCH] Fixes #2 adding mapping for grafana vol --- Dockerfile | 2 +- README.md | 10 +- graf_dash.json | 67 +- graf_dash.json.orig | 2497 +++++++++++++++++++++++++++++++++++++++++++ powerwall.conf | 14 +- run.sh | 4 + 6 files changed, 2558 insertions(+), 36 deletions(-) create mode 100644 graf_dash.json.orig diff --git a/Dockerfile b/Dockerfile index 3abd85d..70e5131 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,6 @@ ADD graf_DS.yaml /etc/grafana/provisioning/datasources/graf_DS.yaml ADD graf_DA.yaml /etc/grafana/provisioning/dashboards/graf_DA.yaml RUN mkdir -p /var/lib/grafana/dashboards && chown grafana:grafana /var/lib/grafana/dashboards -ADD graf_dash.json /var/lib/grafana/dashboards/graf_dash.json EXPOSE 3000 @@ -44,5 +43,6 @@ ADD run.sh /opt/run.sh RUN chmod -v +x /opt/run.sh RUN export $(grep -v "#" /etc/sysconfig/grafana-server | cut -d= -f1) +ENV POWERWALL_LOCATION="lat=36.2452052&lon=-113.7292593" CMD ["/opt/run.sh"] diff --git a/README.md b/README.md index 5f4500c..ecdf0b6 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,16 @@ podman pull liveaverage/powerwall-dashboard ``` export POWERWALL_IP=192.168.1.92 export LOCAL_INFLUXDB_PATH=/tmp/influxdata +export LOCAL_GRAFANA_PATH=/tmp/grafana -podman run --add-host teslapw:${POWERWALL_IP} -p 3000:3000 -v ${LOCAL_INFLUXDB_PATH}:/var/lib/influxdb:z liveaverage/powerwall-dashboard +podman run --add-host teslapw:${POWERWALL_IP} -p 3000:3000 \ + -v ${LOCAL_INFLUXDB_PATH}:/var/lib/influxdb:z \ + -v ${LOCAL_GRAFANA_PATH}:/var/lib/grafana:z \ + liveaverage/powerwall-dashboard ## Optional if you're still using docker: -## docker run --add-host teslapw:${POWERWALL_IP} -p 3000:3000 -v ${LOCAL_INFLUXDB_PATH}:/var/lib/influxdb:z liveaverage/powerwall-dashboard +## docker run --add-host teslapw:${POWERWALL_IP} -p 3000:3000 -v ${LOCAL_INFLUXDB_PATH}:/var/lib/influxdb:z -v ${LOCAL_GRAFANA_PATH}:/var/lib/grafana:z liveaverage/powerwall-dashboard ``` - Access the Grafana dashboard from your container host IP, which may require firewall exceptions for TCP3000: http://localhost:3000 - - Default credentials are "admin" for username/password; note that you'll need to map select grafana volumes to persist user details + - Default credentials are "admin" for username/password diff --git a/graf_dash.json b/graf_dash.json index cd6bbaa..5255c51 100644 --- a/graf_dash.json +++ b/graf_dash.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_POWERDATA", - "label": "PowerData", + "name": "DS_DS_POWERDATA", + "label": "DS_POWERDATA", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -14,7 +14,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "6.2.2" + "version": "6.2.5" }, { "type": "panel", @@ -54,6 +54,7 @@ } ] }, + "description": "An interactive view of your energy consumption, production, and environment.", "editable": true, "gnetId": null, "graphTooltip": 0, @@ -65,7 +66,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "fill": 1, "gridPos": { "h": 8, @@ -252,7 +253,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "fill": 1, "gridPos": { "h": 8, @@ -397,7 +398,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "fill": 1, "gridPos": { "h": 9, @@ -544,7 +545,7 @@ "rgba(237, 129, 40, 0.89)", "#3274D9" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "format": "watth", "gauge": { "maxValue": 100, @@ -659,8 +660,8 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "DS_POWERDATA", - "format": "celsius", + "datasource": "${DS_DS_POWERDATA}", + "format": "farenheit", "gauge": { "maxValue": 100, "minValue": 0, @@ -726,9 +727,11 @@ "type": "fill" } ], - "measurement": "http", + "measurement": "weather", "orderByTime": "ASC", "policy": "default", + "query": "SELECT ((mean(\"main_temp\") * 1.8) + 32 ) FROM \"weather\"", + "rawQuery": true, "refId": "A", "resultFormat": "time_series", "select": [ @@ -749,7 +752,7 @@ { "key": "url", "operator": "=", - "value": "https://fcc-weather-api.glitch.me/api/current?lat=36.2452052&lon=-113.7292593" + "value": "*" } ] } @@ -778,7 +781,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "format": "percent", "gauge": { "maxValue": 100, @@ -845,9 +848,11 @@ "type": "fill" } ], - "measurement": "http", + "measurement": "weather", "orderByTime": "ASC", "policy": "default", + "query": "SELECT mean(\"clouds_all\") FROM \"weather\" GROUP BY time(1h) fill(none)", + "rawQuery": true, "refId": "A", "resultFormat": "time_series", "select": [ @@ -897,7 +902,7 @@ "rgba(237, 129, 40, 0.89)", "#FFEE52" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "format": "watth", "gauge": { "maxValue": 60000, @@ -1018,7 +1023,7 @@ "label": "Others", "threshold": 0 }, - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "fontSize": "80%", "format": "watth", "gridPos": { @@ -1211,7 +1216,7 @@ "label": "Others", "threshold": 0 }, - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "decimals": null, "fontSize": "70%", "format": "watth", @@ -1400,7 +1405,7 @@ "#56A64B", "#56A64B" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "format": "watth", "gauge": { "maxValue": 100, @@ -1523,7 +1528,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "fill": 1, "gridPos": { "h": 8, @@ -1668,7 +1673,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "decimals": 2, "format": "currencyUSD", "gauge": { @@ -1756,7 +1761,7 @@ }, { "params": [ - " / 1000 * 0.532386" + " / 1000 * 0.0993" ], "type": "math" } @@ -1792,7 +1797,7 @@ "bars": true, "dashLength": 10, "dashes": false, - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "fill": 1, "gridPos": { "h": 8, @@ -2094,7 +2099,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "format": "watth", "gauge": { "maxValue": 100, @@ -2215,7 +2220,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "format": "watth", "gauge": { "maxValue": 100, @@ -2342,7 +2347,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "DS_POWERDATA", + "datasource": "${DS_DS_POWERDATA}", "format": "watth", "gauge": { "maxValue": 100, @@ -2461,6 +2466,7 @@ "valueName": "total" } ], + "refresh": false, "schemaVersion": 18, "style": "dark", "tags": [], @@ -2468,8 +2474,8 @@ "list": [] }, "time": { - "from": "now/M", - "to": "now/M" + "from": "2019-07-10T16:00:00.000Z", + "to": "2019-07-24T15:59:59.998Z" }, "timepicker": { "refresh_intervals": [ @@ -2496,9 +2502,8 @@ "30d" ] }, - "timezone": "", - "title": "Historical Data", - "uid": "lp3v3S4Zz", - "version": 15 + "timezone": "browser", + "title": "Powerwall History", + "uid": "Wvq3l7HWz", + "version": 3 } - diff --git a/graf_dash.json.orig b/graf_dash.json.orig new file mode 100644 index 0000000..93df950 --- /dev/null +++ b/graf_dash.json.orig @@ -0,0 +1,2497 @@ +{ + "__inputs": [ + { + "name": "DS_POWERDATA", + "label": "PowerData", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.2.2" + }, + { + "type": "panel", + "id": "grafana-piechart-panel", + "name": "Pie Chart", + "version": "1.3.6" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "DS_POWERDATA", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": {}, + "percentage": false, + "pointradius": 1, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "output", + "color": "#56A64B" + }, + { + "alias": "charge", + "color": "#37872D" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "output", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(\"battery_instant_power\") FROM \"http\" WHERE (\"url\" = 'https://teslapw/api/meters/aggregates' AND \"battery_instant_power\" > 0) AND $timeFilter GROUP BY time(1d) fill(none)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "battery_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + }, + { + "alias": "charge", + "groupBy": [ + { + "params": [ + "1d" + ], + "type": "time" + }, + { + "params": [ + "0" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT count(\"battery_instant_power\") FROM \"http\" WHERE (\"url\" = 'https://teslapw/api/meters/aggregates' AND \"battery_instant_power\" < 0) AND $timeFilter GROUP BY time(1d) fill(0)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "battery_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "battery_instant_power", + "operator": "<", + "value": "0" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Battery Output", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watth", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "DS_POWERDATA", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 18, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 1, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "http.battery", + "color": "#56A64B" + }, + { + "alias": "http.solar", + "color": "#FFEE52" + }, + { + "alias": "http.grid", + "color": "rgb(133, 133, 133)" + }, + { + "alias": "http.house", + "color": "#3274D9" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "load_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "house" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "House Output", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watth", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "DS_POWERDATA", + "fill": 1, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 3, + "interval": "", + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 1, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "http.battery", + "color": "#56A64B" + }, + { + "alias": "http.solar", + "color": "#FFEE52" + }, + { + "alias": "http.grid", + "color": "rgb(133, 133, 133)" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "limit": "", + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "solar_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "solar" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Solar Output", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watth", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#3274D9" + ], + "datasource": "DS_POWERDATA", + "format": "watth", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 8 + }, + "id": 9, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "mean", + "targets": [ + { + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "limit": "", + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "load_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "slimit": "", + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": "0,1", + "timeFrom": null, + "timeShift": null, + "title": "Total House Usage", + "type": "singlestat", + "valueFontSize": "110%", + "valueMaps": [], + "valueName": "total" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "DS_POWERDATA", + "format": "celsius", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 8 + }, + "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, + "options": {}, + "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": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "weather", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "main_temp" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Avg. Temp", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "DS_POWERDATA", + "format": "percent", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 21, + "y": 8 + }, + "id": 11, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "weather", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "clouds_all" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://fcc-weather-api.glitch.me/api/current?lat=36.2452052&lon=-113.7292593" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Avg. Cloud Cover", + "type": "singlestat", + "valueFontSize": "110%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#FFEE52" + ], + "datasource": "DS_POWERDATA", + "format": "watth", + "gauge": { + "maxValue": 60000, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": false + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 12, + "y": 11 + }, + "id": 7, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "solar_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": "0,1", + "timeFrom": null, + "timeShift": null, + "title": "Total Solar Generated", + "type": "singlestat", + "valueFontSize": "120%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + }, + { + "aliasColors": { + "Battery": "#56A64B", + "Grid": "#969696" + }, + "breakPoint": "50%", + "cacheTimeout": null, + "combine": { + "label": "Others", + "threshold": 0 + }, + "datasource": "DS_POWERDATA", + "fontSize": "80%", + "format": "watth", + "gridPos": { + "h": 6, + "w": 4, + "x": 16, + "y": 11 + }, + "id": 24, + "interval": null, + "legend": { + "percentage": true, + "show": true, + "values": false + }, + "legendType": "On graph", + "links": [], + "maxDataPoints": 3, + "nullPointMode": "connected", + "options": {}, + "pieType": "donut", + "strokeWidth": 1, + "targets": [ + { + "alias": "Battery", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "battery_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "battery_instant_power", + "operator": "<", + "value": "0" + } + ] + }, + { + "alias": "Grid", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "site_instant_power", + "operator": "<", + "value": "0" + } + ] + }, + { + "alias": "House", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "load_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "solar_instant_power", + "operator": ">", + "value": "0" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Solar Export", + "type": "grafana-piechart-panel", + "valueName": "current" + }, + { + "aliasColors": { + "Battery": "#56A64B", + "Grid": "rgb(186, 186, 186)", + "Solar": "#FFEE52" + }, + "breakPoint": "50%", + "cacheTimeout": null, + "combine": { + "label": "Others", + "threshold": 0 + }, + "datasource": "DS_POWERDATA", + "decimals": null, + "fontSize": "70%", + "format": "watth", + "gridPos": { + "h": 6, + "w": 4, + "x": 20, + "y": 11 + }, + "id": 20, + "interval": null, + "legend": { + "header": "", + "percentage": true, + "show": true, + "values": false + }, + "legendType": "On graph", + "links": [], + "maxDataPoints": 3, + "nullPointMode": "connected", + "options": {}, + "pieType": "donut", + "strokeWidth": ".5", + "targets": [ + { + "alias": "Solar", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "solar_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "solar" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + }, + { + "alias": "Battery", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "battery_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "battery_instant_power", + "operator": ">", + "value": "0" + } + ] + }, + { + "alias": "Grid", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "grid" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Power Breakdown", + "type": "grafana-piechart-panel", + "valueName": "total" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "#56A64B", + "#56A64B" + ], + "datasource": "DS_POWERDATA", + "format": "watth", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 12, + "y": 14 + }, + "id": 6, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"battery_instant_power\") FROM \"http\" WHERE (\"url\" = 'https://teslapw/api/meters/aggregates' AND \"battery_instant_power\" > 0) AND $timeFilter GROUP BY time(1h) fill(none)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "battery_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "battery_instant_power", + "operator": ">", + "value": "0" + } + ] + } + ], + "thresholds": "0,1", + "timeFrom": null, + "timeShift": null, + "title": "Total Battery Use", + "type": "singlestat", + "valueFontSize": "110%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "DS_POWERDATA", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 4, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 1, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "http.battery", + "color": "#56A64B" + }, + { + "alias": "http.solar", + "color": "#FFEE52" + }, + { + "alias": "http.grid", + "color": "rgb(133, 133, 133)" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "grid" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Grid Output", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watth", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "DS_POWERDATA", + "decimals": 2, + "format": "currencyUSD", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 12, + "y": 17 + }, + "id": 8, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "mean", + "targets": [ + { + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "limit": "", + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + " / 1000 * 0.532386" + ], + "type": "math" + } + ] + ], + "slimit": "", + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Net Grid Cost", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "DS_POWERDATA", + "fill": 1, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 17 + }, + "id": 17, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "total": true, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Solar", + "color": "#FFEE52" + }, + { + "alias": "Battery", + "color": "#56A64B" + }, + { + "alias": "Grid", + "color": "rgb(138, 138, 138)" + }, + { + "alias": "House", + "color": "#3274D9" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "House", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"solar_instant_power\") AS \"solar\" FROM \"http\" WHERE (\"url\" = 'https://teslapw/api/meters/aggregates') AND $timeFilter GROUP BY time(1h) fill(none)", + "rawQuery": false, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "load_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + }, + { + "alias": "Solar", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "solar_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "battery" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + }, + { + "alias": "Battery", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "battery_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "house" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "battery_instant_power", + "operator": ">", + "value": "0" + } + ] + }, + { + "alias": "Grid", + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "grid" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Totals", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "series", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "watth", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "DS_POWERDATA", + "format": "watth", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 12, + "y": 19 + }, + "id": 25, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "mean", + "targets": [ + { + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "limit": "", + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "slimit": "", + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Net Grid Use", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "DS_POWERDATA", + "format": "watth", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 12, + "y": 21 + }, + "id": 21, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "mean", + "targets": [ + { + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "limit": "", + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "slimit": "", + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "site_instant_power", + "operator": ">", + "value": "0" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Total Grid Imported", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "DS_POWERDATA", + "format": "watth", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 12, + "y": 23 + }, + "id": 22, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "mean", + "targets": [ + { + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "limit": "", + "measurement": "http", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "site_instant_power" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "slimit": "", + "tags": [ + { + "key": "url", + "operator": "=", + "value": "https://teslapw/api/meters/aggregates" + }, + { + "condition": "AND", + "key": "site_instant_power", + "operator": "<", + "value": "0" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Total Grid Exported", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "total" + } + ], + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now/M", + "to": "now/M" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Historical Data", + "uid": "lp3v3S4Zz", + "version": 15 +} diff --git a/powerwall.conf b/powerwall.conf index 7e101b4..51399ca 100644 --- a/powerwall.conf +++ b/powerwall.conf @@ -2,7 +2,7 @@ urls = ["http://${INFLUXDB_HTTP_BIND_ADDRESS}"] database = "PowerwallData" # or whatever you want to name the DB skip_database_creation = false - + [[inputs.http]] urls = [ "https://${POWERWALL_HOST}/api/meters/aggregates", @@ -12,3 +12,15 @@ insecure_skip_verify = true timeout = "5s" data_format = "json" + +## POWERWALL_LOCATION Should be in the string format "lat=29.7231806&lon=-82.5562896" + +[[inputs.http]] + urls = [ + "https://fcc-weather-api.glitch.me/api/current?${POWERWALL_LOCATION}" + ] + method = "GET" + insecure_skip_verify = true + timeout = "5s" + data_format = "json" + name_override = "weather" diff --git a/run.sh b/run.sh index 9d36db0..82568be 100644 --- a/run.sh +++ b/run.sh @@ -20,6 +20,10 @@ set -a; . /etc/sysconfig/grafana-server; set +a cd /usr/share/grafana +mkdir -p /var/lib/grafana/dashboards || true +chown -R grafana:grafana /var/lib/grafana || true +curl ${GRAFANA_DASHBOARD_URL} > /var/lib/grafana/dashboards/grafana_powerwall.json + /usr/sbin/grafana-server \ --config=${CONF_FILE} \ --pidfile=${PID_FILE_DIR}/grafana-server.pid \