Python tesla powerwall API
Python Tesla Powerwall API
Note: This is not an official API and as such might be incomplete and fail at any time
Usage
Setup connection
from tesla_powerwall import PowerWall
# Without authentication
power_wall = PowerWall("<ip of your powerwall>")
# With authentication
power_wall = PowerWall("<ip of your powerwall>")
# Username must be either 'installer' or 'custumer'
power_wall.login("<username>", "<email>", "<password>)
Current battery level
power_wall.charge
#=> 70.0
Sitemaster
sm = power_wall.sitemaster
#=> <tesla_powerwall.SiteMasterResponse ...>
sm.status
#=> StatusUp
sm.running
#=> true
sm.connected_to_tesla
#=> true
Current power supply/draw
Get current power supply/draw for home, solar, battery and grid
power_wall.battery_power
#=> -2350
power_wall.grid_power
#=> -21.449996948242188
If you want to know wether you are drawing or sending you can use is_sending_to_{battery, solar, grid} and is_drawing_from_{battery, solar, grid}.
Note: sending to solar occasionly happens at night as you can see in the documentation
Grid Status
Get current grid status. Returns one of these: GRID_STATUS_SYSTEM_GRID_UP, GRID_STATUS_SYSTEM_GRID_DOWN, GRID_STATUS_SYSTEM_GRID_RESTORED_NO_SYNC.
power_wall.grid_status
#=> "SystemGridConnected"
Powerwall Mode and backup reserve percentage
Get current mode. Returns one of these: OPERATION_MODE_SELF_CONSUMPTION, OPERATION_MODE_BACKUP, OPERATION_MODE_TIME_OF_USE, OPERATION_MODE_SCHEDULER
power_wall.mode
#=> "self_consumption"
power_wall.set_mode(tesla_powerwall.OPERATION_MODE_BACKUP)
power_wall.backup_reserve_percentage
#=> 24.6
power_wall.set_backup_reserve_percentage(tesla_powerwall.BACKUP_RESERVE_PERCENTAGE_30)
power_wall.set_mode_and_backup_reserve_percentage(tesla_powerwall.OPERATION_MODE_BACKUP, tesla_powerwall.BACKUP_RESERVE_PERCENTAGE_30)
Metadata
Release files for tesla-powerwall 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tesla_powerwall-0.1.4.tar.gz | 4.8 kB | Without provenance | Details |
Release files / tesla_powerwall-0.1.4.tar.gz
| Download URL | tesla_powerwall-0.1.4.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f2ff7647af2be514e9d875c7df49e634adf7138f6bae56137735b7d14a729a7
|
|
BLAKE2b-256 checksum How to use checksums |
0d36fd4384637288075bea9d7290eb289b379bcf329761f8a3ec30d2c6ded649
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
|
Security for tesla-powerwall 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.