Skip to content

Weather

Settings

Key Value
CONFIG weather
ENV N/A
URL N/A
VALUE []WeatherLocation
DEFAULT []
Using with config.yaml file
weather:
locations:
- name: london
lat: 51.5285262
lon: -0.2663999
api: API_KEY
unit: metric
round_temperature: false
lang: en
forecast: false
show:
temperature_range: false
humidity: false
wind: false
wind_direction: false
visibility: false
default: false

You can configure multiple locations in the config.yaml file, and choose which one to display using the URL query weather=NAME.

Value Description
name The location’s display name (used in the URL query).
lat Latitude of the location.
lon Longitude of the location.
api OpenWeatherMap API key.
unit Units of measurement (standard, metric, or imperial).
round_temperature Round temperature to the nearest whole number.
lang Language code for weather descriptions (see the full list here).
forecast Display the forecast for the next three days
show.temperature_range Display temperature range for the next 24 hours.
show.humidity Display humidity for location.
show.wind Display wind for location.
show.wind_direction Also display wind direction as degrees for location.
show.visibility Display visibility for location.
default Set this location as the default (when no location is specified)

A select few weather options can be overridden via URL query parameters:

  • weather_show_forecast
  • weather_show_temperature_range
  • weather_show_humidity
  • weather_show_wind
  • weather_show_wind_direction
  • weather_show_visibility
  • weather_round_temperature

https://{KIOSK_URL}?weather_show_forecast=true&weather_show_humidity=true

You can rotate between configured weather locations by setting weather to rotate in the URL e.g. https://{KIOSK_URL}?weather=rotate.

Use rotation_interval to control how often locations rotate.

Here’s an example of how to add London, London using OpenWeatherMap’s name and New York to the config.yaml file. These locations would be selectable via the URL, like this: http://{URL}?weather=london or http://{URL}?weather=new-york.

weather:
rotation_interval: 60 # in seconds (10 is the minimum).
locations:
- name: london
lat: 51.5285262
lon: -0.2663999
api: API_KEY
unit: metric
lang: en
default: true
- name: london-api
lat: 51.5285262
lon: -0.2663999
api: API_KEY
unit: metric
lang: en
- name: new-york
lat: 40.6973709
lon: -74.1444838
api: API_KEY
unit: imperial
round_temperature: true
lang: en

You can use any weather data provider by setting custom_weather_url on a weather location. The provider’s response must be JSON, and it must match the structure described below.

You don’t need to include every field, anything not listed is simply ignored, and anything listed but missing just means that part of the display won’t show anything useful.

weather:
locations:
- name: custom
custom_weather_url: https://{CUSTOM_WEATHER_PROVIDER_URL}
forecast: false
show:
temperature_range: false
humidity: false
wind: false
visibility: false
default: false

Fetched into the Weather struct. This is what’s used for the current-conditions display.

JSON key Type Notes
base string Not currently used in the UI
name string Location name
weather array See Data below
sys object See Sys below
main object See Main below
wind object See Wind below
coord object See Coord below — not currently rendered
visibility integer Meters — shown if weather_show_visibility is enabled
clouds object See Clouds below — not currently rendered
dt integer (unix timestamp) Not currently rendered
timezone integer Seconds offset from UTC — used to align forecast day boundaries
id integer Not currently used
cod integer Not currently used
JSON key Type Notes
id integer Used to pick the weather icon; falls back to 800 (clear) if missing
main string Not currently rendered
description string Not currently rendered
icon string Not currently used — icon is derived from id, not this field
JSON key Type Notes
temp number Required — the headline temperature
feels_like number Not currently rendered
temp_min number Used with if weather_show_temperature_range is enabled
temp_max number Used with if weather_show_temperature_range is enabled
pressure integer Not currently rendered
humidity integer Shown if weather_show_humidity is enabled
sea_level integer Not currently used
grnd_level integer Not currently used
JSON key Type Notes
speed number Shown if weather_show_wind is enabled
deg integer 0–360; used to compute compass direction if weather_show_wind_direction is enabled. Values outside 0–360 render as “Var”
gust number Not currently used
JSON key Type Notes
all integer Not currently rendered
JSON key Type Notes
country string Not currently used
type integer Not currently used
id integer Not currently used
sunrise integer (unix timestamp) Not currently used
sunset integer (unix timestamp) Not currently used
JSON key Type Notes
lon number Not currently used
lat number Not currently used

Forecast (only needed if the user enables the forecast feature)

Section titled “Forecast (only needed if the user enables the forecast feature)”

Fetched into the Forecast struct — same custom URL is called again, but decoded differently:

Field JSON key Type Notes
List list array of Weather objects (see above) Each entry should represent one forecast interval and use the exact same field shape as the current-weather object

Requirements for list items to produce a useful forecast:

  • dtrequired, unix timestamp for the interval. Used to bucket items into calendar days (in the location’s timezone) and to compute the rolling next-24h high/low.
  • main.temp_max / main.temp_minrequired for daily highs and the next-24h range.
  • weather[0].id — used to pick the icon shown for each summarized day (most frequent icon per day wins). Falls back to 800 if absent.

Everything else in a list item follows the same field table as the top-level current-weather object above, but is unused by the forecast summary logic.

Only the first 3 upcoming days (excluding today) are shown, and only the next 24 hours of items are used for the high/low range.

{
"name": "Bournville",
"weather": [{ "id": 800, "description": "clear sky" }],
"main": {
"temp": 21.4,
"temp_min": 18.2,
"temp_max": 23.1,
"humidity": 55
},
"wind": { "speed": 3.1, "deg": 280 },
"visibility": 10000,
"dt": 1783502100,
"cod": 200
}

Same shape, plus a list array of forecast intervals (each item mirrors the current-weather shape above):

{
"name": "Bournville",
"weather": [{ "id": 800, "description": "clear sky" }],
"main": {
"temp": 21.4,
"temp_min": 18.2,
"temp_max": 23.1,
"humidity": 55
},
"wind": { "speed": 3.1, "deg": 280 },
"visibility": 10000,
"dt": 1783502100,
"cod": 200,
"list": [
{
"dt": 1783512000,
"main": { "temp": 26.3, "temp_min": 25.0, "temp_max": 26.3 },
"weather": [{ "id": 800 }]
},
{
"dt": 1783598400,
"main": { "temp": 28.5, "temp_min": 24.0, "temp_max": 28.5 },
"weather": [{ "id": 800 }]
}
]
}
ID icon
default sun
801 802 803 804 cloud
500 501 502 503 504 511 520 521 522 531 300 301 302 310 311 312 313 314 321 rain
600 601 602 611 612 613 615 616 620 621 622 snow
200 201 202 210 211 212 221 230 231 232 thunder storm
701 711 721 731 741 751 761 fog
762 volcano
771 wind
781 tornado