Smarter EV charging from solar

Reading time: 6 minutes (1221 words)
Author: @pugmiester
Tags: solar , ev , energy , homeassistant

Having solar and a storage battery at home gives us the opportunity to reduce how much energy we import from the grid which helps minimise our overall energy usage costs. However, we also have an EV, called Eddie, and he’s a real hungry beast when it comes to energy. Where we can, we try our best to use our solar energy to feed Eddie. That reduces our costs for travel energy and also helps us use as much of the solar that we generate at source, helping with our return on investment spreadsheet numbers.

There are days, at least during the summer months, where we have more solar being generated than we are using. Some of that is exported back to the grid and we get paid a little for it, but if Eddie is at home it’s better to feed him with some sunny miles and here is where the complications start.

We have a MyEnergi Zappi smart charger that we had installed when we bought Eddie, a couple of years before we had our solar installed. It’s worked really well for us. The Zappi monitors our mains supply using a CT clamp and if we’re still generating lots of solar but the house load is covered and the home battery is already full then we start to export and the Zappi will pickup the excess and send it to Eddie if he’s plugged in.

Sounds simple, right? Well, almost.

Where it becomes a little complicated is that there has to be a minimum of 1400W of export before the Zappi will start to charge the car. That’s part of the EV charging standard so it’s not something we can adjust, but what we can do is adjust how much energy is available for export in the first place.

Using the mark one eyeball, and a bit of quick maths, it’s easy to see that we generate the bulk of our solar energy around the middle of the day with less generated during the morning and early evening. Our GivEnergy solar and battery system is setup in “Eco” mode whereby it will dynamically charge and discharge the battery to use as little as possible from the grid. Doing this works by first offsetting any load in the house (usually around 200-300W) either by discharging the battery or as the sun comes up, using solar. Any excess solar not covering the house load is then directed to the battery until it’s full. That can be anything from 1W up to 3600W which is the batteries max charge speed. Only once the battery is full do we start to export, but what I’ve been looking at recently has made me realise we can make better use of the energy throughout the day if we think about it a bit.

As I mentioned earlier, we can only start to charge Eddie once we have at least 1400W of export but if it’s 9am and the home battery is still only 60% full, we might have 2500W of solar coming in and we’re taking 300W for the house and throwing the remaining 2200W into the house battery. That leaves nothing for Eddie. But, if we think about the charge and discharge options a little, we could instead be sending that energy to Eddie while we have enough available to hit that 1400W minimum, and then we could recharge the house battery later in the day when maybe we’re only generating 1000W of solar. That’s still more than we need for the house but is now below the limit for charging Eddie.

I’ve looked at this a few times in the past and tried things like switching the GivEnergy inverter modes or pausing and restarting the battery and while that does work, it’s a little clumsy and very binary and also needs me to be on the ball during the day. That mostly works but I’ve recently had another idea which I think will work better.

There’s no “standard” for communication between the GivEvery inverter and the MyEnergi Zappi car charger so they can’t talk to each other to make smarter decisions about how to use the energy we are generating but I also have Home Assistant running at home and that can talk to both the inverter and the Zappi charger so it could make the decisions. Home Assistant has a plugin / add-on called GivTCP. This gives you local control of the inverter as well as surfacing a whole heap of extra sensor data you can’t see from the native apps. One of those settings is the battery charge and discharge speed. You might be able to see where this is going.

What I’m testing at the moment, currently entirely manually, is adjusting the charge and discharge speeds of the battery depending on the amount of solar we are generating. I say manually, because I’m trying to work out the right guiderails for this, but it goes something like this…

Once we are “solar positive”, I’m keeping an eye on the home battery state of charge and the expected solar forecast for the day, plus a bit of window gazing. As soon as we are generating around 2500W I spring into action. Removing the 300W house load leaves us with 2200W. Reducing the battery charge level down to around 500W leaves us with 1700W which starts to export, at which point the Zappi spots it and starts charging Eddie. We’re still covering the house load and adding some charge to the battery but making better use of the sunnier parts of the day to get charge into Eddie.

I tried this at first just reducing the battery charge speed but as soon as it clouded over a little, and we dropped below 2000W of solar, the inverter happily starts to export at anything up to 3600W to make up the difference and then we get a runaway charge situation and the EV (50kWh pack) flattens the house battery (9.5kWh pack). But, if I also adjust the battery discharge down to 500W at the same time as I adjust the charge rate, that runaway effect gets blocked and clouding over means Eddie stops charging. That works really well from my initial testing but I’m then looking at what’s being exported and adjusting the charge rate for the battery so we don’t leak a lot of solar to the grid if we could be charging the battery instead.

So, as long as Eddie is at home and it’s sunny, it should be possible to make use of more of any solar we are generating in a more dynamic way to charge Eddie and still keep the house battery topped up. It’s simple to watch it happen and make manual adjustments but I need Home Assistant to do this for me so I don’t have to think, or far days when maybe I’m not home and can’t keep a close eye on things. I’m pretty certain I have all of the sensors and settings available I need to make this work, I just need to organise them all into a plan that I can automate reliably.

Once I have a system up and running, I’ll create another blog post about the process and likely revisit it a number of times as I try to perfect it.