Hey HA folks,
I have seen quite a few solar surplus car charging automations which I think do serve as a starting point but none did serve my engineering mind well. So over time I thought it through and developed a quite sophisticated automation that today I wanna share with you in the hope it will be useful, either (almost) directly or as a conceptional way of building up your own solar surplus automation. Any questions? Ask me…
First my hardware setup:
11kWp solar panels (combined east, south and west)
10kWh BYD battery
10kW Solis S6 inverter
Compleo eBox Smart - 16A on 3 phases
Hardware longevity, no grid consumption and full house battery for the night were the the main priorities in my mind.
Concept:
-
Hardware longevity:
A) Wallbox: Minimise contactor opening and closing cycles during the day using house battery as buffer, timer and other helpers.
B) House battery: rounding charge target Ampere either up +1 or down -1 to keep battery in (dis)charge mode, reducing battery switch cycles. -
House battery shall be full to serve for the night. Therefore I use the Open-Meteo Solar Forecast integration to trigger when the car charging needs to stop. Since I figured out how to setup the forecast correctly it gives me very reliable data for the automation. Assume battery is at 70% in the evening and remaining forecast is 3kWh for the rest of the day… This would serve my battery with exact the amount of solar energy to refill. Yes - I know, if there weren’t the house load. So a safety factor is implemented (I have got nice results with 1.2)
-
It uses a real solar surplus template sensor that calculates:
DC_power − Inverter_losses − (house_consumption - wallbox_AC) / (3 × V_avg)
from real sensor data. It goes through a median and mean Filter to give a smoother input. And if I start the washing machine, solar surplus drops accordingly. -
the HA sun sensor provides solar elevation that I use to trigger 2 states.
A) no new session is allowed to start - current running session may continue, if enough surplus
B) defining night time where no surplus charging is allowed by principles…
Of course I added several hysteresis details to avoid flapping states around different thresholds as well.
Here are 2 graphs to show the charging behaviour during 2 days.
Car plugged in during the night, surplus automation switched on. Waiting for conditions are good enough to start charging at 10:10h. As car was fully loaded, automation and Charge Control switched off.
Automation stopped car charging when remaining solar forecast wasn’t sufficient to refill house battery for the night.
(And here is the yaml code:)
Nope, this was too much code / signs for the message. Instead I share the link to the file:
!!! DON’T COPY/PASTE !!! UNDERSTAND THE CODE AND DECIDE FOR YOURSELF HOW TO USE IT !!!
Solar Surplus Automation yaml file
For all the details: I store my whole HA configuration on github as well.
Cheers!
Edit / PS: as the header of the automation file directs to use it with ebox.py override → here the link My working Compleo (innogy) eBox Smart override · lbbrhzn/ocpp · Discussion #2029 · GitHub
I have implemented the soft ramp up and zero load contactor opening (hardware longevity for my eBox) patch into the ocpp integration, so also manual charge sessions will benefit from that design decision.


