Python API for Tesla Powerwall and Solar Power Data
MIT License
Published by jasonacox 7 months ago
jsonformat
parameter consistent across all method calls (breaking API change).Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.12...v0.8.0
Published by jasonacox 7 months ago
/api/solar_powerwall
API if vitals data is not available by @jasonacox in #76./api/solar_powerwall
when vitals not present by @DerickJohnson in #75. The vitals API is not present in firmware versions > 23.44, this provides a workaround to get alerts.cachefile
parameter.# Example
import pypowerwall
pw = pypowerwall.Powerwall(
host="10.1.2.30",
password="secret",
email="[email protected]",
timezone="America/Los_Angeles",
pwcacheexpire=5,
timeout=5,
poolmaxsize=10,
cloudmode=False,
siteid=None,
authpath="",
authmode="cookie",
cachefile=".powerwall",
)
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.11...v0.7.12
Published by jasonacox 7 months ago
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.10...v0.7.11
Published by jasonacox 7 months ago
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.9...v0.7.10
Published by jasonacox 8 months ago
cloud mode
(see https://github.com/jasonacox/Powerwall-Dashboard/issues/437)Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.8...v0.7.9
Published by jasonacox 8 months ago
cloud mode
setup to handle incomplete sites with Unknown names or types by @dcgibbons in https://github.com/jasonacox/pypowerwall/pull/72
cloud mode
(see https://github.com/jasonacox/Powerwall-Dashboard/issues/437).Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.7...v0.7.8
Published by mcbirse 9 months ago
-hosts=
argument (default = 30, maximum = 100), e.g. python -m pypowerwall scan -hosts=50
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.6...v0.7.7
Published by jasonacox 10 months ago
🔥 CRITICAL Upgrade - Please take a moment and upgrade your installation of pypowerwall if you using it for your own scripts. The latest release fixes 404 HTTP status code handling for API calls. Older versions of pypowerwall will cause a repeating loop of login attempts eventually resulting in rate limiting and failure to get any metrics.
NOTE: IF YOU HAVE FIRMWARE 23.44.0 YOU ARE IMPACTED AND SHOULD UPGRADE AS SOON AS POSSIBLE.
pip install --upgrade pypowerwall
# Verify version 0.7.6 or greater:
python -m pypowerwall version
pyPowerwall [0.7.6]
Note: Users of pypowerwall proxy docker container should upgrade to the latest as well: jasonacox/pypowerwall:0.7.6t39
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.5...v0.7.6
Published by mcbirse 10 months ago
python -m pypowerwall setup -email=<email>
) by @mcbirse in https://github.com/jasonacox/pypowerwall/pull/64 to streamline Powerwall-Dashboard setup script.Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.4...v0.7.5
Published by jasonacox 10 months ago
-ip=
to override the host IP address detection (python -m pypowerwall scan -ip=192.168.1.100
). This may be useful where the host IP address/network cannot be detected correctly, for instance if pypowerwall is running inside a container.pyPowerwall
authmode='token'
in the initialization. The default mode uses the existing AuthCookie
and UserRecord
method.import pypowerwall
pw = pypowerwall.Powerwall(HOST, PASSWORD, EMAIL, TIMEZONE, authmode="token")
Proxy
PW_AUTH_MODE
set to cookie (default) or token.Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.3...v0.7.4
Published by mcbirse 10 months ago
PW_AUTH_PATH
environmental variable to set the path for .pypowerwall.auth
and .pypowerwall.site
by @mcbirse in https://github.com/jasonacox/pypowerwall/pull/62
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.2...v0.7.3
Published by jasonacox 10 months ago
This adds the option to set file path for cloud auth (.pypowerwall.auth
) and site (.pypowerwall.site
) cache files:
authpath
which defaults to current directory (authpath=""
)PW_AUTH_PATH
is added which defaults to current directory.This also adds the option to specify the energy site ID (siteid
):
siteid
which defaults to None.PW_SITEID
is available to set the siteid
.import pypowerwall
pw = pypowerwall.Powerwall(email="[email protected]",cloudmode=True,siteid=1234567,authpath=".auth")
This will provide more flexibility to run the pypowerwall proxy in a container for cloud mode support.
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.7.1...v0.7.2
Published by jasonacox 10 months ago
get_time_remaining()
cloudmode
API calls to pypowerwall APIs will result in calls made to the Tesla API to fetch the data. Tesla Cloud Option by @jasonacox and @mcbirse in https://github.com/jasonacox/pypowerwall/pull/59
python3 -m pypowerwall setup
# Token and site information stored in .pypowerwall.auth and .pypowerwall.site
import pypowerwall
pw = pypowerwall.Powerwall(email="[email protected]",cloudmode=True)
pw.power()
# Output: {'site': 2977, 'solar': 1820, 'battery': -3860, 'load': 937}
pw.poll('/api/system_status/soe')
# Output: '{"percentage": 26.403205103271222}'
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.6.3...v0.7.1
Published by jasonacox 11 months ago
$ python3 -m pypowerwall scan
pyPowerwall Network Scanner [0.6.3]
Scan local network for Tesla Powerwall Gateways
Your network appears to be: 10.0.1.0/24
Enter Network or press enter to use 10.0.1.0/24:
Running Scan...
Host: 10.0.1.2 ... OPEN - Not a Powerwall
Host: 10.0.1.5 ... OPEN - Found Powerwall 3 [Currently Unsupported]
Host: 10.0.1.8 ... OPEN - Not a Powerwall
Host: 10.0.1.9 ... OPEN - Found Powerwall 3 [Currently Unsupported]
Done
Discovered 2 Powerwall Gateway
10.0.1.5 [Powerwall-3] Firmware Currently Unsupported - See https://tinyurl.com/pw3support
10.0.1.9 [Powerwall-3] Firmware Currently Unsupported - See https://tinyurl.com/pw3support
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.6.2...v0.6.3
Published by jasonacox about 1 year ago
grafana-dark
style for PW_STYLE
settings to accommodate placing as iframe in newer Grafana versions (e.g. v9.4.14) by @jasonacox in https://github.com/jasonacox/pypowerwall/pull/52. See https://github.com/jasonacox/Powerwall-Dashboard/discussions/371.Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.6.2a...v0.6.2b
Published by jasonacox about 1 year ago
tessolarcharge.py
by @venturanc in https://github.com/jasonacox/pypowerwall/pull/36 & https://github.com/jasonacox/pypowerwall/pull/37 & https://github.com/jasonacox/pypowerwall/pull/38
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.6.2...v0.6.2a
Published by jasonacox over 1 year ago
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.6.1...v0.6.2
Published by jasonacox over 1 year ago
SystemMicroGridFaulted
and SystemWaitForUser
grid conditions to grid_status()
function. Both are mapped to "DOWN" conditions. Discovery by @mcbrise in https://github.com/jasonacox/Powerwall-Dashboard/issues/158#issuecomment-1441648085./alerts/pw
endpoint with dictionary/object response format by @DerickJohnson in https://github.com/jasonacox/pypowerwall/pull/26
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.6.0...v0.6.1
Published by jasonacox over 2 years ago
poolmaxsize=10
to align with Session object defaults. Note: pool use applies to multi-threaded use of pyPowerwall only, e.g. as with the pyPowerwall Proxy Server.PW_POOL_MAXSIZE
to proxy server to allow this to be controlled (persistent connections disabled if set to zero).PW_TIMEOUT
to proxy server to allow timeout on requests to be adjusted.Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.5.1...v0.6.0
Published by jasonacox over 2 years ago
grid_status()
responses for syncing to off-grid by @mcbirse in https://github.com/jasonacox/pypowerwall/pull/19
Full Changelog: https://github.com/jasonacox/pypowerwall/compare/v0.5.0...v0.5.1