Skip to content

RichieB2B/tesla-loadbalancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loadbalancer for charging Tesla vehicles at home

This is a simple home project that enables me to charge my Tesla at maximum speed without overloading my home power circuit.

It uses the mqtt messages published by DSMR-reader and calculates the current headroom for charging the Tesla. Using the charging_amps command the Tesla charging speed is scaled up and down as needed. This requires Tesla software 2021.36 or higher to be installed in the car.

Communication with the Tesla API is done using TeslaPy.

Example charge

In this example the charge is started at 24A but midway L3 is being used for other purposes as well. The load balancer scaled the Tesla back so the maximum current of L3 stays at 25A which is the maximum for this power circuit. As the consumption on L3 decreases the Tesla is scaled back up until it is charging at 24A again.

Example

Installation

To be able to use this software you need to do a few things first

  1. Install DSMR-reader as explained in the documentation
  2. Install an mqtt broker. On Raspbian: apt install mosquitto mosquitto-clients
  3. Configure DSMR-reader to publish telegrams on the dsmr/mqtt channel. Make sure phase_power_current_l1 (and l2+l3) are included in the mapping.
  4. Install the latest (bleeding edge) TeslaPy version:
    1. git clone https://github.com/tdorssers/TeslaPy.git
    2. cd TeslaPy
    3. python3 setup.py --prefix=~/.local
  5. Use cli.py to get a Tesla API token. This is explained in the README, I used the selenium method.
  6. Copy the cache.json to the tesla-loadbalancer directory
  7. Edit config.py to match your settings
  8. Start tesla-mqtt-loadbalancer.py

About

Loadbalancer for charging Tesla vehicles at home

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published