From e7a81539909ecb49b126cb2f58913dee1525cf9b Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Tue, 25 Aug 2026 11:28:39 +0000 Subject: [PATCH] Show an explicit error when no forecast is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Weather Compensation hint text only ever showed the forecast peak when the fetch succeeded — a failure (bad location, wrong Met Office subscription, etc.) just silently showed nothing, which is exactly what happened debugging this live. Now shows a clear red hint pointing at the two things most likely wrong (Integrations config, backend logs) once the initial status fetch has resolved and come back empty. Co-Authored-By: Claude Sonnet 5 --- frontend/src/pages/Settings.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx index 2fb2013..53eb3ec 100644 --- a/frontend/src/pages/Settings.tsx +++ b/frontend/src/pages/Settings.tsx @@ -35,6 +35,7 @@ export default function Settings() { const [weatherPeakC, setWeatherPeakC] = useState(null) const [weatherTier, setWeatherTier] = useState(null) + const [weatherLoaded, setWeatherLoaded] = useState(false) const [publicAreaName, setPublicAreaName] = useState('') const [creatingZone, setCreatingZone] = useState(false) @@ -61,7 +62,10 @@ export default function Settings() { setDefaults({ ...DEFAULT_HVAC_TEMPLATE, ...cfg.hvac_defaults, ac_occupied_tiers: cfg.hvac_defaults?.ac_occupied_tiers ?? DEFAULT_HVAC_TEMPLATE.ac_occupied_tiers }) }).catch(() => {}) fetchMqttStatus().then(s => { setMqttConnected(s.connected); setMqttNote(s.note) }).catch(() => {}) - fetchStatus().then(s => { setWeatherPeakC(s.weather_peak_c); setWeatherTier(s.weather_tier) }).catch(() => {}) + fetchStatus() + .then(s => { setWeatherPeakC(s.weather_peak_c); setWeatherTier(s.weather_tier) }) + .catch(() => {}) + .finally(() => setWeatherLoaded(true)) }, []) function toggleExcluded(siteId: string) { @@ -348,6 +352,13 @@ export default function Settings() { <> Today's forecast peak: {weatherPeakC}°C{weatherTier ? <> — currently in the {weatherTier} tier : ' — below every tier'}. )}

+ {weatherLoaded && weatherPeakC == null && ( +

+ No forecast available right now — check Hotel Location and Met Office DataHub under Settings → + Integrations are saved correctly (both need a Test to pass), or check hvac-backend's logs for + a "[weather]" line explaining why. +

+ )}
TierIf peak above (°C)On/OffModeSetpoint (°C)Fan speed