Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.0.0 - Add Cloud Mode support via pyPowerwall v0.7.0 #414

Merged
merged 28 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a0ed67c
Stage updates for pypowerwall v0.7.0
jasonacox Dec 27, 2023
1ab975e
v4.0.0
jasonacox Dec 27, 2023
39462a1
Add auth and site file creation
jasonacox Dec 29, 2023
ad1958c
Add .auth folder
jasonacox Dec 30, 2023
252f335
Update powerwall.yml for .auth
jasonacox Dec 30, 2023
d5bc73e
Add PW_AUTH_PATH to Docker Compose config
mcbirse Dec 31, 2023
7c54343
Add CQ for nominal_full_pack_energy
jasonacox Jan 2, 2024
a2fff22
Merge branch 'v4.0.0' of https://github.com/jasonacox/Powerwall-Dashb…
jasonacox Jan 2, 2024
5aa5fcd
Capture SIGTERM when weather411 halts due to missing config
mcbirse Jan 10, 2024
e8817c5
Add auth files
mcbirse Jan 10, 2024
32b946f
Remove profiles
mcbirse Jan 10, 2024
666947a
Update setup scripts and remove profiles
mcbirse Jan 10, 2024
b9bd555
Update container versions and remove profiles
mcbirse Jan 10, 2024
7e1bd00
Update pypowerwall
jasonacox Jan 14, 2024
90c2d7e
Add v3.0.8
jasonacox Jan 14, 2024
f41de0d
v4.0.0 upgrade script
mcbirse Jan 14, 2024
fde66b2
Fix network scan ip addr in Windows Git Bash
mcbirse Jan 15, 2024
7e7d692
Merge branch 'main' into v4.0.0
jasonacox Jan 15, 2024
1d96c9a
Merge branch 'v4.0.0' of https://github.com/jasonacox/Powerwall-Dashb…
jasonacox Jan 15, 2024
fa1bd89
Get ip addr based on OS
mcbirse Jan 16, 2024
1b2aae4
Fix for missing cmd
mcbirse Jan 16, 2024
94c75f7
Update verify script
mcbirse Jan 16, 2024
253dffe
Add sample docker compose for tesla-history
mcbirse Jan 19, 2024
2e1c504
Update setup options, README and RELEASE notes
mcbirse Jan 19, 2024
2f58551
Update to latest pypowerwall and proxy
mcbirse Jan 21, 2024
a493e91
Update README
jasonacox Jan 21, 2024
910e627
Add animation to solar-only dashboard
jasonacox Jan 21, 2024
7807a8c
Add script descriptions
jasonacox Jan 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update setup options, README and RELEASE notes
  • Loading branch information
mcbirse committed Jan 19, 2024
commit 2e1c5046cd18527eca10f5e12316d06819979be7
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
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 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: 4 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## v4.0.0 - Cloud Mode Support

* Using pypowerwall for both local and cloud mode (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
* 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 cloud mode.
* Updated `verify.sh` to support cloud mode metrics.
* Updated dashboard for solar-only users to include power flow animation panel.
* 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

Expand Down
8 changes: 4 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ echo "Select configuration mode:"
echo ""
echo "Current: ${config}"
echo ""
echo " 1 - Local Access (Powerwall 1, 2, or + using extended data from Tesla Gateway on LAN) - Default"
echo " 2 - Tesla Cloud (Solar-only, Powerwall 1, 2, +, or 3 using data from Tesla Cloud)"
echo " 1 - Local Access (Powerwall 1, 2, or + using the Tesla Gateway on LAN) - Default"
echo " 2 - Tesla Cloud (Solar-only systems or Powerwalls without LAN access)"
echo ""
while :; do
read -r -p "Select mode: ${choice}" response
Expand Down Expand Up @@ -293,9 +293,9 @@ if [ "${config}" == "Local Access" ] && ! grep -qE "^PW_HOST=.+" "${PW_ENV_FILE}
# Get local IP based on the operating system
OS=$(uname -s)
case $OS in
Linux*) IP=$(ip route get 8.8.8.8 2>/dev/null | awk '{ print $7 }') ;;
Linux*) IP=$(ip route get 8.8.8.8 2>/dev/null | awk '{print $7}') ;;
Darwin*) IP=$(ifconfig 2>/dev/null | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}') ;;
CYGWIN*|MINGW*|MSYS*) IP=$(netstat -rn 2>/dev/null | grep "0.0.0.0" | awk '{ print $4 }' | head -1) ;;
CYGWIN*|MINGW*|MSYS*) IP=$(netstat -rn 2>/dev/null | grep "0.0.0.0" | awk '{print $4}' | head -1) ;;
*) IP=""
esac
docker exec -it pypowerwall python3 -m pypowerwall scan -ip=${IP}
Expand Down
50 changes: 23 additions & 27 deletions tools/solar-only/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Tesla Solar Only

For Tesla Solar owners who don't have a Powerwall, to get a similar dashboard for their systems, Powerwall Dashboard can be installed in "solar-only" mode. This uses the Tesla Cloud API to grab power metrics and store them in InfluxDB for rendering by Grafana.
For Tesla Solar owners who don't have a Powerwall, to get a similar dashboard for their systems, Powerwall Dashboard can be installed in Tesla Cloud mode. This uses the Tesla Cloud API to grab power metrics and store them in InfluxDB for rendering by Grafana.

