I added 20 kWh of battery storage to a 12.6 kW solar system a couple of months ago. For multiple reasons I will elaborate on shortly, I set about creating an adaptive battery charging functionality in Home Assistant. On sunny days when excess power is forecast, I adjust the maximum charging rate every 15 minutes to defer the batteries reaching 100% SOC until a "target hour". The system is composed of a dashboard, two automations, and a variety of template sensors. And of course input_number and various other 'helpers'.
Why? Three reasons:
1. The charge controller of my Deye inverter is painfully unsophisticated. It charges the batteries to 100% and then holds them at "over current protection" voltage until the sun goes down. 4 to 6 hours at 57.6v until I lowered it. Charging isn't configurable in any way. Just full speed and then hold for the rest of the day. Maybe this is fine but I don't like it.
2. I can't export power yet but when I get approved, my export will be limited due to the capacity of my electric meter and the wire gauge between the inverter and the meter. If all excess energy goes to the batteries until they're fully charged, then power will be curtailed to the maximum power I can export to the grid. This will not maximize the amount of power my system can produce. I'll want to try to balance charging and export to maximize utilization of my system.
3. There will be days where there is enough power to charge the batteries, but only if none is wasted. Imagine a day with sunshine until 11 and then rain. In that scenario I'll want to charge with all available power. Normally I'd prefer to limit charging to around .25c, but when necessary I want to use every available watt to charge the batteries.
I will elaborate on what I have built, probably in excruciating detail, but for now I just wanted to get this thread started. For now here is a screenshot of my Home Assistant dashboard.
Why? Three reasons:
1. The charge controller of my Deye inverter is painfully unsophisticated. It charges the batteries to 100% and then holds them at "over current protection" voltage until the sun goes down. 4 to 6 hours at 57.6v until I lowered it. Charging isn't configurable in any way. Just full speed and then hold for the rest of the day. Maybe this is fine but I don't like it.
2. I can't export power yet but when I get approved, my export will be limited due to the capacity of my electric meter and the wire gauge between the inverter and the meter. If all excess energy goes to the batteries until they're fully charged, then power will be curtailed to the maximum power I can export to the grid. This will not maximize the amount of power my system can produce. I'll want to try to balance charging and export to maximize utilization of my system.
3. There will be days where there is enough power to charge the batteries, but only if none is wasted. Imagine a day with sunshine until 11 and then rain. In that scenario I'll want to charge with all available power. Normally I'd prefer to limit charging to around .25c, but when necessary I want to use every available watt to charge the batteries.
I will elaborate on what I have built, probably in excruciating detail, but for now I just wanted to get this thread started. For now here is a screenshot of my Home Assistant dashboard.