@juliapupu/sensor-weather-everywhere
v0.1.0
Published
W2A sensor — daily weather forecast for any city worldwide, plus celestial moments (sunset glow, moon phase, meteor showers) and severe-weather alerts (heat/cold/storm/wind). Powered by Open-Meteo (no API key required).
Maintainers
Readme
@juliapupu/sensor-weather-everywhere
A World2Agent sensor that delivers daily weather for any city worldwide, plus the celestial moments and severe-weather alerts a resident would actually want to know about.
Built for someone who lives somewhere — Beijing, Reykjavík, São Paulo, Lagos, Sydney — and wants more than "high 18, low 9, rain." When the sky over Shibuya is going to glow magenta at 18:25, when the Geminids are peaking on a moonless Monday in Auckland, when Reykjavík hits a 60 km/h gust — this sensor calls it.
What it does
- Resolves any free-text location (
Beijing, China/Tokyo, Japan/New York, USA) to lat/lon + IANA timezone via Open-Meteo geocoding — no API key. - Fetches today's daily forecast from Open-Meteo — high/low, weather code, precipitation, wind, UV, sunrise/sunset.
- Computes sunrise / sunset / civil dusk / moon phase locally (no external API for astronomy).
- Heuristically scores tonight's sunset glow likelihood from cloud-cover at sunset hour.
- Heuristically scores tonight's star visibility from cloud cover and moon brightness.
- Looks up active major meteor showers (Perseids, Geminids, Quadrantids, Lyrids, Eta Aquarids, Orionids, Leonids, Ursids) against today's date.
- Emits one
weather.forecast.dailysignal per day with everything bundled into one human-readable summary plus structured fields. - Polls the day's forecast every hour; emits
weather.alert.severewhen a configurable threshold is crossed (heat wave / cold snap / heavy rain / high wind / thunderstorm / heavy snow).
Signals
weather.forecast.daily
| Field | What's in it |
|---|---|
| event.summary | One line — city + date + temps + conditions + wind + UV + sunrise/sunset + celestial blurb (🌅 / 🌙 / 🌌 / ☄️) when notable |
| source_event.data | location, latitude, longitude, timezone, date_iso, high_c, low_c, weather_code / weather_label (WMO), precipitation_mm, precipitation_probability_max, wind_speed_max_kmh, uv_index_max, sunrise_iso, sunset_iso, moon_phase, moon_illumination_pct, sunset_glow_likely, star_visibility, optional meteor_shower_name / meteor_shower_zhr |
| attachments[0] | Full forecast detail + sun/moon/celestial paragraph (inline text) |
Example summaries (real Open-Meteo data, 2026-04-28):
Beijing, China Tue, Apr 28: 21°C / 10°C, Overcast, 75% precipitation; wind 12.3 km/h, UV 6.7;
sunrise 05:20 / sunset 19:05; 🌙 Waxing Gibbous 90%; 🌌 excellent star visibilityReykjavik, Iceland (Capital Region) Tue, Apr 28: 9°C / 6°C, Slight rain, 100% precipitation;
wind 35.3 km/h, UV 1.85; sunrise 05:11 / sunset 21:40; 🌙 Waxing Gibbous 90%Tokyo, Japan Wed, Aug 12: 28°C / 21°C, Mostly Clear; wind 5 km/h, UV 9; sunrise 04:54 / sunset 18:25;
🌑 New Moon — darkest sky tonight; 🌌 excellent star visibility; ☄️ Perseids peak (100 ZHR, 23:00–04:30 local)weather.alert.severe
Emitted when today's forecast crosses a configured threshold. Defaults: heat ≥35°C, cold ≤−10°C, rain ≥25mm, wind ≥60 km/h, plus thunderstorm and heavy-snow weather codes.
🔥 Tokyo, Japan Sun, Jul 26: Daytime high 38°C reaches heat-wave threshold of 35°C — hydrate, limit midday outdoor exposure
💨 Reykjavik, Iceland Tue, Apr 28: Peak wind 65 km/h reaches high-wind threshold of 60 km/h — secure loose items, avoid coastal exposureConfiguration
| Parameter | Type | Default | What it does |
|---|---|---|---|
| location | string | — (required) | City, Country — auto-resolved to lat/lon + timezone |
| daily_time | HH:MM | 08:00 | When the daily forecast fires (city's local timezone) |
| include_celestial | boolean | true | Add celestial blurb to summary |
| include_alerts | boolean | true | Emit threshold-crossed alerts |
| alert_thresholds | object | see SETUP | Override default severe-weather cut-offs |
Install (Claude Code)
/world2agent:sensor-add @juliapupu/sensor-weather-everywhereThe install flow walks you through 6 questions (4 config + 2 semantic) and writes a handler skill keyed to how you live in the city you picked.
Standalone (no Claude Code)
npm install @juliapupu/sensor-weather-everywhere
w2a-sensor-weather-everywhere | your-agentHeuristics
Sunset glow (sunset_glow_likely):
- 30–70 % cloud cover at sunset hour AND <60 % precipitation chance → likely.
- <20 % cover → "clear, beautiful but no glow."
70 % cover → "overcast, sun blocked."
Star visibility (excellent | good | fair | poor):
- Score = 100 − cloud_cover − moon_noise (moon_noise = 25 if illumination ≥80%, 15 if ≥50%, 0 otherwise).
- ≥75 → excellent · ≥55 → good · ≥30 → fair · else poor.
Severe alerts: derived locally against configurable thresholds against the day's Open-Meteo forecast. No global authoritative alert API exists; this is a quantitative approximation. Tune thresholds via alert_thresholds for your city.
Meteor showers: hardcoded peak-date table for the eight major annual showers; ±1–2 day window around peak; viewing window expressed in the city's local time.
These are heuristics, not science. PRs to improve them welcome.
Source
- Forecast: https://open-meteo.com (free, no API key)
- Geocoding: https://open-meteo.com/en/docs/geocoding-api (free, no API key)
License
MIT
