Giter Site home page Giter Site logo

liveaverage / dc-powerwall-dashboard Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 1.0 30 KB

Grafana dashboard showing trend & historical data polled from Tesla Powerwall 2 API served up in an easy to use docker image

Shell 100.00%
powerwall powerwall-status influxdb telegraf

dc-powerwall-dashboard's Introduction

Overview

This project is a complete monitoring & trending stack for Tesla Powerwall & Backup Gateway solutions. It consists of vendor-provided images of Telegraf, InfluxDB, and Grafana. This is an evolutionary stage of the original monolith, multi-arch container project docker-powerwall-dashboard and attempts to simplify maintenance of the stack by splitting-out each service.

Preview

Grafana Dashboard Preview

Usage

Clone the project:

git clone https://github.com/liveaverage/dc-powerwall-dashboard.git
cd dc-powerwall-dashboard/

Before launching ensure you update docker-compose.yaml and hardset the appropriate environment variables or set the following environment variables in a .env file in your same working repository directory:

POWERWALL_IP=127.0.0.1
POWERWALL_PASS=0R2D2
POWERWALL_LOCATION='lat=29.7231806&lon=-82.5562896'

If you're mapping/mounting telegraf configuration from your current working directory you may need to modify file/folder permissions and create/configure a local powerwall_auth directory to enable modifications to telegraf.conf (required for authentication cookie insertion):

mkdir powerwall_auth
chmod -R ug+rw telegraf/ powerwall_auth/

Start the stack

Refer to the notes below if running podman, or simply execute docker-compose if running standard, community docker:

sudo docker-compose up

Access the dashboard

To access the dashboard you can visit http://localhost:3000 and login using username powerwall and password powerwall (configurable in your docker-compose.yaml file or set via environment variable).

Stop the stack

sudo docker-compose stop
sudo docker rm $(sudo docker ps -q --filter "status=exited")

Notes

  • If using podman you may need to cleanup containers before re-running the stack: sudo docker rm $(sudo docker ps -q --filter "status=exited")
  • A future project iteration will provide k8s manifests and/or helm chart to run the stack on k3s (for multi-arch support)
  • This project is based on the work of @rhodesman and his teslaPowerDash repo, but hopefully enables easier ramp up to start obtaining and trending Powerwall 2 API data.

dc-powerwall-dashboard's People

Contributors

liveaverage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

swheat6345

dc-powerwall-dashboard's Issues

Multiple Gateways

Can the docker-compose.yaml be configured to pull data from two gateways?

Due to the size our incoming electrical service, Tesla installed two gateways at our property. I was able to set up everything up for one gateway on an RPI4 based on the IP address, password, etc., but I was wondering if there was a way to pull data from both gateways running a single instance of Grafana?

My alternative is to buy a second RPI4, but thought I'd ask if this can be done with one unit.

Backup and Restore

If I wanted to move to this project from docker-powerwall-dashboard what's the best way to do so and retain all my historical data?

Error in plugin

Apologies if this is something I'm misunderstanding. I got all services working but the db still doesn't seem to be ingesting any data. For the first 20-30 minutes, testing the data source gave me an error in Grafana about not being able to find the db. For some reason, that seems to have corrected itself but I'm not getting any data still.

I saw two types of errors. Earlier:
2021-11-11T22:55:45Z E! [inputs.http] Error in plugin: [url=https://powerwall/api/system_status/soe]: Get "https://powerwall/api/system_status/soe": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 2021-11-11T22:55:50Z E! [inputs.http] Error in plugin: [url=https://powerwall/api/system_status/soe]: Get "https://powerwall/api/system_status/soe": dial tcp 192.168.1.80:443: connect: connection refused

Then later:
2021-11-11T23:03:50Z E! [inputs.http] Error in plugin: [url=https://powerwall/api/system_status/soe]: received status code 403 (Forbidden), expected any value out of [200]

telegraf-2.log

Influxdb 2 Question

Wondering if you have investigated running this whole stack with Influxdb 2?
I am in the process of getting your version here up and running as written, but again was just curious on pros/cons of moving to version 2.

Cheers

telegraf keeps restarting

The telegraf service keeps restarting and eventually seems to hang. From the logs, I keep seeing "PWcookie.txt No such file or directory". What am I missing?

  • I followed the steps documented, with the only change being that I was getting an error mapping /srv/powerwall/influxdb:/var/lib/influxdb:z since this path didn't exist. I created ./srv/powerwall/influxdb in the working directory to workaround this.
  • I made sure to change permissions on the telegraf folder as instructed
  • I created a .env file (which currently just has some made up data for debugging purposes)
    telegraf.log

Thanks for looking!

Permissions issues for telegraf

When I run docker-compose up, I get the following errors in the log

telegraf    | + sed -e 's/.*token":"\(.*\)","provider".*/\1/'
telegraf    | /tmp/entrypoint.sh: line 27: /tmp/cookie/PWtoken.txt: Permission denied
...
...
telegraf exited with code 1
telegraf    | (23) Failed writing body
<repeats>

I made sure to update the permissions per the chmod suggestion in the readme. I've tried various combinations of root / non-root permissions but I haven't made progress. Do you have any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.