batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Odd log entry indicating incorrect calculation of cheap import

Open jambees opened this issue 4 weeks ago • 5 comments

Describe the bug I was looking through the predbat logs to see why my home battery seemed to charge between about 07:16 and 07:30 this morning and found the following log entries

2025-10-31 07:15:16.530802: - You have enough battery to reach the next charge.
2025-10-31 07:15:16.530826: - Your next charge slot will be in 1 and three quarters hours where import rates will be cheap (29.1p).
2025-10-31 07:15:16.530850: - Your next export slot will be in 17 hours where export rates will be fixed (15.0p).

The 2nd one indicating that it thinks my next charge slot will be at 9am when import rates will be "cheap". Except import rates at 29.1p are not cheap and is the peak rate.

Then I found the start of the unexpected charge I was looking for:

2025-10-31 07:17:16.614152: - Import rates are cheap (29.1p) for the next 16 hours and then very cheap (7.0p) for the next 6 hours.
2025-10-31 07:17:16.614191: - The battery is currently at 93% and is charging to 100% for the next 8 hours.
2025-10-31 07:17:16.614224: - For the next 30 minutes there will be no solar generation and then it will increase.
2025-10-31 07:17:16.614254: - You have enough battery to reach the next charge.

Again unexpected claim of import rates being cheap at 29.1p. It says enough battery to reach the next charge yet it's charging at peak rate here.

This does not appear to be the correct or expected behaviour. Expected behaviour is not to explicitly charge during peak rate.

Predbat version: v8.26.4

Environment details

  • Inverter and battery setup: Fox Inverter and battery using modbus connectivity for data
  • Standard HAOS
  • Car was plugged in but completed it's charge to 100% at 05:35 this morning

Log file Log file is attached.

predbat.log

Predbat debug yaml file Debug yaml file is attached.

predbat_debug.yaml.txt

jambees avatar Oct 31 '25 08:10 jambees

I also see this issue. Oddly, the log file shows that the 2025-11-01 13:11:45.371771: Rate array import [{'start': 790, 'end': 1410, 'rate': 'expensive', 'range': '(29.8p)'}, {'start': 1410, 'end': 1770, 'rate': 'very cheap', 'range': '(7.0p)'}, {'start': 1770, 'end': 2250, 'rate': 'expensive', 'range': '(29.8p)'}] export [{'start': 790, 'end': 2250, 'rate': 'fixed', 'range': '(15.0p)'}]   But every slot is being shows as a cheap slot, even the 29.8p slots. Battery is only scheduled to charge for 1hr tonight and brings the SOC to only 28%

Image

DrJohnM61 avatar Nov 01 '25 13:11 DrJohnM61

I'm hoping this is fixed in the latest release, please check

springfall2008 avatar Nov 01 '25 21:11 springfall2008

I'm hoping this is fixed in the latest release, please check

Still showing night rates the same as day rates

DrJohnM61 avatar Nov 01 '25 23:11 DrJohnM61

Predbat version 8.27.4 - The rates are now being correctly shown as high and low rates, however, the battery is being planned to discharg during the low rate window, being charged to only 92% until 2am and then the battery discharges again during the low rate. This is wrong (IMHO) as there is a round trip loss and also a battery degradation impact, so it is more economical to run the house from the grid at the low rate than from the battery. I have battery charge and discharge losses at 3%

Image

DrJohnM61 avatar Nov 03 '25 12:11 DrJohnM61

Can you share a debug yaml of the new case?

springfall2008 avatar Nov 08 '25 16:11 springfall2008