diy solar

diy solar

Forecast Based Battery Charging

epl91

New Member
Joined
Nov 2, 2021
Messages
2
I'm looking for help and advice to setup forecast based battery charging and smart electrical panel and smart thermostat to get the most utility out of a battery bank while minimizing the amount of energy I buy from the grid?

Say peak TOU energy costs are 6-10am and 5-8pm.

If today it was very sunny but tomorrow it will be very cloudy. I want a battery system to know that and raise the discharge limit overnight to like 50% while normally it will allow discharge down to 5% before switch to the grid. That way at 6am there will be enough battery left to get through the peak TOU from 6-10am and 5-8pm without need any energy from the grid during those times.

The forecast would also know from past data the trendline curve of how much energy the heat pump uses for how cold it will be the next day. If it will be extremely cold the next day maybe the battery needs to be kept at 80% instead of 50% to have enough energy to make the house off-grid from from 6-10am and 5-8pm. If energy is used quicker than expected then the smart thermostat will turn down the temp from 6-10am and 5-8pm from say 74 F down to 70 F to reduce loads. How does the system know if energy is used quicker than expected? It would use 15 min resolution energy data from past days with similar outdoor temperature to predict the energy use pattern that will occur today.

In the summer time lets say peak TOU is 3-8pm.

On a very sunny summer day, if forecast predicts the battery will hit fully charged before 3pm, I'd like the smart thermostat to crank the setpoint from 75 down to 70F to use up the excess energy. And this the precooling also means the air conditioning won't run as much from 3-8pm. And I want the battery+pv inverter to export/sell energy to the grid from 3-8pm, leaving only enough for the house to make it through the night off grid. So the next morning when it will again be very sunny the battery starts the day at like 10% charge.

These are just some example scenarios but they cover the bulk of the situations this smart forecast based battery charging system would need to negotiate.

Thoughts on the possibility of making such a system work? Any ideas on how to start? What equipment (battery charger, smart inverter etc.) to buy to get started?

Thanks
Best
-Edward
 
I was thinking about doing something similar and the programming got too complex for my skill set pretty quickly.
It's something you're going to need to literally write the code yourself, as far as I know.

Do you have an inverter and battery already?

Also, what power company and location have peak rates in the morning?
 
I could see this being plausible, but it would not be an out-of-the-box unit. This is something that might be possible with HomeAssistant, and a LOT of programming.
 
I'm off-grid, but I have a similar problem.
  • In the summer, I want to maximize my power excess usage to do useful things (dry lumber, dehydrate foods, purify/distill water, compress gasses, etc) when I can predict adequate sun will be available for recharging.
  • In the winter, I want to minimize my generator usage while keeping the (LFP) batteries in a safely charged state and timing generator usage to the times which are least disruptive to my neighbors.
Right now I do that manually by;
  • When there's a surplus, waiting until it is clear the batteries will get near full and turning on extra loads to soak up the excess, potentially even drawing the batteries down to 75% depletion depending on my optimism about the next day's weather.
  • When there's a deficit, waiting until the last suitable generator run slot before my batteries would reach 20 - 25% depletion, then recharging to between 50% and 65% depending on my pessimism about the next day's weather.
Obviously, I only sometimes have attention for that process (especially in the summer) so I'd eventually like to automate it.

The heuristics I've described above rely on some implicit assumptions about my steady-state system in terms of the ratio of my background usage (servers, freezer, networking hardware, etc) to my storage capacity and solar array size, but I think that could be generalized.

I only know a tiny bit about it, but there's a pretty well explored engineering topic of Control Systems. Both your problem and mine seem similar to a Multiple Input Multiple Output system. We just have slightly different inputs/outputs.

My System:
  • Inputs:
    • Current battery state
    • Baseline average daily background load
    • Predicted PV yield based on anticipated sun for today + N days
  • Outputs:
    • Optional loads
    • Generator
