CHAOS: CHarging Automatically on Solar (new open source project)

Zzzt

Member

Verified Owner
Joined
Mar 14, 2025
Messages
40
Reaction score
112
Location
Wisconsin
Cars
Gravity, Tesla X, Y, 3
Gravity DE Number
117
I bought a Lucid Gravity and ended up missing Tesla's Charge on Solar feature more than I expected to. So I built a replacement for Lucid vehicles: CHAOS (CHarging
Automatically On Solar).

CHAOS is an open-source daemon that watches your Tesla Powerwall in real time and automatically starts, stops, and adjusts your Lucid's charging to maximize
use of solar energy. It uses the pypowerwall and the community python-lucidmotors libraries.

What it does:

- Starts charging when solar surplus and Powerwall SOC exceeds your minimum thresholds
- Adjusts charge current dynamically as clouds roll in and out (rolling average smooths transients)
- Stops when your EV hits target SOC
- Includes a live web dashboard with power charts and history

Requirements: Tesla Powerwall, Lucid account credentials, Python run locally or in a Docker container

Source and setup instructions: https://github.com/bifrostservices/chaos

It's working well for me — happy to answer questions. Constructive feedback welcome as this is my first open source project.
 
That’s super cool
 
fantastic work, @Zzzt! I assume this is mostly beneficial if you're not sending solar back to the grid? I usually charge overnight when the rates are cheaper, but I do so from the grid, and send back when the rates are more expensive (aka peak)
 
Correct, this calculates the excess solar production you have and adjusts the charge rate of your Lucid to match it. It will start charging only when you have sufficient surplus and will stop when you no longer have that surplus. It is most useful for people who do not have the benefit of time-of-use rates or for those who want to maximize their grid independence.
 
Excellent!

For Enphase system owners, my Enphase IQ2 charger performs this same function well. It operates fully locally.

I'd thought about creating something similar to your project when I add a second EVSE, as Enphase's current EVSE software can't manage excess solar power sharing for two EVSEs.
 
I'm really stoked about this, and I have no idea why.
 
I bought a Lucid Gravity and ended up missing Tesla's Charge on Solar feature more than I expected to. So I built a replacement for Lucid vehicles: CHAOS (CHarging
Automatically On Solar).

CHAOS is an open-source daemon that watches your Tesla Powerwall in real time and automatically starts, stops, and adjusts your Lucid's charging to maximize
use of solar energy. It uses the pypowerwall and the community python-lucidmotors libraries.

What it does:

- Starts charging when solar surplus and Powerwall SOC exceeds your minimum thresholds
- Adjusts charge current dynamically as clouds roll in and out (rolling average smooths transients)
- Stops when your EV hits target SOC
- Includes a live web dashboard with power charts and history

Requirements: Tesla Powerwall, Lucid account credentials, Python run locally or in a Docker container

Source and setup instructions: https://github.com/bifrostservices/chaos

It's working well for me — happy to answer questions. Constructive feedback welcome as this is my first open source project.
Wow !! That's hot -sh-t!!
And here my girlfriend is delighted when I manage to change a lightbulb. I applaud what you have done, but am certain I will never share this with her I don't want her pushing me to attempt what you did :) :)
 
Excellent!

For Enphase system owners, my Enphase IQ2 charger performs this same function well. It operates fully locally.

I'd thought about creating something similar to your project when I add a second EVSE, as Enphase's current EVSE software can't manage excess solar power sharing for two EVSEs.

Good to know that there is a supported solution for single car charging if you have Enphase EVSE. My solar system actually uses Enphase microinverters and I originally looked into getting production data directly from the Enphase IQ Gateway, but the terms of their developer API effectively preclude hobbyest/free usage.

CHAOS supports multiple sites (I define a site as Powerwall plus the EVSE connected to it) because I have two sites here. It does not yet support multiple cars (I only have one Lucid), but that shouldn't be difficult to add.
 
Excellent!

For Enphase system owners, my Enphase IQ2 charger performs this same function well. It operates fully locally.

I'd thought about creating something similar to your project when I add a second EVSE, as Enphase's current EVSE software can't manage excess solar power sharing for two EVSEs.
Enphase has an API. This should be pretty trivial to extend to Enphase as well.


