jasonacox / pypowerwall

Python API for Tesla Powerwall and Solar Power Data
MIT License
134 stars 24 forks source link

Add Powerwall 3 Local API Support #101

Closed jasonacox closed 3 months ago

jasonacox commented 3 months ago

v0.10.4 - Powerwall 3 Local API Support

import pypowerwall

# Activate HYBRID mode (for Powerwall / 2 / + systems)
pw = pypowerwall.Powerwall("192.168.91.1", password=PASSWORD, email=EMAIL, gw_pwd=PW_GW_PWD)

# Activate FULL mode (for all systems including Powerwall 3)
pw = pypowerwall.Powerwall("192.168.91.1", gw_pwd=PW_GW_PWD)

Related:

How to Test

This should work on Powerwall 2/+ and 3 systems. It requires that your host has access to the Gateway IP 192.168.91.1 and that you have the GW Password (usually found on QR sticker on Gateway).

Python Library

# First install the dev version
pip install pypowerwall==0.10.4.dev0

Simple Python test:

import pypowerwall

PW_GW_PWD="GWPASSWD"
pw = pypowerwall.Powerwall("192.168.91.1", gw_pwd=PW_GW_PWD)

pw.power()
pw.level()
pw.battery_blocks()

Proxy Test

You can also try the pypowerwall proxy:

docker run \
    -p 8675:8675 \
    -e PW_PORT='8675' \
    -e PW_HOST='192.168.91.1' \
    -e PW_GW_PWD="GWPASSWD" \
    --name pypowerwall \
    --restart unless-stopped \
   jasonacox/pypowerwall:0.10.4t61-beta

Try these URLs:

image
jasonacox commented 3 months ago

Please report any problems here or open a new issue.