-
-
Notifications
You must be signed in to change notification settings - Fork 95
Description
When FreezeCharge is active during EV charging, PredBat calls charge_stop_service every 15-30 minutes when internal car charging slots expire. This resets discharge_current to max, causing the battery to discharge until the next slot creates a new FreezeCharge window.
Result: Battery SOC dropped from 82% to 64% overnight during what should have been continuous FreezeCharge.
Environment
- PredBat v8.32.14
- Inverter: SK (Deye SUN-10K via ESPHome)
- EV: 2.3 kW charging via smart plug
Configuration
car_charging_now:
- switch.vwpassat_charging
car_charging_planned:
- binary_sensor.vwpassat_charging_cable_connectedcar_charging_now is configured, so PredBat knows the car is actively charging.
Log Evidence
00:10:33 - Charge window: 00:00:00 - 06:15:00, target 4%
00:11:04 - Calling charge_freeze_service
00:11:04 - Status: Freeze charging ✓
00:20:02 - Will recompute the plan (10 min old)
00:20:50 - Charge window: 00:00:00 - 00:30:00 ← Window shortened!
00:30:01 - Current charge window has expired
00:30:22 - Calling charge_stop_service ← Resets discharge to 150A
00:30:53 - Status: Demand ← Battery now discharging!
00:41:11 - Status: Freeze charging ✓ ← Re-established
This cycle repeated every 15-30 minutes all night.
Root Cause
- Plan recomputation detects car charging
- Creates 15-min car charging slots, replacing the 6-hour charge window
- When slot expires →
charge_stop_servicecalled charge_stop_servicesets discharge_current = 150A (configured, correct for normal use)- Battery discharges until next PredBat run creates new FreezeCharge slot
Expected Behavior
charge_stop_service should NOT be called while car is actively charging and FreezeCharge should be maintained.
Suggested Fix
Before calling charge_stop_service, check if:
car_charging_nowis still true, OR- Current status is FreezeCharge due to car charging
If so, skip charge_stop_service or use a separate service that doesn't reset discharge_current.