batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Predbat charging (from grid) when plenty of solar is expected

Open freddanastrom opened this issue 9 months ago • 13 comments

Describe the bug Predbats goes in to charging mode on days when PV energy is more than enough to fully charge the battery. If clouds arrive or PV is not enough to cover the max charging allowed to the battery it will draw power from the grid.

Expected behaviour Expecting that predbat stays in Demand mode during days with enough sunshine.

Predbat version

8.16.3

Environment details

  • Solax inverter/battery
  • Standard HAOS installer
  • Swedish Nordpool (SE3) prices

Screenshots Plan: Image

predbat.status switching between demand/charge/hold when sun is shining at full blast: 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_debug_12_00_00.yaml.txt

freddanastrom avatar Mar 14 '25 11:03 freddanastrom

Adding some info from today's plan that shows the same behavior with charging at 12-13. I also reverted metric_self_sufficiency back to 0 in this one, which was set to 20 in my initial post. So all settings are pretty much default now, except for metric_min_improvement_export which i don't think matters in this case

predbat_debug_09_25_00.yaml.txt

predbat.log

Plan: Image

freddanastrom avatar Mar 15 '25 08:03 freddanastrom

Adding a more complete picture

The second charge at 16:30 is a hold at 100%, its used to run from grid at around 125 otherwise you import more at 138/140 range later on, you still run out of battery for the 132 price even with that hold.

The only question then is why the charge to 79 at 12:00 - let me run the plan without it next

Image

springfall2008 avatar Mar 15 '25 11:03 springfall2008

There's something odd here, if I put the two side by side as the plan with the charge appears to export more rather than less, will debug further

Image

springfall2008 avatar Mar 15 '25 11:03 springfall2008

So you have a hybrid inverter with a 20kw limit, an export limit of 11kw and a battery charge rate of 6kw? This means the PV is more than enough to charge the battery at full rate regardless of if charge is enabled or not.

Your battery charge curve tails off at 91% onwards and with the given export limit you will be getting clipping (lost solar you can't export)

All very odd...

springfall2008 avatar Mar 15 '25 11:03 springfall2008

Adding a more complete picture

The second charge at 16:30 is a hold at 100%, its used to run from grid at around 125 otherwise you import more at 138/140 range later on, you still run out of battery for the 132 price even with that hold.

The only question then is why the charge to 79 at 12:00 - let me run the plan without it next

Image

Yes, I understand the second charge at 100% and that one seems reasonable. At least as long as the prices for tomorrow are unknown.

It’s those mid day charges are a bit strange and by looking at the history of predbat.status it is also switching between hold and charge at times not shown in the plans I uploaded. So the plan must have changed a bit during the day.

Image

Let me know if you need any more debug files that match those time stamps.

freddanastrom avatar Mar 15 '25 11:03 freddanastrom

So you have a hybrid inverter with a 20kw limit, an export limit of 11kw and a battery charge rate of 6kw? This means the PV is more than enough to charge the battery at full rate regardless of if charge is enabled or not.

Your battery charge curve tails off at 91% onwards and with the given export limit you will be getting clipping (lost solar you can't export)

All very odd...

Correct. The charge curve is a bit uncertain though, but somewhat close to reality.

The battery capacity will be expanded with 120 kWh EV battery’s which I haven’t had time to connect yet and I actually tried setting the capacity to 120 kWh in Predbat just to see the plan, from what I can remember it still had some charging planned at that occasion. But also a lot higher prices in the evening that made it profitable to export.

freddanastrom avatar Mar 15 '25 11:03 freddanastrom

Okay I've found the issue, there's an assumption in the code that is probably wrong that if the battery is set to charge to say 80% that if there is more solar than load and the battery is about to reach that target it won't store the extra solar in the battery. In reality I think it will actually do so, I'll make a fix

springfall2008 avatar Mar 15 '25 13:03 springfall2008

Fix on 'main'

springfall2008 avatar Mar 15 '25 13:03 springfall2008

https://github.com/springfall2008/batpred/releases/tag/v8.16.4

springfall2008 avatar Mar 15 '25 13:03 springfall2008

Awesome! Looking good so far! The strange charging slot is gone and some export slots has showed up in the plan for tomorrow. Seems logical and I guess those are meant to make as much profit of the solar energy as possible? Image

freddanastrom avatar Mar 15 '25 17:03 freddanastrom

The hold charge is a little odd however as the battery is already full, I'd be interested to see the debug YAML if you get that again

springfall2008 avatar Mar 16 '25 18:03 springfall2008

The hold charge is a little odd however as the battery is already full, I'd be interested to see the debug YAML if you get that again

This one is from 09:25 the same day, but should have the same hold charge. (I have adjusted my export limit from 11 kW to 13 kW in this debug file, since 11 kW was a limit I had earlier, before the expansion of my PV system) predbat_debug_09_25_00.yaml.txt

freddanastrom avatar Mar 17 '25 07:03 freddanastrom

Things have been working pretty well recently, but today the plan is showing some unwanted charging slots again.

predbat_debug_07_00_00.yaml.txt

Image

freddanastrom avatar Mar 24 '25 06:03 freddanastrom