Skip to content

FreezeCharge interrupted by charge_stop_service when car charging slots expire #3321

@houb0-dev

Description

@houb0-dev

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_connected

car_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

  1. Plan recomputation detects car charging
  2. Creates 15-min car charging slots, replacing the 6-hour charge window
  3. When slot expires → charge_stop_service called
  4. charge_stop_service sets discharge_current = 150A (configured, correct for normal use)
  5. 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_now is 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.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions