springfall2008 / batpred

Home battery prediction and charging automation for Home Assistant, supporting many inverter types
https://springfall2008.github.io/batpred/
115 stars 40 forks source link

Longstanding issue with IOG + Predbat around midnight #1429

Open PianSom opened 1 week ago

PianSom commented 1 week ago

I am on Intelligent Octopus Go, which means that my low rate starts at 11.30pm. For a long time (many months, possible forever) Predbat seems not keen to acknowledge this, and does some discharging between 11.30pm and midnight.

This is especially noticeable today, a low solar generation combined with a high usage day. The plan below shows the battery being emptied by around 10pm, and then Predbat sceduling a charge and discharge cycle in that half hour, before reverting to more expected, rational behaviour.

I am at a loss to work out what to change to address this. Any suggestions?

Screenshot 2024-09-03 at 14 55 02
mpartington commented 1 week ago

Not sure I see an issue, it's maximizing profit with the 23.30 slot (buy 7p, sell 15p excluding losses). You can't discharge before 23.30 as your battery is empty and still end up with a 97% full battery at the end of the cheap period. Probably can't make 100% as the charge rate tails of as 100% approaches. Presumably you hit 100% later in the plan, or have enough to get through to next charge.

If you don't like this behaviour (discharge in a charge slot), I think it's this switch that needs to be turned off

switch.predbat_calculate_discharge_oncharge

PianSom commented 1 week ago

My point is that odd behaviour is limited to the 23.30-00.00 slot. It does not consistently display it in other slots, whereas it does show it consistently then.

Today's plan is a more normal one. I would expect Predbat to start discharge earlier than it is planning to, and then start charging at 11.30pm. But it never plans that. (Doing so would increase profit, since it would have 30 mins extra of low cost import.) Actually, in practise, when the time arrives it always (almost always?) does a charge then quick discharge cycle in that slot before settling down.

(I have wondered whether this effect is something to do with the fact that standing charge is applied just after midnight, but haven't seen anything to support that.)

Screenshot 2024-09-04 at 08 41 30
mpartington commented 1 week ago

Got you, yes that second screenshot does show an oddity. The first one seemed normal. Unfortunately I'm still waiting for IOG compatibility 😔, so not something I see. Sorry no real advice, but agree with your summary.

PianSom commented 1 week ago

I am now pretty convinced that this is some unexpected (by me, at least) behaviour to do with Combine charge slots and Combine discharge slots - both of which I have enabled

springfall2008 commented 1 week ago

I'd suggest turning off combine charge/combine discharge for IOG

PianSom commented 1 week ago

Thanks Trefor

I’ve found that switching them on gives a slightly better economic result, and - I think more importantly? - gives a plan which is “kinder” on the battery.

“On” results in a plan which has (broadly) just one charge-discharge-charge overnight. Whereas “off” cycles pretty much every half hour through the night. This can’t be good for the battery chemistry every day?

I will follow your suggestion for a few days, see how I get on.

springfall2008 commented 6 days ago

You could probably turning off 'calculate discharge during charge'?

PianSom commented 6 days ago

So turning off the "Combine charge/discharge slots" options solves the 23:30-00:00 issues, but results in an overnight repeating charge/discharge cycles at a high SoC - like this:

Screenshot 2024-09-09 at 09 23 31

A recent video commentary here highlighted research showing that the worst charging regimen modelled for longevity of LFP cells is exactly this - short cycling at a high SoC! So I think I will leave the options on, and live with the odd half hour behaviour.

Thanks for the suggestion anyway, Trefor

PianSom commented 6 days ago

Oops - crossed over. Thanks for the additional suggestion. Let me try that.

EDIT - ah, that (perhaps unsurprisingly) results in Predbat not taking advantage of the ability to maximise overnight income, which is a pity. I think that my original settings (so allowing discharge on charge, and combining charge/discharge slots) is the least worst.

sammort commented 2 days ago

Personally I think one longer discharge is better, especially for battery health. Would it be possible to adjust the modelling so if a long period exists (like on off-peak tariffs such as IOG) then charging and discharging is combined in that particular scenario?

I also think that with tariffs like IOG, with long periods of off-peak pricing, where Predbat is planning to charge/discharge/charge the battery, it shouldn't be intending to take the battery to 100%, because of the slower charging rates at higher SOC levels. Wouldn't it be optimal to take in to account the battery_charge_power_curve and battery_discharge_power_curve and not charge/discharge in those SOCs which do not provide 100% of power @springfall2008?