batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Freeze discharge slots disappear from the plan in favour of forced export

Open mpartington opened this issue 8 months ago • 17 comments

Describe the bug myself.and another user have noticed that Predbat plans periods of freeze discharge, which are sensible. Then despite having sufficient solar (even considering best10 plan) , these slots disappear and an export is planned for later instead.

Expected behaviour Freeze discharge where appropriate to minimise round trip losses

I caught the debug file late, but can use this to upload more data as available

Predbat version V 8.16.6

Environment details

  • Inverter and battery setup - Givenergy AC3 and 2x5.2kWh batteries
  • Standard HAOS

Screenshots If applicable, add screenshots to help explain your problem. The most useful ones can be your battery chart, the Predbat HTML plan and your current settings in HA.

Image

Image

Image

Log file Can you capture a log file from the time of the issue, debug mode is not normally required.

Predbat debug yaml file

predbat (1).log.txt

predbat_debug.yaml.txt

Enable debug mode and let Predbat run for one cycle. Look in the 'debug' directory under the Predbat add-on and take the .yaml file for the time period in question. Rename the predbat_debug_XX_XX_XX.yaml to predbat_debug_XX_XX_XX.yaml.txt and upload it to Github. This will allow your plan to be reproduced and also stores all your settings for review.

mpartington avatar Mar 18 '25 09:03 mpartington

Two more alternating plan debug files Common sense says a freeze would be the best option to minimise later discharge

predbat_debugNOFREEZE.yaml.txt predbat_debugFREEZE.yaml.txt

mpartington avatar Mar 19 '25 07:03 mpartington

After a short period of discharge freeze, it's cancelled it and set a nearly 2 hours forced discharge at the end of day, rather than exporting the excess solar directly

predbat_debug(1).yaml.txt predbat_debug.yaml.txt

mpartington avatar Mar 20 '25 10:03 mpartington

This is related to the value used for input_number.predbat_metric_min_improvement_expor

If you put a low value e.g. 2, then it plans an export freeze. However if you use a higher number (which is intented to stop marginal battery discharge - not stop direct export), then it removes the freezes.

If I use a low number, it annoyingly plans in an early discharge mid afternoon rather than waiting til just before cheap rate. Try simulating with the debug files above

Likely related to an earlier issue I raised #1997

mpartington avatar Mar 20 '25 16:03 mpartington

I've pushed a fix to 'main' which I will release too which decouple the min improvement export from freeze export

springfall2008 avatar Mar 22 '25 16:03 springfall2008

Thanks , will.givw main a go

mpartington avatar Mar 22 '25 21:03 mpartington

I know the release notes for the last release tried to increase the likelihood of freeze discharge. It seems to be very undecided from my records, with frequent switching. Not sure what would be of use to investigate, but I can try and supply what is needed

Image

mpartington avatar Mar 25 '25 13:03 mpartington

mine has been pretty stable today

image

have you got a metric min improvement export set? Mine is set to 5p

gcoan avatar Mar 25 '25 17:03 gcoan

I've also got it set to 5p, however I'm running the version on main where Trefor has decoupled it, so I wonder if it needs a bit of damping adding

mpartington avatar Mar 25 '25 19:03 mpartington

Here's a couple of debug files. On the face of it, there appears no reason to have switched from freeze export to demand. Seems to be turning out to be a similar pattern to yesterday. Changing pause mode uses a lot of register writes (not that I'm worried as i'm using RTC)

Image

predbat_debug (1).yaml.txt predbat_debug.yaml.txt

Edit.. It did turn out to be another very unstable day, changing modes frequently. Each time it was in the battery SOC got fuller.until.it got to 100%

Image

mpartington avatar Mar 26 '25 09:03 mpartington

Same today

Image

mpartington avatar Mar 28 '25 10:03 mpartington

@springfall2008 I've updated to the latest version on main and tried to get most settings near to default, however the plan still constantly flip flops between freeze export and demand. The soc gradually increases until.it reaches 100%, so this feature doesn't seem to be working correctly (at least for me)

I have min metric improvements export set to 5 (the default 3 added unwanted early discharges)

I've captured 2 debug yamls. 1 in demand and one in freeze export

Do you have any suggestions for my config, or can anything be done to make it more stable in decision making. Plenty of solar today and low loads, so expected it to hold at 89% as originally planned.

predbat_debug-1.yaml.txt

predbat_debug-2.yaml.txt

Image

mpartington avatar Apr 08 '25 13:04 mpartington

I'm seeing this problem too. At the beginning of the day, the plan was to hold at 85%~ battery, and then as time approaches that, it all gets dropped and replaced with Demand followed by a dump later in the day.

lxalln avatar Apr 10 '25 11:04 lxalln

As a work around selecting "Set Export Freeze Only" to true seems to be keeping the slots and I'm not seeing the cycling.

I'll probably set an automation to turn this switch on/off at sunrise/sunset as a temporary fix.

mpartington avatar Apr 10 '25 11:04 mpartington

Yesterday PB planned mostly a full day of freeze export and seemed to hold to it. Today it isn't planning much freeze export (but fairly certain it had it all blocked in yesterday), despite several hours of forced export planned at the end of the day:

Image

predbat-11-04.log

predbat_plan-11-04.txt

predbat_debug-11-04.txt

Meatballs1 avatar Apr 11 '25 08:04 Meatballs1

Debug capture. Just changed from freeze export to demand, despite significant margin to soc keep on the best10

Image

predbat_debug-2.yaml.txt

mpartington avatar Apr 11 '25 09:04 mpartington

My plan has updated to more sane version:

Image

Meatballs1 avatar Apr 11 '25 10:04 Meatballs1

Finally managed to catch it in both states. V8.18.1 main version for testing

predbat_debug.yaml.txt predbat_debug-3.yaml.txt

Image Image

mpartington avatar Apr 14 '25 13:04 mpartington