Skip to main content

Weather Settings

Location and units for the Weather page.


GET /api/setting/weather

Response

{
"WeatherCity": "Beijing, Beijing, China",
"WeatherLat": "39.9075",
"WeatherLon": "116.3972",
"WeatherTempUnit": "celsius",
"WeatherSpeedUnit": "kmh",
"WeatherAltMode": "pressure"
}
FieldTypeMeaning
WeatherCitystringHuman-readable city label (used on screen).
WeatherLatstringLatitude, decimal degrees.
WeatherLonstringLongitude, decimal degrees.
WeatherTempUnitstring"celsius" or "fahrenheit".
WeatherSpeedUnitstring"kmh", "mph" or "ms".
WeatherAltModestring"pressure", "humidity", etc.

POST /api/setting/weather

Partial update. Triggers a one-shot refresh.

Request

{
"WeatherCity": "Berlin, Berlin, Germany",
"WeatherLat": "52.5200",
"WeatherLon": "13.4050"
}

Response

200 OK with body OK.


POST /api/weather/refresh

Forces an immediate weather + AQI pull.

Request

No body.

Response

200 OK — refresh triggered
429 — rate limited; you sent a refresh in the last 60 s

429 body looks like:

Rate limited, please wait 42s before refreshing again.

Example

curl -X POST http://192.168.1.42/api/weather/refresh
tip

This endpoint is meant for manual "I just changed the city, refresh now". For periodic polling, just let the device do its own background refresh — calling this from a cron job will get you 429s.