Biasing predbat towards keeping the battery topped up

14 comments started 2024-10-03 last 2024-10-04
Home AutomationHome Assistant
W
#1 Weasel

Hi Folks,

I had my 13.5kWh AIO plus GW installed about 3 months ago, but only had smart meters fitted in the middle of last month. By coincidence, I started using HomeAssistant a month or two ago for other purposes and only stumbled upon GivTCP, PredBat etc by chance.

In advance of my smart meters, I set up GivTCP and PredBat a few weeks ago, using an export rate of zero and the Octopus rates from the URL and familiarised myself with it all, but it was only yesterday that my export meter was fully active and feeding data back to Octopus.

I changed my sensor values in apps.yaml to use my Octopus sensors for the import and export rates and let predbat do its thing (which it did well). I am eagerly awaiting the appearance of the export statistics in my Octopus account, and know this will take a day or two, so in the meantime and am looking at predbat in more detail.

I am on the Cozy Octopus tariff so have cheap rates at 04:00-07:00, 13:00-16:00 and 22:00-00:00 and a peak period between 16:00 and 19:00. I noticed this morning at 07:00. my battery was at 53% and expected to reach 38% before the next charging interval at 13:00 whereupon it will charge to 100% before 16:00 and start exporting in the 16:00-19:00 period. This is all fantastic and I am in awe of the people who have developed this software.

The only thing I am questioning is why was the battery only at 53% at 07:00 - there was ample opportunity to charge it further in the period 04:00-07:00 so why not have a battery that is more fully charged. Obviously in most operating circumstances, this is not an issue and I am suffering from "Charge anxiety", but if there is no extra cost involved why not put some more juice in the battery? I appreciate that when my solar panels are generating, it might be wise to have some room in the battery to prevent solar-export, but looking at today's forecast, there is no obvious reason why the battery could not have been fully charged at 07:00.

TL;DR What ways (if any) are there to bias predbat towards maintaining a higher charge level in the battery

Cheers
Chris

G
#2 geoffreycoan

Weasel The only thing I am questioning is why was the battery only at 53% at 07:00 - there was ample opportunity to charge it further in the period 04:00-07:00 so why not have a battery that is more fully charged. Obviously in most operating circumstances, this is not an issue and I am suffering from "Charge anxiety", but if there is no extra cost involved why not put some more juice in the battery?

There is a cost involved to charge your battery overnight on the Cosy tariff, Predbat will weigh that up against the predicted solar generation (genuinely free electricity) and against exporting the solar generation (earning 15p).

All that gets compared against what your predicted house load is and when you are drawing it. With Cosy you have a further cheap rate period during the day to topup the battery if need be.

I appreciate that when my solar panels are generating, it might be wise to have some room in the battery to prevent solar-export, but looking at today's forecast, there is no obvious reason why the battery could not have been fully charged at 07:00.

If you share your predbat plan we can see what it’s predicting for the day but it is pretty good at getting the forecast right and minimising your electricity cost.

TL;DR What ways (if any) are there to bias predbat towards maintaining a higher charge level in the battery

RTFM !

Set best_soc_keep and best_soc_min to define minimum battery levels

If you think your house load may be more than historical, set input_number.predbat_load_scaling

There are lots of configuration options in Predbat.

W
#3 Weasel

geoffreycoan
I will take a screenshot of my plan tomorrow and I do understand that there is a cost to charging the battery.

My point is that predbat chose NOT to charge the battery above 53% in the overnight cheap period when it could have done so. Instead, it will need to charge more in the afternoon period. Overall the total charge into the battery would be the same, its just that I would prefer it if the more charging happened overnight.

I did RTFM! 🙂 and have set values for both best_soc_keep and best_soc_min. I will re-read the manual for these entries in case increasing best_soc_keep might help me

G
#4 geoffreycoan

Weasel My point is that predbat chose NOT to charge the battery above 53% in the overnight cheap period when it could have done so. Instead, it will need to charge more in the afternoon period. Overall the total charge into the battery would be the same, its just that I would prefer it if the more charging happened overnight.

If you want to bias charging in the overnight Cosy period rather than charging during the day Cosy period, you can do this by setting an import rate override to make the overnight period appear cheaper to Predbat. Otherwise if they are the same price then Predbat won’t artificially charge overnight.

Best_soc_keep can be used to influence the behaviour as I said, to instruct the minimum amount to keep in the battery, but you don’t want to set this too high as otherwise it’ll start charging really when it shouldn’t do. A few kWh for unexpected additional load is usually a good value.

Worth commenting that charging during the day Cosy could be cheaper than overnight charging as any solar generation will contribute to the charging and reduce your import. Of course solar could be higher or lower than forecast so it’s not guaranteed. I personally find it useful to look at both the PV50 and PV10 forecasts to get an idea of the range of forecast values - I use Solcast integration but Predbat direct to Solcast website does the same, turn on debug mode and you’ll see the high and low PV forecasts

W
#5 Weasel

geoffreycoan

Thanks for the suggestion regarding overrides to the import rate, I will play with this.

I have experimented with best_soc_keep and find that it can inhibit exporting. By trying to maintain a high battery charge yet still export as much as I think sensible during the peak, I think I might be trying to have my cake and eat it 🙂

I have the solcast integration, but have not (yet) looked much at it other than to configure the sensor values - it seems to do the job nicely and I definitely want to try to avoid exporting solar. I think I probably need to change my mindset. I invested in the battery to lower my bills, but after a recent 4-hour power cut, I have become acutely aware of the benefits of the EPS functionality. I chose GivEnergy over other solutions because of the EPS, but I may have become a bit fixated on it 🙂

W
#6 Weasel

