Skip to content

Commit

Permalink
Merge pull request #414 from jasonacox/v4.0.0
Browse files Browse the repository at this point in the history
v4.0.0 - Add Cloud Mode support via pyPowerwall v0.7.0
  • Loading branch information
jasonacox authored Jan 21, 2024
2 parents e241798 + 7807a8c commit 4b5d0ba
Show file tree
Hide file tree
Showing 19 changed files with 943 additions and 689 deletions.
2 changes: 2 additions & 0 deletions .auth/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This file stores the auth tokens and site cache files for pypowerwall
in cloudmode=True.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ powerwall.extend.yml
pypowerwall.env
telegraf.local

# Auth files
.auth/.pypowerwall.auth
.auth/.pypowerwall.site

# Local Dev files
*.bak
backups/*.tgz
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Powerwall-Dashboard

Monitoring Dashboard for the Tesla Powerwall using Grafana, InfluxDB, Telegraf and pyPowerwall.
Monitoring Dashboard for Tesla Solar and Powerwall systems using Grafana, InfluxDB, Telegraf and pyPowerwall.

![Animation](https://user-images.githubusercontent.com/13752647/198901193-6f5d3f34-3ef6-4d6d-95ff-892a3763541b.png)
![Monthly](https://user-images.githubusercontent.com/836718/214475577-2a633228-4db0-41b8-8738-51642222f462.png)
Expand All @@ -12,7 +12,7 @@ Monitoring Dashboard for the Tesla Powerwall using Grafana, InfluxDB, Telegraf a

## Dashboards

The default [dashboard.json](dashboards/dashboard.json) shown above, pulls in the live power flows from the Powerwall web portal and embeds that animation in the Grafana dashboard.
The default [dashboard.json](dashboards/dashboard.json) shown above, pulls in live power data from the local Tesla Energy Gateway or the Tesla Cloud and displays that on the Grafana dashboard. A power flow animation is rendered by the pyPowerwall container using that live data.

A non-animated version of the dashboard is also available using [dashboard-no-animation.json](dashboards/dashboard-no-animation.json)

Expand Down Expand Up @@ -47,17 +47,17 @@ Run the interactive setup script that will ask you for your setup details.
The dashboard can be installed in two different configurations.

```
Powerwall Dashboard (v3.0.3) - SETUP
Powerwall Dashboard (v4.0.0) - SETUP
-----------------------------------------
Select configuration profile:
Select configuration mode:
1 - Local Access (Powerwall 1, 2, or + using LAN) - Default
2 - Tesla Cloud (Solar-only, Powerwall 1, 2, +, or 3)
1 - Local Access (Powerwall 1, 2, or + using the Tesla Gateway on LAN) - Default
2 - Tesla Cloud (Solar-only systems or Powerwalls without LAN access)
```

Powerwall 1, 2 or + owners should select `option 1` (Local Access).
For Powerwall 1, 2 or + owners with a Tesla Energy Gateway accessible on their LAN, select `option 1` (Local Access).

If you are Tesla Solar owner and don't have a Powerwall, you can select `option 2` (Tesla Cloud) and the dashboard will be installed to pull the data available from the Tesla Cloud API (e.g. [Solar Only Mode](tools/solar-only/)) This mode also works for Powerwall 3 owners, but will not provide all the details or fidelity that the "Local Access" profile offers.
For Tesla Solar owners or Powerwalls without LAN access, select `option 2` (Tesla Cloud) and the dashboard will be installed to pull the data available from the Tesla Cloud API. This mode works for [Solar Only](tools/solar-only/) and Powerwall 3 owners, but will not provide all the details or fidelity that the "Local Access" mode offers.

Next, you will then be asked for your Local *timezone*, and your Powerwall details or Tesla Cloud login details. To find your timezone, see the second column in this table: [https://en.wikipedia.org/wiki/List_of_tz_database_time_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)

Expand Down Expand Up @@ -92,7 +92,9 @@ You will want to set your local timezone by editing `pypowerwall.env`, `telegraf
PW_DEBUG=no
```

* Copy `compose.env.sample` to `compose.env` and uncomment and modify the `COMPOSE_PROFILES` variable based on your setup. You do not need to edit the other defaults unless you are running a non-standard install such as docker rootless or require custom ports.
* For Tesla Solar owners or Powerwalls without LAN access, to configure pyPowerwall in Tesla Cloud mode instead of Local Access mode, edit `pypowerwall.env` and leave the `PW_HOST=` setting blank. NOTE: Once the docker containers have started, an additional step is then required to login to your Tesla Account by running the command `docker exec -it pypowerwall python3 -m pypowerwall setup`.

* Copy `compose.env.sample` to `compose.env`. You do not need to edit the other defaults unless you are running a non-standard install such as docker rootless or require custom ports.

* Copy `influxdb.env.sample` to `influxdb.env`. You do not need to edit this file, however if you have a custom setup, environment variables can be added to override the default InfluxDB configuration.

Expand Down Expand Up @@ -246,7 +248,7 @@ If required, see [WINDOWS.md](WINDOWS.md) for notes on how to upgrade your WSL i

#### Powerwall 3

The new Powerwall 3 does not currently provide a customer accessible API on the local network. Work is ongoing to determine if there is a way to get the rich set of data that is available directly from its predecesors (Powerwall 2/+). In the meantime, users can use the "Tesla Cloud" profile to generate the basic graph data. See details in the Powerwall 3 Support issue: https://github.com/jasonacox/Powerwall-Dashboard/issues/387
The new Powerwall 3 does not currently provide a customer accessible API on the local network. Work is ongoing to determine if there is a way to get the rich set of data that is available directly from its predecessors (Powerwall 2/+). In the meantime, users can use the "Tesla Cloud" mode to generate the basic graph data. See details in the Powerwall 3 Support issue: https://github.com/jasonacox/Powerwall-Dashboard/issues/387

#### Tips and Tricks

Expand Down
8 changes: 8 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# RELEASE NOTES

## v4.0.0 - Cloud Mode Support

* Using pyPowerwall for both Local Access and Tesla Cloud mode by @jasonacox and @mcbirse in https://github.com/jasonacox/Powerwall-Dashboard/pull/414 (replaces Tesla-history service, but the Tesla-history tool will continue to be used to fill in historic data or gaps) - See related https://github.com/jasonacox/pypowerwall/pull/59
* Removal of Docker Compose profiles (helps with some older systems that don't fully support this) and the v1 related legacy support.
* Updated `setup.sh` and `upgrade.sh` to support transition to pyPowerwall for Tesla Cloud mode.
* Updated `verify.sh` to support Tesla Cloud mode.
* Updated dashboard for solar-only users to include Powerflow Animation panel.

## v3.0.8 - Critical Bug Fix

* Fixes bug in pypowerwall proxy container version before `jasonacox/pypowerwall:0.7.6t39` related to API calls and 404 HTTP status codes handling.CPowerwall Firmware version 23.44.0 has eliminated /api/devices/vitals resulting in a 404 response from the Powerwall Gateway (TEG) when this is requested. There was a bug in the pypowerwall code that will treat this 404 like an authentication failure which will result in attempts to log in over and over, eventually hitting the rate limit. This is especially impactful for those using the proxy for things like Powerwall-Dashboard as the rate limit will prohibit other data gathering.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.8
4.0.0
33 changes: 1 addition & 32 deletions compose-dash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,6 @@ if [ -f "powerwall.extend.yml" ]; then
else
pwextend=""
fi
# Compose Profiles Helper Functions
get_profile() {
if [ ! -f ${COMPOSE_ENV_FILE} ]; then
return 1
else
unset COMPOSE_PROFILES
. "${COMPOSE_ENV_FILE}"
fi
# Check COMPOSE_PROFILES for profile
IFS=',' read -ra PROFILES <<< "${COMPOSE_PROFILES}"
for p in "${PROFILES[@]}"; do
if [ "${p}" == "${1}" ]; then
return 0
fi
done
return 1
}

echo "Running Docker Compose..."
if docker compose version > /dev/null 2>&1; then
Expand All @@ -79,21 +62,7 @@ if docker compose version > /dev/null 2>&1; then
else
if docker-compose version > /dev/null 2>&1; then
# Build Docker (v1)
if docker-compose -f powerwall.yml config > /dev/null 2>&1; then
pwconfig="powerwall.yml"
else
echo "** WARNING **"
echo " You have an old version of docker-compose that will"
echo " be deprecated in a future release. Please upgrade or"
echo " report your use case to the Powerwall-Dashboard project."
echo ""
echo "Applying workaround for old docker-compose..."
pwconfig="powerwall-v1.yml"
if get_profile "solar-only"; then
pwconfig="powerwall-v1-solar.yml"
fi
fi
docker-compose -f $pwconfig $pwextend $@
docker-compose -f powerwall.yml $pwextend $@
else
echo "ERROR: docker-compose/docker compose is not available or not running."
echo "This script requires docker-compose or docker compose."
Expand Down
9 changes: 0 additions & 9 deletions compose.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,3 @@
#GRAFANA_PORTS="9000:9000"
#PYPOWERWALL_PORTS="8675:8675"
#WEATHER411_PORTS="8676:8676"

#------------------------------------------------------------------------------#
# Powerwall-Dashboard setup profile (default or solar-only, + optional profiles)
#------------------------------------------------------------------------------#
# Comma-separated list of profiles to enable
# - must include either default or solar-only
# - can include optional profiles, e.g. weather411
#
#COMPOSE_PROFILES=default,weather411
Loading

0 comments on commit 4b5d0ba

Please sign in to comment.