gitwtfhub

wtf is tesla-sungrow-charge-controller?

guiguan/tesla-sungrow-charge-controller — explained in plain English

Analysis updated 2026-05-18

2GoAudience · developerComplexity · 4/5LicenseSetup · hard

TL;DR

A controller that automatically times a Tesla's home charging to use surplus solar power from a Sungrow inverter.

Mindmap

mindmap
  root((Charge controller))
    What it does
      Reads solar export
      Controls Tesla charging
      Home geofencing
    Tech stack
      Go
      Modbus TCP
      Tessie API
    Use cases
      Solar powered EV charging
      Kubernetes deployment
    Audience
      Home automation developers
      Solar EV owners

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Automatically charge a Tesla only when a home solar system is producing surplus power.

REASON 2

Read live exported power from a Sungrow inverter over Modbus TCP.

REASON 3

Start and stop Tesla charging remotely through the Tessie API based on solar surplus.

REASON 4

Deploy the controller as a container on a home Kubernetes cluster.

What's in the stack?

GoModbus TCPTessie APIKubernetes

How it stacks up

guiguan/tesla-sungrow-charge-controlleranomalroil/1keyanshuman852/dasan-router-cli
Stars222
LanguageGoGoGo
Last pushed2019-05-17
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/53/53/5
Audiencedeveloperops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires a Sungrow inverter with a verified Modbus register, a Tessie account and token, and matches a 230V single-phase electrical setup by default.

MIT license: use, modify, and distribute freely, including commercially, as long as you keep the copyright notice.

Wtf does this do

This project automatically times a Tesla's home charging so it soaks up extra solar power instead of drawing electricity from the grid. It connects to a Sungrow solar inverter over a protocol called Modbus TCP, which is a common way industrial and solar equipment shares data, and to the car itself through a third-party service called Tessie that lets other programs control Tesla vehicles. Roughly every 30 seconds, the controller checks how much power the solar inverter is currently exporting to the grid, meaning the house is producing more than it is using at that moment. It also checks the car's current status, including battery level, whether it is plugged in, and its GPS location. If you set home coordinates, it only acts when the car is parked within about 50 meters of home, so it will not try to manage charging while the car is out and about. Based on the exported power, it works out how fast the car should charge, starting a charge session when there is enough surplus solar and stopping it again when the surplus drops too low, adjusting the charging current in between. The README is upfront that the exact Modbus register used to read exported power is specific to the inverter model, meter, and firmware, and walks through how to find and verify the correct register for a different setup using a separate tool. It also assumes a single-phase 230 volt electrical setup when converting between watts and amps, which fits countries like Australia rather than regions using different voltages. The project is written in Go, and the README documents building it locally, packaging it into a container image with a tool called Dagger, and deploying that container to a Kubernetes cluster with example configuration files. It requires a Tessie account and API token for the specific car, and a Modbus TCP connection to the inverter. It is licensed under MIT.

Yoink these prompts

Prompt 1
Explain how this controller decides when to start and stop charging a Tesla based on solar surplus.
Prompt 2
Walk me through finding the correct Modbus register for my Sungrow inverter model.
Prompt 3
How do I configure the required environment variables like TESLA_VIN and TESSIE_AUTH_TOKEN?
Prompt 4
What would I need to change in this project to support a different inverter brand or voltage?

Frequently asked questions

wtf is tesla-sungrow-charge-controller?

A controller that automatically times a Tesla's home charging to use surplus solar power from a Sungrow inverter.

What language is tesla-sungrow-charge-controller written in?

Mainly Go. The stack also includes Go, Modbus TCP, Tessie API.

What license does tesla-sungrow-charge-controller use?

MIT license: use, modify, and distribute freely, including commercially, as long as you keep the copyright notice.

How hard is tesla-sungrow-charge-controller to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is tesla-sungrow-charge-controller for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.