Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Commit

Permalink
Fixes #2 adding mapping for grafana vol
Browse files Browse the repository at this point in the history
  • Loading branch information
liveaverage committed Jul 18, 2019
1 parent 82cb492 commit a6cea61
Show file tree
Hide file tree
Showing 6 changed files with 2,558 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ 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

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"]
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
67 changes: 36 additions & 31 deletions graf_dash.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"__inputs": [
{
"name": "DS_POWERDATA",
"label": "PowerData",
"name": "DS_DS_POWERDATA",
"label": "DS_POWERDATA",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
Expand All @@ -14,7 +14,7 @@
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "6.2.2"
"version": "6.2.5"
},
{
"type": "panel",
Expand Down Expand Up @@ -54,6 +54,7 @@
}
]
},
"description": "An interactive view of your energy consumption, production, and environment.",
"editable": true,
"gnetId": null,
"graphTooltip": 0,
Expand All @@ -65,7 +66,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"fill": 1,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -252,7 +253,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"fill": 1,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -397,7 +398,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"fill": 1,
"gridPos": {
"h": 9,
Expand Down Expand Up @@ -544,7 +545,7 @@
"rgba(237, 129, 40, 0.89)",
"#3274D9"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"format": "watth",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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": [
Expand All @@ -749,7 +752,7 @@
{
"key": "url",
"operator": "=",
"value": "https://fcc-weather-api.glitch.me/api/current?lat=36.2452052&lon=-113.7292593"
"value": "*"
}
]
}
Expand Down Expand Up @@ -778,7 +781,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"format": "percent",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -897,7 +902,7 @@
"rgba(237, 129, 40, 0.89)",
"#FFEE52"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"format": "watth",
"gauge": {
"maxValue": 60000,
Expand Down Expand Up @@ -1018,7 +1023,7 @@
"label": "Others",
"threshold": 0
},
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"fontSize": "80%",
"format": "watth",
"gridPos": {
Expand Down Expand Up @@ -1211,7 +1216,7 @@
"label": "Others",
"threshold": 0
},
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"decimals": null,
"fontSize": "70%",
"format": "watth",
Expand Down Expand Up @@ -1400,7 +1405,7 @@
"#56A64B",
"#56A64B"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"format": "watth",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -1523,7 +1528,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"fill": 1,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -1668,7 +1673,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"decimals": 2,
"format": "currencyUSD",
"gauge": {
Expand Down Expand Up @@ -1756,7 +1761,7 @@
},
{
"params": [
" / 1000 * 0.532386"
" / 1000 * 0.0993"
],
"type": "math"
}
Expand Down Expand Up @@ -1792,7 +1797,7 @@
"bars": true,
"dashLength": 10,
"dashes": false,
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"fill": 1,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -2094,7 +2099,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"format": "watth",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -2215,7 +2220,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"format": "watth",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -2342,7 +2347,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "DS_POWERDATA",
"datasource": "${DS_DS_POWERDATA}",
"format": "watth",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -2461,15 +2466,16 @@
"valueName": "total"
}
],
"refresh": false,
"schemaVersion": 18,
"style": "dark",
"tags": [],
"templating": {
"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": [
Expand All @@ -2496,9 +2502,8 @@
"30d"
]
},
"timezone": "",
"title": "Historical Data",
"uid": "lp3v3S4Zz",
"version": 15
"timezone": "browser",
"title": "Powerwall History",
"uid": "Wvq3l7HWz",
"version": 3
}

Loading

0 comments on commit a6cea61

Please sign in to comment.