@juliapupu/sensor-nyc-weather
v0.1.0
Published
W2A sensor — daily NYC weather plus celestial moments a New Yorker would actually want to know about (sunset glow, moon phase, meteor showers, severe weather alerts)
Downloads
59
Maintainers
Readme
@juliapupu/sensor-nyc-weather
A World2Agent sensor that delivers NYC weather plus the celestial moments a New Yorker would actually want to know about — sunset glow likelihood, moon phase, stargazing quality, and active meteor showers.
Built for the resident who wants more than "high 18, low 9, chance of rain" — when the sky over Brooklyn is going to be magenta at 7:42pm, or when the Perseids are peaking on a moonless Tuesday, this sensor calls it.
What it does
- Polls the National Weather Service public API once a day at a time you choose (default 08:00 ET).
- Computes sunrise / sunset / civil dusk / moon phase locally (no external API for astronomy).
- Heuristically scores tonight's sunset glow likelihood from the cloud-cover forecast 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 all of the above bundled into one human-readable summary plus structured fields. - Polls NWS active alerts every 15 min; emits
weather.alert.severewhen NYC enters a Severe or Extreme warning.
Signals
weather.forecast.daily
| Field | What's in it |
|---|---|
| event.summary | One line — high/low, conditions, wind, sunrise/sunset, plus celestial blurb (🌅 sunset glow / 🌙 moon / 🌌 stars / ☄️ meteor) when notable |
| source_event.data | high_c, low_c, short_summary, precipitation_chance, wind, sunrise_iso, sunset_iso, civil_dusk_iso, moon_phase, moon_illumination_pct, sunset_glow_likely, star_visibility, optional meteor_shower_name / meteor_shower_zhr |
| attachments[0] | NWS detailed forecast text + computed sun/moon/celestial detail (inline) |
Example summaries:
NYC Mon, Apr 27: 17°C / 9°C, Sunny; wind 6 to 10 mph NE; sunrise 06:01 / sunset 19:48; 🌙 Waxing Gibbous 84%; 🌌 good star visibilityNYC Wed, Aug 12: 28°C / 21°C, Mostly Clear; wind 5 mph S; sunrise 06:04 / sunset 20:00; 🌑 New Moon — darkest sky tonight; 🌌 excellent star visibility; ☄️ Perseids peak (100 ZHR, 23:00–04:30 ET)weather.alert.severe
Emitted when NWS publishes a Severe or Extreme alert for the NYC point.
⚠️ NYC Coastal Flood Warning (Severe/Expected): Significant coastal flooding expected this afternoon...Configuration
| Parameter | Type | Default | What it does |
|---|---|---|---|
| daily_time | string HH:MM | 08:00 | When the daily forecast fires (NYC local) |
| include_alerts | boolean | true | Emit Severe/Extreme NWS alerts when issued |
| include_celestial | boolean | true | Add celestial blurb to daily summary |
Install
In Claude Code:
/world2agent:sensor-add @juliapupu/sensor-nyc-weatherThe install flow walks you through 6 questions (3 config, 3 semantic preferences) and writes a handler skill tailored to how you live in NYC.
Standalone (no Claude Code)
npm install @juliapupu/sensor-nyc-weather
w2a-sensor-nyc-weather | your-agentHeuristics — how the celestial signals are scored
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."
- Reason string is included so the AI agent (and you) can sanity-check.
Star visibility (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.
Meteor showers: hardcoded peak-date table for the eight major annual showers; ±1–2 day window around peak.
These are heuristics, not science. PRs to improve them welcome.
Source
NWS public API: https://api.weather.gov · NYC point: 40.7128, -74.0060
License
MIT
