From 665653517c31634685640fd1f00cb5df04a57eb7 Mon Sep 17 00:00:00 2001 From: glenn schrooyen Date: Thu, 29 Oct 2026 21:06:09 +0100 Subject: [PATCH] UX-54 scenarios keep the gate they were written for (cycle cost 0.15 with a forecast) With master merged in (TARIFF-24), a forecast replaces the 1.5x widening, so the shipped cost 0.10 is now the whole gap with a forecast. test_ux54.py's modes-on scenarios were written for 0.15 and 21 of its checks failed on release/1.0 + master (they pass on release/1.0 alone). They now set the cost to 0.15 where they have a forecast: the same gate as before. Scenarios with no forecast (nofc, stale) and modes off keep 0.10, widened as before. Co-Authored-By: Claude --- goodwe_controller/tools/ux54_scenarios.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/goodwe_controller/tools/ux54_scenarios.py b/goodwe_controller/tools/ux54_scenarios.py index d30e7e6..bed5a27 100644 --- a/goodwe_controller/tools/ux54_scenarios.py +++ b/goodwe_controller/tools/ux54_scenarios.py @@ -247,6 +247,12 @@ def make(name, now, *, soc=(55.0, 40.0), modes=("solar_first", tomorrow = False if name == "sunny": sun_today, sun_tomorrow = 40.0, 40.0 + if name not in ("nofc", "off", "stale") and \ + opts.get("battery_modes_enabled"): + # TARIFF-24: with a forecast the gap needed is the cycle cost, not + # 1.5 x it. These scenarios were written for the old gate (0.15 at + # the shipped 0.10), so they keep it: the cost is 0.15. + opts["cycle_cost_threshold_eur"] = 0.15 c = Controller(opts, Hass(), Store(), Pub(), stop=asyncio.Event()) c.auto = True for i, inv in enumerate(c.inverters):