What you’ll see
- Weather alerts while one is on: what it is, when it starts and ends, and who issued it. It sends a notification. With two or more, a list of all of them follows.
- Now: the temperature, what it feels like and the sky.
- Today: the high and low, and OpenWeather’s summary of the day ("Storms through the afternoon, clearing by evening").
- Next hour, only while rain or snow is coming: a column for every five minutes, each at its heaviest, titled "Rain starting in 12m", "Rain stopping in 25m" or "Rain all hour". OpenWeather has minute-by-minute rain for most places, not all; where it has none, this card never shows.
- Next 24 hours: the temperature every other hour.
- Conditions: air quality in OpenWeather’s words (Good, Fair, Moderate, Poor, Very poor), the UV index now and its highest today and when, wind with its direction and gusts, humidity and dew point, the moon, pressure and visibility.
- Daylight left, or the time until sunrise.
- This week: each day’s low and high on one scale, with its sky, wind and any chance of rain.
- Notable this week, only while something is: the first day ahead with gusts of 46 mph or more (a common National Weather Service advisory level), the worst air from tomorrow if OpenWeather rates it Moderate or worse, a low at or below freezing, or an inch of rain or of snow. These never count as a problem the page. Each number sits in the page’s rules, where you can change it.
The page takes its title from the place’s name in OpenWeather’s geocoding.
More than one place
The page shows one place at a time. Opened from the sidebar, it shows its default place, and that’s the place whose alerts send notifications. A link with other coordinates shows another place on the same page, without sending notifications: legato://page/weather?lat=40.71&lon=-74.01. Put such links in a list on another page, one row for each place you check.
Status
- Watches weather alerts for your place.
- Orange while an alert is on, with a notification when it starts.
- A storm with no alert doesn’t count as a problem.
- Notifies you when it turns orange or red.
How it connects
The page reads OpenWeather with your API key, sent as appid in the address.
Requests it makes on its own 4
- GET
/data/3.0/onecall?lat={param.lat} &lon={param.lon} &units=imperial The weather now, every minute of the next hour, the next 48 hours, eight days, and alerts.
Every 20 minutes
- GET
/data/2.5/air_pollution?lat={param.lat} &lon={param.lon} Air quality now.
Every 20 minutes
- GET
/data/2.5/air_pollution/forecast?lat={param.lat} &lon={param.lon} Air quality for the next four days.
Every 20 minutes
- GET
/geo/1.0/reverse?lat={param.lat} &lon={param.lon} &limit=1 The place’s name, for the page’s title.
Once a day
That’s 72 One Call calls a day for each place you keep open, well inside the 1,000 a day One Call by Call gives free. Air quality and place names are on OpenWeather’s free plan and don’t count toward them.
Sources and buttons explains each part of a page.
Set it up
- Get a key with One Call 3.0. Sign up at openweathermap.org, then subscribe to One Call by Call under Pricing. It asks for a card, but the first 1,000 calls each day are free. Set the daily limit in your account to 1,000 and it never charges. Your key is under My API keys. A new key can take a couple of hours to start working.
- Save it in Legato. In Settings → Secrets, save the key under
openweather, bound toapi.openweathermap.org. You can also link a 1Password reference. - Add the page. Paste the prompt into your agent, or download the page and run
/Applications/Legato.app/Contents/Helpers/legato set weather weather.json. - Set your place. Under
params, change thedefaultoflatandlonto your place’s latitude and longitude, to two decimals or more. The download starts at OpenWeather’s example place.
The cards fill within a minute. A new key that hasn’t started working yet is the usual reason they don’t: the page then notes that OpenWeather refused it.
In °C
The page asks for °F and miles per hour. For °C and metres a second, change units=imperial to units=metric in the first request, °F to °C on the Now, Next 24 hours and This week cards, and mph to m/s in the Wind row. Pressure and visibility are worked out from OpenWeather’s own units; change their scale and words too if you’d rather see hPa and km.
Prompt for your agent
Add a Legato page for OpenWeather, starting from https://legatobar.com/examples/weather.json.
Add the page as it is, keeping its page ID, and change the default lat and lon under params to my place. I’ll save my OpenWeather key as openweather in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.Download the page
Show the page’s JSON 967 lines
{
"$schema": "./.schemas/page.schema.json",
"title": "Weather",
"icon": "cloud.sun",
"params": {
"lat": {
"pattern": "-?[0-9]{1,3}(\\.[0-9]{1,6})?",
"example": "33.44",
"default": "33.44"
},
"lon": {
"pattern": "-?[0-9]{1,3}(\\.[0-9]{1,6})?",
"example": "-94.04",
"default": "-94.04"
}
},
"title_from": {
"ref": "place",
"value": "places[0].name"
},
"sources": {
"weather": {
"url": "https://api.openweathermap.org",
"secret": "openweather",
"auth": {
"type": "query",
"name": "appid"
},
"every": "20m",
"requests": {
"one": "/data/3.0/onecall?lat={param.lat}&lon={param.lon}&units=imperial",
"air": "/data/2.5/air_pollution?lat={param.lat}&lon={param.lon}",
"air_ahead": "/data/2.5/air_pollution/forecast?lat={param.lat}&lon={param.lon}"
},
"derive": [
{
"name": "alert_count",
"value": {
"count": "one.alerts",
"default": 0
}
},
{
"name": "wet_minutes",
"value": {
"count": "one.minutely",
"where": {
"path": "precipitation",
"gt": 0
},
"default": 0
}
},
{
"name": "rain",
"value": {
"each": "one.minutely",
"value": "precipitation",
"buckets": 12,
"keep": "max"
}
},
{
"name": "rain_starts",
"value": {
"first": "dt",
"of": "one.minutely",
"where": {
"path": "precipitation",
"gt": 0
}
}
},
{
"name": "rain_stops",
"value": {
"first": "dt",
"of": "one.minutely",
"where": {
"path": "precipitation",
"equals": 0
}
}
},
{
"name": "pressure_inhg",
"value": {
"path": "one.current.pressure",
"scale": 0.02953,
"round": 2
}
},
{
"name": "visibility_mi",
"value": {
"path": "one.current.visibility",
"scale": 0.000621371,
"round": 0
}
},
{
"name": "n_gusts",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "wind_gust",
"gte": 46
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"text": {
"template": "Gusts to {wind_gust|round} mph {dt|weekday}"
},
"icon": {
"template": "wind"
}
}
}
},
{
"name": "n_air_0",
"value": {
"each": "air_ahead.list",
"where": {
"all": [
{
"path": "dt",
"gte": {
"answer": "one.daily[1].sunrise"
}
},
{
"path": "main.aqi",
"gte": 3
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"word": {
"path": "main.aqi",
"values": {
"1": "Good",
"2": "Fair",
"3": "Moderate",
"4": "Poor",
"5": "Very poor"
}
}
},
"sort": {
"by": "main.aqi",
"order": "desc"
}
}
},
{
"name": "n_air",
"value": {
"each": "n_air_0",
"fields": {
"dt": "dt",
"text": {
"template": "{word} air {dt|weekday}"
},
"icon": {
"template": "lungs"
}
}
}
},
{
"name": "n_freeze",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "temp.min",
"lte": 32
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"text": {
"template": "Freezing {dt|weekday} night, {temp.min|round}°"
},
"icon": {
"template": "snowflake"
}
}
}
},
{
"name": "n_rain_0",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "rain",
"gte": 25.4
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"inches": {
"path": "rain",
"scale": 0.03937,
"round": 1
}
}
}
},
{
"name": "n_rain",
"value": {
"each": "n_rain_0",
"fields": {
"dt": "dt",
"text": {
"template": "{inches} in of rain {dt|weekday}"
},
"icon": {
"template": "cloud.rain"
}
}
}
},
{
"name": "n_snow",
"value": {
"each": "one.daily",
"where": {
"all": [
{
"path": "dt",
"gt": {
"answer": "one.daily[0].dt"
}
},
{
"path": "snow",
"gte": 25.4
}
]
},
"limit": 1,
"fields": {
"dt": "dt",
"text": {
"template": "Snow {dt|weekday}"
},
"icon": {
"template": "snowflake"
}
}
}
},
{
"name": "n_some",
"value": {
"each": [
"n_gusts",
"n_air",
"n_freeze",
"n_rain"
],
"fields": {
"dt": "dt",
"text": "text",
"icon": "icon"
}
}
},
{
"name": "notables",
"value": {
"each": [
"n_some",
"n_snow"
],
"sort": {
"by": "dt"
},
"fields": {
"text": "text",
"icon": "icon"
}
}
},
{
"name": "notable_count",
"value": {
"count": "notables",
"default": 0
}
},
{
"name": "uv_peak",
"value": {
"each": "one.hourly",
"limit": 1,
"where": {
"path": "dt",
"lte": {
"answer": "one.daily[0].sunset"
}
},
"sort": {
"by": "uvi",
"order": "desc"
},
"fields": {
"dt": "dt",
"uvi": {
"path": "uvi",
"round": 0
}
}
}
}
]
},
"place": {
"url": "https://api.openweathermap.org",
"secret": "openweather",
"auth": {
"type": "query",
"name": "appid"
},
"every": "1d",
"requests": {
"places": "/geo/1.0/reverse?lat={param.lat}&lon={param.lon}&limit=1"
}
}
},
"cards": [
{
"id": "alerts",
"type": "status",
"label": "Weather alerts",
"state": "unknown",
"width": "full",
"source": {
"ref": "weather",
"when": {
"path": "alert_count",
"gt": 0
},
"map": {
"label": {
"template": "{one.alerts[0].event}"
},
"state": {
"path": "alert_count",
"values": {
"0": "ok"
},
"default": "warning"
},
"detail": {
"if": {
"path": "one.alerts[0].start",
"gt": {
"path": "one.current.dt"
}
},
"then": {
"template": "{one.alerts[0].start|day} {one.alerts[0].start|clock} – {one.alerts[0].end|clock} · {one.alerts[0].sender_name}"
},
"else": {
"template": "Until {one.alerts[0].end|clock} · {one.alerts[0].sender_name}"
}
}
}
}
},
{
"id": "alert-list",
"type": "list",
"label": "All alerts",
"items": [
"—"
],
"source": {
"ref": "weather",
"when": {
"path": "alert_count",
"gt": 1
},
"map": {
"items": {
"each": "one.alerts",
"sort": {
"by": "start"
},
"limit": 4,
"fields": {
"text": "event",
"detail": {
"template": "{start|weekday} {start|clock} – {end|clock}"
}
}
}
}
}
},
{
"id": "now",
"type": "stat",
"label": "Now",
"value": 0,
"unit": "°F",
"source": {
"ref": "weather",
"map": {
"value": {
"path": "one.current.temp",
"round": 0
},
"delta": {
"template": "Feels like {one.current.feels_like|round}° · {one.current.weather[0].description|title}"
}
}
}
},
{
"id": "today",
"type": "stat",
"label": "Today",
"value": "—",
"source": {
"ref": "weather",
"map": {
"value": {
"template": "{one.daily[0].temp.max|round}° / {one.daily[0].temp.min|round}°"
},
"delta": {
"if": {
"path": "one.daily[0].summary",
"exists": true
},
"then": {
"template": "{one.daily[0].summary}"
},
"else": {
"template": "{one.daily[0].pop|percent:0} chance of rain"
}
}
}
}
},
{
"id": "rain",
"type": "columns",
"label": "Next hour",
"unit": "mm/h",
"series": [
"Rain"
],
"baseline": "zero",
"items": [
{
"label": "Now",
"values": [
0
]
},
{
"label": "5m",
"values": [
0
]
},
{
"label": "10m",
"values": [
0
]
},
{
"label": "15m",
"values": [
0
]
},
{
"label": "20m",
"values": [
0
]
},
{
"label": "25m",
"values": [
0
]
},
{
"label": "30m",
"values": [
0
]
},
{
"label": "35m",
"values": [
0
]
},
{
"label": "40m",
"values": [
0
]
},
{
"label": "45m",
"values": [
0
]
},
{
"label": "50m",
"values": [
0
]
},
{
"label": "55m",
"values": [
0
]
}
],
"source": {
"ref": "weather",
"when": {
"path": "wet_minutes",
"gt": 0
},
"map": {
"label": {
"if": {
"path": "one.minutely[0].precipitation",
"gt": 0
},
"then": {
"if": {
"path": "rain_stops",
"exists": true
},
"then": {
"template": "Rain stopping {rain_stops|in}"
},
"else": {
"template": "Rain all hour"
}
},
"else": {
"template": "Rain starting {rain_starts|in}"
}
},
"items[0].values[0]": {
"path": "rain[0]",
"round": 1
},
"items[1].values[0]": {
"path": "rain[1]",
"round": 1
},
"items[2].values[0]": {
"path": "rain[2]",
"round": 1
},
"items[3].values[0]": {
"path": "rain[3]",
"round": 1
},
"items[4].values[0]": {
"path": "rain[4]",
"round": 1
},
"items[5].values[0]": {
"path": "rain[5]",
"round": 1
},
"items[6].values[0]": {
"path": "rain[6]",
"round": 1
},
"items[7].values[0]": {
"path": "rain[7]",
"round": 1
},
"items[8].values[0]": {
"path": "rain[8]",
"round": 1
},
"items[9].values[0]": {
"path": "rain[9]",
"round": 1
},
"items[10].values[0]": {
"path": "rain[10]",
"round": 1
},
"items[11].values[0]": {
"path": "rain[11]",
"round": 1
}
}
}
},
{
"id": "hours",
"type": "columns",
"label": "Next 24 hours",
"unit": "°F",
"series": [
"Temperature"
],
"baseline": "auto",
"values_on_top": true,
"items": [],
"source": {
"ref": "weather",
"map": {
"highlight": {
"template": "{one.hourly[0].dt|hour}"
},
"items": {
"each": "one.hourly",
"limit": 24,
"buckets": 12,
"keep": {
"min": "dt"
},
"fields": {
"label": {
"template": "{dt|hour}"
},
"values[0]": {
"path": "temp",
"round": 0
}
}
}
}
}
},
{
"id": "conditions",
"type": "facts",
"label": "Conditions",
"items": [
{
"key": "Air quality",
"value": "—"
},
{
"key": "UV index",
"value": "—"
},
{
"key": "Wind",
"value": "—"
},
{
"key": "Humidity",
"value": "—"
},
{
"key": "Moon",
"value": "—"
},
{
"key": "Pressure",
"value": "—"
},
{
"key": "Visibility",
"value": "—"
}
],
"source": {
"ref": "weather",
"map": {
"items[0].value": {
"path": "air.list[0].main.aqi",
"values": {
"1": "Good",
"2": "Fair",
"3": "Moderate",
"4": "Poor",
"5": "Very poor"
},
"default": "—"
},
"items[1].value": {
"if": {
"path": "uv_peak[0].dt",
"exists": true
},
"then": {
"template": "{one.current.uvi|round} now · {uv_peak[0].uvi} at {uv_peak[0].dt|clock_hour}"
},
"else": {
"template": "{one.current.uvi|round} now"
}
},
"items[2].value": {
"if": {
"path": "one.current.wind_gust",
"exists": true
},
"then": {
"template": "{one.current.wind_speed|round} mph {one.current.wind_deg|compass} · gusts {one.current.wind_gust|round}"
},
"else": {
"template": "{one.current.wind_speed|round} mph {one.current.wind_deg|compass}"
}
},
"items[3].value": {
"template": "{one.current.humidity}% · dew point {one.current.dew_point|round}°"
},
"items[4].value": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.03
},
"then": {
"template": "New moon"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.22
},
"then": {
"template": "Waxing crescent"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.28
},
"then": {
"template": "First quarter"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.47
},
"then": {
"template": "Waxing gibbous"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.53
},
"then": {
"template": "Full moon"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.72
},
"then": {
"template": "Waning gibbous"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.78
},
"then": {
"template": "Last quarter"
},
"else": {
"if": {
"path": "one.daily[0].moon_phase",
"lt": 0.97
},
"then": {
"template": "Waning crescent"
},
"else": {
"template": "New moon"
}
}
}
}
}
}
}
}
},
"items[5].value": {
"template": "{pressure_inhg} inHg"
},
"items[6].value": {
"template": "{visibility_mi} mi"
}
}
}
},
{
"id": "daylight",
"type": "window",
"label": "Daylight left",
"start": "2026-01-01T12:00:00Z",
"end": "2026-01-01T23:00:00Z",
"start_label": "Sunrise",
"end_label": "Sunset",
"before_label": "Until sunrise",
"after_label": "Until sunrise",
"source": {
"ref": "weather",
"map": {
"start": "one.daily[0].sunrise",
"end": "one.daily[0].sunset",
"next_start": "one.daily[1].sunrise"
}
}
},
{
"id": "week",
"type": "ranges",
"label": "This week",
"unit": "°F",
"colors": "temperature",
"info_colors": [
"green",
"blue"
],
"muted": false,
"items": [
{
"label": "Today",
"low": 0,
"high": 1
}
],
"source": {
"ref": "weather",
"map": {
"items": {
"each": "one.daily",
"limit": 8,
"fields": {
"label": {
"template": "{dt|weekday}"
},
"low": {
"path": "temp.min",
"round": 0
},
"high": {
"path": "temp.max",
"round": 0
},
"icon": {
"path": "weather[0].icon",
"values": {
"01d": "sun.max",
"01n": "moon.stars",
"02d": "cloud.sun",
"02n": "cloud.moon",
"03d": "cloud",
"03n": "cloud",
"04d": "cloud",
"04n": "cloud",
"09d": "cloud.drizzle",
"09n": "cloud.drizzle",
"10d": "cloud.rain",
"10n": "cloud.rain",
"11d": "cloud.bolt.rain",
"11n": "cloud.bolt.rain",
"13d": "snowflake",
"13n": "snowflake",
"50d": "cloud.fog",
"50n": "cloud.fog"
},
"default": "cloud"
},
"info[0]": {
"template": "{wind_speed|round} {wind_deg|compass}"
},
"info[1]": {
"if": {
"path": "pop",
"gte": 0.1
},
"then": {
"template": "{pop|percent:0}"
},
"else": {
"template": ""
}
}
}
},
"items[0].now": {
"path": "one.current.temp",
"round": 0
}
}
}
},
{
"id": "notable",
"type": "list",
"layout": "chips",
"max_items": 3,
"items": [],
"source": {
"ref": "weather",
"when": {
"path": "notable_count",
"gt": 0
},
"map": {
"items": {
"each": "notables",
"fields": {
"text": "text",
"icon": "icon"
}
}
}
}
}
]
}Questions
Why didn’t a storm count as a problem?
Only an official alert does. Rain in the forecast shows on the page and never changes its colour.
Is there a version without a key?
Yes: the Open-Meteo page has the same cards with no account, for non-commercial use, and US alerts from the National Weather Service.
Why isn’t there an alert where I am?
OpenWeather passes on alerts from national weather services, and not every country sends them. When yours doesn’t, the page never shows the alert card.
Can I see the AI summary OpenWeather offers?
Not on this page. It’s a paragraph long, and the day’s one-line summary already sits under Today.