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

Update README.md with updated PW3 instructions #493

Merged
merged 5 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ route -p add 192.168.91.1 mask 255.255.255.255 192.168.0.100

#### Powerwall 3 Mode (beta)

If you have access to the Powerwall Gateway (see local mode Extended Device Vitals Metrics note above), you can select option 4 to activate Powerwall 3 mode. All data will be pulled from the local Gateway TEDAPI endpoint.
If you have access to the Powerwall Gateway (see local mode Extended Device Vitals Metrics note above), you can select option 4 to activate Powerwall 3 mode. All data will be pulled from the local Gateway TEDAPI endpoint. If you have problems with your setup for the Powerwall 3, see troubleshooting section below.


### Cloud and FleetAPI Mode

Expand Down Expand Up @@ -288,7 +289,24 @@ 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 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
The new Powerwall 3 does not have the local APIs that were found on the Powerwall 2/+ systems. However, it does provide APIs available via its internal Gateway WiFI access point at 192.168.91.1. If you add your Powerwall 3 to your local network (e.g. ethernet hardwire) or create a WiFi bridge to this access point, you are able to get the extended metrics from the /tedapi API. Additionally, users can use the "Tesla Cloud" mode to generate the basic graph data. It is more limited than the local APIs but does provide the core data points. See details in the Powerwall 3 Support issue: https://github.com/jasonacox/Powerwall-Dashboard/issues/387

Some have reported issues setting up their Powerwall 3 and the local 192.168.91.1 access point. Make sure that this IP address is reachable from the host running the Dashboard (e.g. `ping` or `curl` commands).

Since the Powerwall 3 does not have previous generation APIs, you will need to use the `full` TEDAPI mode. This requires that the PW_EMAIL and PW_PASSWORD environmental variables are empty and that PW_GW_PWD is set to the Powerwall 3 Gateway WiFi password (usually found on the QR code on the Gateway itself).

Example of a working `pypowerwall.env` file for Powerwall 3:

```
PW_EMAIL=
PW_PASSWORD=
PW_HOST=192.168.91.1
PW_TIMEZONE=America/Los_Angeles
TZ=America/Los_Angeles
PW_DEBUG=no
PW_STYLE=grafana-dark
PW_GW_PWD=<YOUR_PW3_PASSWORD>
```

#### Tips and Tricks

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

## v4.4.5 - PW3 Updates

* Powerwall 3 Setup Help - If local setup is selected, it will work with the Powerwall 3 but will produce errors in pypowerwall and not have the complete data. This updates `setup.sh` so ensure Powerwall 3 setups use `full` TEDAPI mode for local access. Raised by @pavandave in https://github.com/jasonacox/Powerwall-Dashboard/issues/492.
* Add check in `setup.sh` script to ensure user has permission to write to the current directory. Raised in https://github.com/jasonacox/Powerwall-Dashboard/discussions/494.
* Update to latest pypowerwall, updates TEDAPI to provide correct Powerwall firmware version. Discovered by @geptto in https://github.com/jasonacox/pypowerwall/issues/97. This function has been integrated into pypowerwall existing APIs and proxy features.

## v4.4.4 - Bug Fixes

* Fix setup.sh gateway detection logic to better work on Synology and other host without user `ping` commands as raised by @zcpnate in #488
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.4.4
4.4.5
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This updates us to the next version.

2 changes: 1 addition & 1 deletion powerwall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
- influxdb.env

pypowerwall:
image: jasonacox/pypowerwall:0.10.6t63
image: jasonacox/pypowerwall:0.10.8t63
container_name: pypowerwall
hostname: pypowerwall
restart: unless-stopped
Expand Down
30 changes: 27 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ if [ "$EUID" -eq 0 ]; then
exit 1
fi

# Verify user has write permission to this directory
if [ ! -w . ]; then
echo "ERROR: Your user ($USER) does not have write permission to this directory."
echo ""
ls -ld "$(pwd)"
echo ""
echo "Please fix file permissions and try again."
echo ""
exit 1
fi

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm combining an enhancement based on #494 to help with installs where the user does not have write access to their local directory.

# Verify user in docker group (not required for Windows Git Bash)
if ! type winpty > /dev/null 2>&1; then
if ! $(id -Gn 2>/dev/null | grep -qw "docker"); then
Expand Down Expand Up @@ -287,13 +298,13 @@ if [ -f ${PW_ENV_FILE} ]; then
fi
fi

# Function to test an IP to see if it returns a ping
# Function to test a GW IP to see if it responds
function test_ip() {
local IP=$1
if [ -z "${IP}" ]; then
return 1
fi
if curl -k --head --connect-timeout 1 --silent https://${IP} > /dev/null 2>&1; then
if curl -k --head --connect-timeout 2 --silent https://${IP} > /dev/null 2>&1; then
return 0
else
return 1
Expand Down Expand Up @@ -337,15 +348,28 @@ if [ ! -f ${PW_ENV_FILE} ]; then
else
PW_GW_PWD="${PW}"
fi
echo ""
# Double check the user doesn't have a Powerwall 3
if [ $pw3 -ne 1 ]; then
read -p 'Do you have a Powerwall 3? [y/N] ' response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
pw3=1
PASSWORD=""
EMAIL=""
fi
echo ""
fi
fi
else
echo "The Powerwall Gateway (192.168.91.1) is not found on your LAN."
if [ $pw3 -eq 1 ]; then
echo ""
echo "Powerwall 3 requires access to the Gateway for pull local data."
echo "Ensure the Gateway is connected to your host and rerun setup."
echo "Ensure the Gateway can be reached by your host and rerun setup."
echo "Alternatively you can select a Tesla Cloud mode."
echo ""
echo "Test: curl -k --head https://192.168.91.1"
echo ""
exit 1
fi
echo "Standard dashboard metrics will work but Extended data (vitals) via TEDAPI"
Expand Down
2 changes: 1 addition & 1 deletion upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
set -e

# Set Globals
VERSION="4.4.4"
VERSION="4.4.5"
CURRENT="Unknown"
COMPOSE_ENV_FILE="compose.env"
INFLUXDB_ENV_FILE="influxdb.env"
Expand Down