jasonacox / pypowerwall

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

Create tessolarcharge.py #36

Closed venturanc closed 1 year ago

venturanc commented 1 year ago

1st version: Add script to allow charging a Tesla car with excess solar, using PyPowerwall local docker container to get realtime production and consumption data from Tesla Powerwall, and change car charging rate via Tesla API with TeslaPy.

ToDo: add environmental variables, possible add web API endpoints to turn off and on solar charging so that script can be left running indefinitely when car plugged in and do not want to charge.

jasonacox commented 1 year ago

This is great @venturanc ! Thank you! We should create some documentation (I can help if you want) by adding a section to:

venturanc commented 1 year ago

Good idea, I'll see if I can add some details to the readme and you can fix anything I leave out? I'll copy the format of the other tools.

jasonacox commented 1 year ago

Thanks @venturanc ! This is a great addition. 🙏

venturanc commented 1 year ago

I'm dumb and left out the requests import when I was copying everything from my test environment so the current version will give an error message if it's run during solar production hours (this is why I shouldn't develop in a Jupyter notebook). Setting this up from scratch on a new environment and will test when the sun is shining (hopefully tomorrow) and I'll make sure I have it working before submitting an updated PR. Sorry about that.