![Screenshot (2)](https://github.com/jasonacox/Powerwall-Dashboard/assets/20891340/3f954359-e851-462e-ba20-e1ad90db5bd7)

Thanks to [@Jot18](https://github.com/Jot18) for the example dashboard screenshot. Thanks and credit to [@mcbirse](https://github.com/mcbirse) for the `tesla-history` script that pulls the data from the Tesla Owner API and stores it into InfluxDB.
Thanks to [@Jot18](https://github.com/Jot18) for the example dashboard screenshot.

## Setup

Expand All @@ -21,15 +21,15 @@ cd Powerwall-Dashboard
./setup.sh
```

Select `option 2` (solar-only) to install the dashboard in Solar Only mode.
Select `option 2` (Tesla Cloud) to install the dashboard in Solar Only mode.

```
Powerwall Dashboard (v3.0.0) - SETUP
Powerwall Dashboard (v4.0.0) - SETUP
-----------------------------------------
Select configuration profile:
Select configuration mode:

1 - default (Powerwall w/ Gateway on LAN)
2 - solar-only (No Gateway - data retrieved from Tesla Cloud)
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)
```

Next, you will then be asked for your Local *timezone*, and your 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 All @@ -54,7 +54,7 @@ cd Powerwall-Dashboard
The upgrade script should detect the existing solar-only installation, as indicated by the *NOTE* below. If it does not, you may need to remove the `compose.env` file *in the Powerwall-Dashboard directory* (not tools/solar-only), if it exists. This may exist due to attempting to install the dashboard as a Powerwall user previously by mistake.

```
Upgrade Powerwall-Dashboard from 2.10.0 to 3.0.0
Upgrade Powerwall-Dashboard from 2.10.0 to 4.0.0
---------------------------------------------------------------------
This script will attempt to upgrade you to the latest version without
removing existing data. A backup is still recommended.
Expand All @@ -65,7 +65,7 @@ NOTE: Your existing 'solar-only' installation will be migrated to:
Upgrade - Proceed? [y/N]
```

Answer 'Y' to proceed with the upgrade and migration process, after which the dashboard should be configured as if running setup with the solar-only option selected, but with existing data and configuration files still intact.
Answer 'Y' to proceed with the upgrade and migration process, after which the dashboard should be configured as if running setup with the Tesla Cloud mode selected, but with existing data and configuration files still intact.

The migration process will remove all docker containers, move all relevant data and configuration files from the previous install location under tools/solar-only, and then re-create the docker containers.

Expand All @@ -77,29 +77,33 @@ The `verify.sh` script can be executed to confirm all services are running and c
```

```
Verify Powerwall-Dashboard 3.0.0 on Linux - Timezone: Australia/Sydney
Verify Powerwall-Dashboard 4.0.0 on Linux - Timezone: Australia/Sydney
----------------------------------------------------------------------------
This script will attempt to verify all the services needed to run
Powerwall-Dashboard. Use this output when you open an issue for help:
https://github.com/jasonacox/Powerwall-Dashboard/issues/new


Checking configuration
----------------------------------------------------------------------------
- Dashboard configuration: solar-only
- EnvVar COMPOSE_PROFILES: solar-only,weather411

Checking pypowerwall
----------------------------------------------------------------------------
- Skipped: Only required in 'default' configuration
- Config File pypowerwall.env: GOOD
- Container (pypowerwall): GOOD
- Service (port 8675): GOOD
- Version: 0.7.6 Proxy t39
- Powerwall State: CONNECTED - Firmware Version: 23.36.3
- Cloud Mode: YES - Site ID: 123456789890 (My home)

Checking telegraf
----------------------------------------------------------------------------
- Skipped: Only required in 'default' configuration
- Config File telegraf.conf: GOOD
- Local Config File telegraf.local: GOOD
- Container (telegraf): GOOD
- Version: Telegraf 1.28.2 (git: HEAD@8d9cf395)

Checking influxdb
----------------------------------------------------------------------------
- Config File influxdb.conf: GOOD
- Environment File influxdb.env: GOOD
- Container (influxdb): GOOD
- Service (port 8086): GOOD
- Filesystem (./influxdb): GOOD
Expand All @@ -113,20 +117,12 @@ Checking grafana
- Filesystem (./grafana): GOOD
- Version: Grafana CLI version 9.1.2

Checking tesla-history
----------------------------------------------------------------------------
- Config File tools/tesla-history/tesla-history.conf: GOOD
- Auth File tools/tesla-history/tesla-history.auth: GOOD
- Container (tesla-history): GOOD
- Version: 0.1.4

Checking weather411
----------------------------------------------------------------------------
- Config File weather/weather411.conf: GOOD
- Container (weather411): GOOD
- Service (port 8676): GOOD
- Weather: {"temperature": 23.56}
- Version: 0.2.2
- Weather: {"temperature": 19.84}
- Version: 0.2.3

All tests succeeded.
```
Expand Down
4 changes: 2 additions & 2 deletions upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ if [ "${PROFILE}" == "solar-only" ]; then
mkdir -p .auth
cp tools/tesla-history/tesla-history.auth .auth/.pypowerwall.auth
if grep -qE "^SITE = [0-9].+" tools/tesla-history/tesla-history.conf; then
grep -E "^SITE = [0-9].+" tools/tesla-history/tesla-history.conf | awk '{ print $NF }' > .auth/.pypowerwall.site
grep -E "^SITE = [0-9].+" tools/tesla-history/tesla-history.conf | awk '{print $NF}' > .auth/.pypowerwall.site
fi
EMAIL=$(grep -E "^USER = .+@.+" tools/tesla-history/tesla-history.conf | awk '{ print $NF }')
EMAIL=$(grep -E "^USER = .+@.+" tools/tesla-history/tesla-history.conf | awk '{print $NF}')
echo "PW_EMAIL=${EMAIL}" > ${PW_ENV_FILE}
echo "PW_PASSWORD=${PASSWORD}" >> ${PW_ENV_FILE}
echo "PW_HOST=${IP}" >> ${PW_ENV_FILE}
Expand Down