Without this, a failed Execute() left engine state diverged from hardware.
SyncHardwareState would then misread the mismatch as a manual override and
apply a 1-hour lockout — causing either a stuck-on or stuck-off loop.
Now Execute() returns per-action []error. The control loop calls
Engine.RollbackAction() for each failed action, keeping engine state in
sync with hardware so the next cycle simply retries.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
With a 4.6kW inverter and 4kW WallboxB + ~450W house load, any PV dip
causes brief grid import and would trigger shutdown/restart cycling.
New config: wallbox_a_accepted_import_w / wallbox_b_accepted_import_w
WallboxB set to 600W: engine skips shutdown if import <= 600W, keeping
the car charging through short cloud shadows. WallboxA disabled (2kW
leaves sufficient inverter headroom without needing tolerance).
Logic: shutdownLastConsumer checks per-consumer tolerance before
applying min-runtime and initiating turn-off.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds heating_min_ambient_c (default 15°C) to season config. When outdoor
temperature is at or above this threshold, SG-Ready is suppressed even if
the calendar month is within the heating season. Prevents unnecessary heat
pump boost activation on warm spring/autumn days.
Logic: heating active = in_heating_month AND ambient < threshold
Zero value (unset) disables the temperature gate (calendar-only, old behaviour).
New test: TestHeatingPeriodAmbientSuppression covers warm-day suppression,
cold-day pass-through, and summer month independence.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Override duration (web UI):
- Dropdown on Ein button: 30min / 1h / 2h / 4h
- Engine notified immediately via ApplyOverride() — no waiting for
next SyncHardwareState cycle
- Aus button always uses 1h lockout (keeps consumer off for 1h)
Hard-stop thresholds that cancel active overrides:
- SOC emergency brake: now also clears ManualOverride flag so EMS
resumes full control after the safety shutdown
- override_max_import_w (default 800W): if grid import exceeds this
while an override is active, override is cancelled immediately
(no hysteresis delay — protection is instant)
Config: ems.override_max_import_w (0 = disabled)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>