diff --git a/README.md b/README.md index b2cb8c0c..82b5f25a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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= +``` #### Tips and Tricks diff --git a/RELEASE.md b/RELEASE.md index 22ca4060..34bff77c 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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 diff --git a/VERSION b/VERSION index cbe06cdb..fa1ba045 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.4.4 +4.4.5 diff --git a/powerwall.yml b/powerwall.yml index ce865b5c..1694d6c6 100644 --- a/powerwall.yml +++ b/powerwall.yml @@ -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 diff --git a/setup.sh b/setup.sh index b390e1b0..db02d7fb 100755 --- a/setup.sh +++ b/setup.sh @@ -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 + # 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 @@ -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 @@ -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" diff --git a/upgrade.sh b/upgrade.sh index 76989ee1..8d36c028 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -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"