- **Fix: period windows locked after initial daily setup.** Intra-day forecast refreshes (every 30 minutes) recalculated `today_period_windows` from whatever periods the forecast returned. Once the Morning period completes, Solcast stops returning it — so the list shrinks to 2 periods (Aftn, Eve) and `derive_period_windows` divided the solar day into halves instead of thirds, shifting the Eve boundary ~3 hours early. This caused the evening controlled export to fire in the middle of the afternoon, discharging the battery to ~40% on a day with no Green forecast. Period windows are now calculated once at midnight/startup (`reset_day_state=True`) and held fixed for the rest of the day. Forecast values (watts, status) continue to refresh every 30 minutes as before.
0 commit comments