I have experimented in setting up rate overrides for the late night and early morning cozy periods and have seen they can have a dramatic effect on the plan. For instance, I set the rate to 1p on the 04:00-07:00 period and predbat planned to discharge some at 08:00 when the export price was 11p. This is obvious really, predbat was just doing what it thought was best based upon the rates I gave it.

I will leave well alone today with no overrides. If I get chance tomorrow, I will try increasing the rate for the 13:00-16:00 period. This will hopefully have similar effects to reducing the import rates of the other cozy periods, but might not encourage spurious discharging.

Thanks again geoffreycoan for pointing me in this direction. Even if nothing comes from it, I will gain a deeper understanding of how predbat works.

J
#7 JasonF

I’ve done something similar for my end of day export, I wasn’t totally happy with what it was doing, or picking random slots during the day.

So I set 11-1130 to be 15p, then set 1030-11 to be 14.5p etc I did this for each 30 min slot from 9pm then set the rest of the day to 0. Basically I wanted a wide enough window for the export to happen but I wanted to make sure it did it as late as possible.

I also wanted to keep the 2330-0000 slot idle just so the battery doesn’t go from full discharge into full charge so I set the lowest export price on this slot and I increased the charge price to be 1p higher than the highest export, basically making this slot available to predbat as a last resort.

G
#8 geoffreycoan

Just to say @Weasel you don’t have to set the import rate explicitly, you can set an adjustment, e.g. -1 or -0.5 to ‘nudge’ Predbat in a particular direction. If you set it to something wild like 1p then as you saw it will tend to favour discharging beforehand to maximise the import benefit.

r/e EPS, best_soc_min is the value to set if you want to keep some electricity in the battery for EPS function, Predbat won’t plan to use this charge, its only if home demand is unexpectedly higher than predicted will the battery discharge and use it. So don’t set too high a value as it’ll be wasted storage in normal use.

Sounds like you’re getting to grips with how it works ⭐️

J
#9 JasonF

geoffreycoan agreed I used adjustments for my nudging.

W
#10 Weasel

I have played around a bit during the night and have figured out that I was being too precious about keeping my SOC high. I am going to keep things as-is for now without any rate adjustments.

What I also took a quick look at was the effect of switching my export tariff from Agile to Fixed. I was surprised to find that based on the next 24 hours predicted costs, Fixed was slightly cheaper.

Whilst this seemed counterintuitive at first, I quickly realised that I would be benefitting from having far more opportunity to export, albeit at lower prices. This effect might be amplified in the summer when I have some solar to export. My peak daily solar generation over the past 4 years just about matches my daily consumption so the benefit might not be much.

That said, there doesn't seem much downside if any to switching to the Fixed export tariff. I will mull this over

G
#11 geoffreycoan

As has been mentioned in other forum links, the opportunities for exporting at an agile export rate greater than the fixed 15p rate are limited.

Weasel I quickly realised that I would be benefitting from having far more opportunity to export, albeit at lower prices. This effect might be amplified in the summer when I have some solar to export. My peak daily solar generation over the past 4 years just about matches my daily consumption so the benefit might not be much.

What’s also worth considering is what your import price is. I’ve been on agile import all through the summer. Just got my August and September import bill which shows an average agile import rate of 6.61p so there’s a great opportunity to import overnight at cheap rates, fill the batteries up, then export more excess solar during the day.

W
#12 Weasel

geoffreycoan I understand where you are coming from with this, but my brain is still getting used to the fact that I can time my imports and exports, let alone have variable rates for them. I know that predbat will be a great asset in helping me minimise my electrickery costs, but I think I need to take it one step at a time.

I recall seeing that it might be better to have the 15p fixed export than using Agile, but until I set this up in my plan, I did not fully appreciate the difference it could make. Switching to Fixed export, will not be any worse for me and will probably be better in the summer when I will have excess solar.

As to switching to Agile Import - I am not ready for that one yet and will stick with Cozy Octopus for now. The 3 Cozy periods through the winter will enable me to keep my wife's studio warm simply by switching on the heat pump at 20 degC during the cheap rate periods.

Its worth mentioning that the studio is NOT on a battery protected circuit, so I must "manually" control the heat pump operation. At the moment, I use the simple timers built in to the heat pump to ensure I only use cheap-rate. At some point soon, I will get round to leveraging HomeAssistant for this purpose

G
#13 geoffreycoan

Weasel Agile is as ‘Gary does Solar’ says on YouTube, a “tariff for the adventurous”.

In 18 months of having my batteries installed I’ve come from receiving a legacy FIT income that would pay the panel cost off in 15 years and an annual bill of £2-3,000 on standard variable (or fixed rate tariffs when the deal was good), to receiving an income for export payments, initially Flux, then Agile, and ending up with a net-zero electricity consumption bill for the first full year.

Last year when I was deciding what to do for the winter I agonised about the risk I was taking, especially having seen what happened to prices the prior winter. It took me quite a while to decide Agile was a risk I could accept, and then get me and the family used to the idea of when to put the washing machine and dishwasher on to minimise the import costs.

To be honest it hasn’t been that much of an adventurous leap into the unknown, but I definitely couldn’t have done this without Predbat.

One step at a time

W
#14 Weasel

geoffreycoan Definitely one step at a time and the first step is switching to fixed-rate export which I have now initiated. In due course it will get switched over and I will notice in the predbat plan, but the difference in overall cost is small at the moment and since I can import 99% of my electrickery at the cozy octopus cheap rate, I am still pretty much halving my import consumption charges.

I don't think I will ever train my wife to put on the household appliances at specific times 🙂 but I tend to put the dishwasher on anyway and in a household of just two, the washing machine and tumble drier are not on daily