Giter Club home page Giter Club logo

teslahourlyoptimizer's Introduction

TeslaHourlyOptimizer

optimize the solar, powerwall, and vehicle charging based on the current hourly rate from comed

This script rides on the back of teslapy by tdorssers https://github.com/tdorssers/TeslaPy

you'll need to install a bunch of libraries

python3 -m pip install teslapy python3 -m pip install smtplib python3 -m pip install math python3 -m pip install pandas python3 -m pip install numpy python3 -m pip install requests python3 -m pip install tkinter python3 -m pip install matplotlib

to use, create config.txt based off config.txt.sample

the first time you run it, it'll open your browser to tesla.com and to login, it is getting the authentication token; go ahead and login and it'll direct you to a new url copy that url into the python terminal and it'll create a cache.json file with the authentication token. after thats happened once, it'll work using that token every time going forward

be default config.txt.sample has send_email_alert = 0, if you want to be emailed everytime the script does something, please update the Email section with an SMTP server you have access to and set send_email alert = 1 it doesn't work with gmail unless you turn off 2 factor authentication.

if you have a tesla car and you want the script to also start charging at the lowest price of the time, set control_cars = 1

if you have an openevse instead of a tesla, set control_openevse = 1 and provide the ip address of the openevse web portal

i've been tinkering with the trigger prices but for sprint of 2022 i've found the settings to be fairly balanced

always charge up everything when price is less than 3 cents neutral behavior between 3 and 5 cents basically try to keep 50% battery sell power and use battery when more than 5 cents

also to make this work properly, you have to create a custom time of use rate plan where you have 1-5am is set to ultra off peak with cost of .04 and all other times set to peak with cost of .14

it "tricks" the time of use of peak behavior to sell power instead of use power. and when we want it to not sell power we switch to self. the logic is really complex and messy because of all the random tweaking i did

i'll be cleaning it up at some point in the future

teslahourlyoptimizer's People

Contributors

jhu321 avatar

Stargazers

Gonzalo Escarrá avatar Greg Medders avatar  avatar

Watchers

Greg Medders avatar  avatar

Forkers

gmedders

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.