diff --git a/docs/API.md b/docs/API.md index 52a48ec..49a5e67 100644 --- a/docs/API.md +++ b/docs/API.md @@ -637,4 +637,8 @@ Request: { "id": "relay_1", "state": true - } + }\n\n### Weather temperature sensor flag + +Temperature sensor config entries now include `weather: true`. + +When a configured temp sensor has `weather: true`, the WebUI may show it as the outside/weather temperature badge. The `/status` temp objects also include this flag so HTTP, UART, USB serial, and future Pico clients can identify the selected outside-air sensor without guessing from the sensor name.\n \ No newline at end of file diff --git a/docs/PARITY_MATRIX.md b/docs/PARITY_MATRIX.md index 5e87066..1129314 100644 --- a/docs/PARITY_MATRIX.md +++ b/docs/PARITY_MATRIX.md @@ -105,5 +105,4 @@ Future additions must be implemented on: UART JSON HTTP API -before parity is considered maintained. - +before parity is considered maintained.\n\n- Temperature sensor config/status parity now includes the `weather` boolean flag for outside-air display selection.\n \ No newline at end of file diff --git a/docs/UART_PROTOCOL.md b/docs/UART_PROTOCOL.md index 6198a8c..9908f39 100644 --- a/docs/UART_PROTOCOL.md +++ b/docs/UART_PROTOCOL.md @@ -265,4 +265,8 @@ Pico sends: Alternative: - {"type":"clear_temp","slot":1} + {"type":"clear_temp","slot":1}\n\n### Temperature weather flag + +`status_response.config.temperature_sensors[]` and `status_response.temps[]` include `weather: false`. + +`config_temp` may include `weather: true` to mark one configured sensor as the outside/weather sensor. Pico clients should treat this as optional and default missing values to `false`.\n \ No newline at end of file diff --git a/docs/project-state.md b/docs/project-state.md index 2d7794c..2625713 100644 --- a/docs/project-state.md +++ b/docs/project-state.md @@ -163,4 +163,4 @@ Examples: 5. Add config backup/restore. 6. Improve BMS out-of-range behavior without changing NimBLE connect timeout. -- Fixed WebUI temperature probe scan by registering `/temps/scan`, `/temps/assign`, and `/temps/clear` firmware routes. +- Fixed WebUI temperature probe scan by registering `/temps/scan`, `/temps/assign`, and `/temps/clear` firmware routes.\n\n- Added per-temperature-sensor `weather` flag and WebUI outside temperature badge with emoji thresholds: below 50°F ice, 50-74°F happy, 75-84°F sun, and 85°F+ fire.\n \ No newline at end of file diff --git a/firmware/esp32/overland-controller/app_config.cpp b/firmware/esp32/overland-controller/app_config.cpp index 48df0a8..1391aae 100644 --- a/firmware/esp32/overland-controller/app_config.cpp +++ b/firmware/esp32/overland-controller/app_config.cpp @@ -31,7 +31,8 @@ void loadDefaultConfig() { "temp_" + String(i + 1), "Temperature " + String(i + 1), "", - i < appConfig.tempSensorCount + i < appConfig.tempSensorCount, + false }; } @@ -90,6 +91,10 @@ void loadConfig() { (prefix + "enabled").c_str(), appConfig.tempSensors[i].enabled ); + appConfig.tempSensors[i].weather = preferences.getBool( + (prefix + "weather").c_str(), + appConfig.tempSensors[i].weather + ); } appConfig.bms.enabled = preferences.getBool("bms_enabled", appConfig.bms.enabled); @@ -124,6 +129,7 @@ void saveConfig() { preferences.putString((prefix + "name").c_str(), appConfig.tempSensors[i].name); preferences.putString((prefix + "addr").c_str(), appConfig.tempSensors[i].address); preferences.putBool((prefix + "enabled").c_str(), appConfig.tempSensors[i].enabled); + preferences.putBool((prefix + "weather").c_str(), appConfig.tempSensors[i].weather); } preferences.putBool("bms_enabled", appConfig.bms.enabled); diff --git a/firmware/esp32/overland-controller/app_config.h b/firmware/esp32/overland-controller/app_config.h index 3730708..561886c 100644 --- a/firmware/esp32/overland-controller/app_config.h +++ b/firmware/esp32/overland-controller/app_config.h @@ -17,6 +17,7 @@ struct TempSensorConfig { String name; String address; bool enabled; + bool weather; }; struct BmsConfig { diff --git a/firmware/esp32/overland-controller/overland-controller.ino b/firmware/esp32/overland-controller/overland-controller.ino index e2860af..65d9f43 100644 --- a/firmware/esp32/overland-controller/overland-controller.ino +++ b/firmware/esp32/overland-controller/overland-controller.ino @@ -28,6 +28,8 @@ const char INDEX_HTML[] PROGMEM = R"rawliteral( body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,sans-serif} .wrap{max-width:980px;margin:0 auto;padding:14px 14px 90px} .top{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px} +.topRight{display:grid;gap:6px;justify-items:end} +.weatherBadge{font-size:20px;font-weight:900;color:var(--text);padding:8px 12px} h1{font-size:21px;margin:0}.sub{color:var(--muted);font-size:13px;margin-top:4px} .pill{border:1px solid var(--line);border-radius:999px;padding:7px 10px;color:var(--muted);font-size:12px;white-space:nowrap} .tabs{position:fixed;left:0;right:0;bottom:0;background:#080c11;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(3,1fr);z-index:10} @@ -67,7 +69,10 @@ input{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;ba