You can use pyPowerwall simulator to mimic the responses from the Powerwall Gateway. This is useful for testing purposes.
-
Run the Docker Container to listen on port 443 (https) - pulls from Docker Hub
docker run \ -d \ -p 443:443 \ --name pwsimulator \ --restart unless-stopped \ jasonacox/pwsimulator
-
Test using the test.py script set to use localhost as the Powerwall
python3 test.py
-
Test using the pypowerwall proxy against the simulator:
# Launch Proxy cd .. export PW_PASSWORD="password" export PW_EMAIL="[email protected]" export PW_DEBUG="yes" python3 proxy/server.py # Open http://localhost:8675/example.html
-
Build the Docker Container
docker build -t pwsimulator:latest .
-
Setup the Docker Container to listen on port 443 (https)
docker run \ -d \ -p 443:443 \ --name pwsimulator \ --restart unless-stopped \ pwsimulator
-
Test the Proxy
bash test.sh
Check the logs:
# See the logs
docker logs pwsimulator
If you see python errors, make sure you entered your credentials correctly in the stub.py
file. If you didn't, edit that file and restart docker:
# Stop the server
docker stop pypowerwall
# Start the server
docker start pypowerwall