diff --git a/RELEASE.md b/RELEASE.md index 172dbc3..9b5d04c 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,10 @@ # RELEASE NOTES +## v0.10.2 - FleetAPI Hotfix + +* Fix FleetAPI setup script as raised in https://github.com/jasonacox/pypowerwall/issues/98. +* Update FleetAPI documentation and CLI usage. + ## v0.10.1 - TEDAPI Vitals Hotfix * Fix PVAC lookup error logic in TEDAPI class vitals() function. diff --git a/proxy/requirements.txt b/proxy/requirements.txt index be818fc..a46fa1b 100644 --- a/proxy/requirements.txt +++ b/proxy/requirements.txt @@ -1,2 +1,2 @@ -pypowerwall==0.10.1 +pypowerwall==0.10.2 bs4==0.0.2 diff --git a/pypowerwall/__init__.py b/pypowerwall/__init__.py index d748357..ffd4c4e 100644 --- a/pypowerwall/__init__.py +++ b/pypowerwall/__init__.py @@ -82,7 +82,7 @@ from typing import Union, Optional import time -version_tuple = (0, 10, 1) +version_tuple = (0, 10, 2) version = __version__ = '%d.%d.%d' % version_tuple __author__ = 'jasonacox' diff --git a/pypowerwall/fleetapi/fleetapi.py b/pypowerwall/fleetapi/fleetapi.py index cfc489c..ae3c5ed 100644 --- a/pypowerwall/fleetapi/fleetapi.py +++ b/pypowerwall/fleetapi/fleetapi.py @@ -100,8 +100,7 @@ def __init__(self, configfile=CONFIGFILE, debug=False, site_id=None, if site_id: self.site_id = site_id if not self.site_id: - log.error("No site_id set or returned by FleetAPI.") - raise Exception("No site_id found - Run Setup.") + log.debug("No site_id set or returned by FleetAPI - Run Setup.") # Function to return a random string of characters and numbers def random_string(self, length): diff --git a/tools/fleetapi/README.md b/tools/fleetapi/README.md index 198d3b1..cc8c672 100644 --- a/tools/fleetapi/README.md +++ b/tools/fleetapi/README.md @@ -20,14 +20,56 @@ Step 1 - Sign in to Tesla Developer Portal and make an App Access Request: See [ Step 2 - Run the `create_pem_key.py` script and place the **public** key on your website at the URL: https://{DOMAIN}/.well-known/appspecific/com.tesla.3p.public-key.pem -Step 3 - Run SETUP using the `fleetapi` script. This will ask for all the details above, generate a partner token, register your partner account, generate a user token needed to access your Powerwall. It will also get the site_id and run a query to pull live power data for your Powerwall. +Step 3 - Run SETUP using the built in pyPowerwall `fleetapi` setup mode. This will ask for all the details above, generate a partner token, register your partner account, generate a user token needed to access your Powerwall. It will also get the site_id and run a query to pull live power data for your Powerwall. ```bash -python fleetapi.py setup +python -m pypowerall fleetapi ``` +Configuration data will be stored in `.pypowerwall.fleetap`. + ## Command Line Usage +You can use the command line tool of pypowerwall to monitor and manage your Powerwall vit FleetAPI. Here are the commands: + +``` +PyPowerwall Module v0.10.2 + +commands (run -h to see usage information): + fleetapi Setup Tesla FleetAPI for Cloud Mode access + scan Scan local network for Powerwall gateway + set Set Powerwall Mode and Reserve Level + get Get Powerwall Settings and Power Levels + + get options: + -format FORMAT Output format: text, json, csv + + set options: + -mode MODE Powerwall Mode: self_consumption, backup, or autonomous + -reserve RESERVE Set Battery Reserve Level [Default=20] + -current Set Battery Reserve Level to Current Charge + +``` + +Examples + +```bash +# Setup +python3 -m pypowerwall fleetapi + +# Get Current Status +python3 -m pypowerwall get + +# Set battery reserve level to 30% +python3 -m pypowerwall set -reserve 30 + +# Set Powerwall mode to autonomous TOU +python3 -m pypowerwall set -mode autonomous + +``` + +## Stand Alone Tools + The `fleetapi.py` script is a command line utility and python class that you can use to monitor and manage your Powerwall. Here are teh command lines: ```