Your System:
  • Inputs:
    • Current battery state
    • Baseline average daily background load
    • Predicted PV yield based on anticipated sun for today + N days
    • Predicted temperature for today + N days
  • Outputs:
    • Heating with heat pump
    • Cooling with heat pump

In general, it's probably best to have a good idea how the conceptual control strategy would work before committing to a particular software/hardware design.

That said, the baseline system component requirements here are probably just to get hardware that you can monitor sufficiently to track 3 things; PV production, battery state of charge, and overall power usage. That monitoring data needs to be fine-grained enough to be useful (say at least 1 minute datapoints) and needs to be accessible (i.e. not locked up in a proprietary cloud service) from some place that your control software/algorithm can run. (e.g. maybe a software service, cron job, something in Home Assistant, or Node Red, etc) Loads could then be adjusted or switched on/off as a function of that monitoring data and the weather forecast.

If I build such a system, I would probably use the data I already feed into InfluxDB at a sub-minute granularity. Presumably, I'd have a control loop (probably a stand-alone Python script in a Docker container) which runs say once a minute and operates against the last several days of data plus the weather forecast. It could then issue commands to microcontrollers with relays (effectively DIY smart plugs) to turn on/off loads or the generator as required.

Finally, I'll note that complexity is the enemy of stable systems and anything automated along the lines I've described above definitely comes with a lot of added complexity. Make sure the benefit(s) outweighs that complexity cost. i.e. Sure, it might be cool, but will it pay for itself in terms of your time/money/attention/satisfaction/fun?
 
I've been working on something like this for some time, taking loads, past behavior, time of year, etc. into account. It's all pretty custom and tailored to my set-up and location - but maybe something more generic will come from this in the future.
 
Why not forecast your usage?

Seems lot easier!!!

Care to elaborate? Naively, I'm fairly certain forecasting usage only helps with a subset of the larger problem described in this thread...
 
Why not forecast your usage?

Seems lot easier!!!

Some loads would be impossible to forecast just on usage. Take my heat pump. I want it to run based on the temperature outside, but also on how sunny it is. If it's not sunny, don't run it - but if it is, do so when it's cold.
 
Care to elaborate? Naively, I'm fairly certain forecasting usage only helps with a subset of the larger problem described in this thread...
If it’s sunny tomorrow then overcast the next, plan to run those loads of laundry and dishwasher or pump water (if you have a large pump storage) when the sun is shining. If it’s gray out use the gas grill vs the electric range.

Sure it doesn’t help constant loads, but it’s an easy thing to adjust by the user.
 
If it’s sunny tomorrow then overcast the next, plan to run those loads of laundry and dishwasher or pump water (if you have a large pump storage) when the sun is shining. If it’s gray out use the gas grill vs the electric range.

Sure it doesn’t help constant loads, but it’s an easy thing to adjust by the user.

That's one of the options I was guessing you might mean. For many systems that's the most pragmatic strategy...

However, beyond what @upnorthandpersonal described, it also assumes both a more hands-on approach and being responsive to the weather conditions as they happen.

Further, it doesn't help with scenarios where there is significant lag between choosing to modify the loads of the system and the data that would tell you in real-time if you made the right choice. e.g. If you would make a different choice (either automatically or manually) based on whether tomorrow (or the next week) will be sunny, your choices might need to take future weather into account.

This effect gets more pronounced the larger the battery reservoir is compared to the available charging sources and the size of the loads that can be used to shape usage.

We can imagine a system that has weeks of autonomy via battery storage that also has huge conditional loads where eating heavily into reserves is okay as long as there is going to be sun within a week, but would otherwise be very costly in terms of generator fuel or grid demand power rates if the wrong decisions are made days ahead of time.
 
TBH, I don't really care about loads - what I want the system to do is if tomorrow is going to be a bright day with lots of solar energy - then I don't need to take the batteries to a high charge on cheap overnight grid power, but if tomorrow is dark and grim - then I need those batteries full
 
Back
Top