There are a few home assistant community store packages as well
 
Good to know that there is a supported solution for single car charging if you have Enphase EVSE. My solar system actually uses Enphase microinverters and I originally looked into getting production data directly from the Enphase IQ Gateway, but the terms of their developer API effectively preclude hobbyest/free usage.

CHAOS supports multiple sites (I define a site as Powerwall plus the EVSE connected to it) because I have two sites here. It does not yet support multiple cars (I only have one Lucid), but that shouldn't be difficult to add.
Yeah you’d have to use their local API rather than their cloud API. It’s totally doable though.
 
- Starts charging when solar surplus and Powerwall SOC exceeds your minimum thresholds
- Adjusts charge current dynamically as clouds roll in and out (rolling average smooths transients)
- Stops when your EV hits target SOC
- Includes a live web dashboard with power charts and history

Interesting solution for storing surplus of solar energy, but unless you work at home, you need to have two EVs:
- one EV to use during the day to commute to go to work, and
- one EV parked at home all the day to get charged, ready for use the following day.

In fact, some people buy an old EVs, like a leaf, for few thousand dollars, just to store energy and then charge their EV at night.

In my case, to store my surplus of solar energy to heat some hot water using an extra heat-pump water tank.
 
Interesting solution for storing surplus of solar energy, but unless you work at home, you need to have two EVs:
- one EV to use during the day to commute to go to work, and
- one EV parked at home all the day to get charged, ready for use the

We have two EVS, and are retired. We often use one EV during the day while charging the other. A EV is by far the least-expensive way to buy a large home energy storage system.
 
Good to know that there is a supported solution for single car charging if you have Enphase EVSE. My solar system actually uses Enphase microinverters and I originally looked into getting production data directly from the Enphase IQ Gateway, but the terms of their developer API effectively preclude hobbyest/free usage...
I'm using Home Assistant for other stuff - there is a local Enphase Envoy integration. Easier to deal with for those of us whose software days are in the past.
 
But very few provide directly V2G capability.
I'm hoping it will arrive this year. Enphase has one bidirectional EVSE shipping (the AC-coupled IQ 2), and another due later in 2026 (a DC-coupled unit).
SigEnergy and dcbel have demonstrated DC-coupled V2X with several EV models, though not yet officially supported by the car manufacturers.

GM, Kia/Hyundai. Volvo, Polestar, someday Lucid?
 
...My solar system actually uses Enphase microinverters and I originally looked into getting production data directly from the Enphase IQ Gateway, but the terms of their developer API effectively preclude hobbyest/free usage...
I forgot to mention that HA's local Enphase Envoy integration does provide microinverter data. Maybe there's something in it you could make use of.
 
I'll look into it, thanks.

Now if only I could get enough sun to get a decent screen capture of CHAOS in action. It has been cloudy this week.
 
Why not use a wallbox that does that!?
 
Why not use a wallbox that does that!?

Because I already had three networked Tesla Wall Connectors that share a 100Amp circuit. Two of those are for a Model 3 and a Model X that use Tesla's Charge On Solar implementation. The third is used by Gravity which doesn't work natively with the Tesla ecosystem. I believe I read that the most common car brand previously owned by a new Lucid owner is Tesla. So it is possible someone else may benefit from this work. Moreover, I'm not aware of a solution that allows three EVSE to share a single circuit and provide dynamic charge on solar capability.

If you are starting from scratch then purchasing EVSE with this capability is certainly the simplest solution.
 
Because I already had three networked Tesla Wall Connectors that share a 100Amp circuit. Two of those are for a Model 3 and a Model X that use Tesla's Charge On Solar implementation. The third is used by Gravity which doesn't work natively with the Tesla ecosystem. I believe I read that the most common car brand previously owned by a new Lucid owner is Tesla. So it is possible someone else may benefit from this work. Moreover, I'm not aware of a solution that allows three EVSE to share a single circuit and provide dynamic charge on solar capability....
I think your solution will find a lot of interest and use. Tesla's solar ecosystem seems to be the most common type in my neighborhood.
 
Back
Top