Skip to main content

Bom Weather

@svendowideit/bom-weatherv2026.10.12.1· 16d agoBEHAVIORSWORKFLOWS
01README

Get the Australian Bureau of Meteorology's 9-day forecast for any suburb or town, plus current observations, a 72-hour hourly forecast and active warnings — and know exactly when to poll for the next revision. WHAT IT DOES

Resolves a location from any one of five selectors — name, postcode, state, geohash or id — then reads from the Bureau's public API: the 9-day daily forecast (min/max temperature, rain chance and range, UV, fire danger, sunrise/sunset, précis text), the latest station observations (temperature, feels-like, humidity, wind, gust, rain since 9am), the 72-hour hourly forecast (wind, dew point, humidity, UV per hour), and active weather warnings with their full text. The daily response's own issue_time and next_issue_time are captured, so a scheduled workflow can poll on the Bureau's real cadence (a new forecast roughly every six hours) instead of a guessed interval, and can print today and tomorrow on demand.

INSTALL

swamp extension pull @svendowideit/bom-weather

DEPENDENCIES

None — it needs only the swamp CLI and outbound network access to api.weather.bom.gov.au.

RUN

# End-to-end: sync the daily forecast, observations, hourly forecast and
# warnings, then print a consolidated view — today/tomorrow with the
# issue cadence, the latest reading, the next hours and any warnings.
# Override the location per run with --input.
swamp workflow run @svendowideit/bom-weather \
  --input name=Bathurst --input state=NSW

# Log all 72 hours and each warning's full message text.
swamp workflow run @svendowideit/bom-weather \
  --input hourlyHours=0 --input warningsDetail=true

# Read one source on its own — observations, hourly or warnings.
swamp model @svendowideit/bom-weather method run observe bom \
  --input postcode=2750

# Every active warning nationally, filtered to one state by the caller
# (the API ignores query filters, so this model filters client-side).
swamp model @svendowideit/bom-weather method run warnings bom \
  --input scope=national --input state=NSW

# Just resolve a selector, to see how an ambiguous name maps to a place.
swamp model @svendowideit/bom-weather method run resolve bom \
  --input postcode=2750

CONFIGURE

All selectors are optional and resolved in the order geohash > id > postcode > name; state narrows a search and disambiguates places that share a name. Each selector can be set either as a model global argument (the default a direct model call uses) or as a workflow input (a per-run override). Pass a selector as --input on any command to override the global:

# Create the model with Penrith, NSW as its default location.
swamp model create @svendowideit/bom-weather bom \
  --global-arg name=Penrith --global-arg state=NSW

# One run against a different location, without changing the default.
swamp model @svendowideit/bom-weather method run sync bom \
  --input name=Bathurst --input state=NSW

On the bundled workflow, the same selectors are workflow inputs:

swamp workflow run @svendowideit/bom-weather \
  --input geohash=r1r0fup

IMPORTANT — the bundled workflow's cron trigger carries its own location (default Penrith, NSW) and passes it to the model on every run, so a model global does NOT change what the scheduled sync fetches. To point the schedule at your own location, set a trigger override, then apply it with swamp serve reload (needs --hot-reload) or a serve restart:

# Poll Bathurst, NSW on the built-in 4x-daily cadence.
swamp workflow trigger set @svendowideit/bom-weather \
  --schedule "30 6,12,18,0 * * *" \
  --input name=Bathurst --input state=NSW

# Inspect built-in vs override vs effective.
swamp workflow trigger get @svendowideit/bom-weather

UPGRADE

bom-weather installs nothing on the host, so there is no in-place rebuild to run. Upgrade by updating the extension; model instances keep their stored configuration and cached snapshots, and the new version applies automatically on the next method run.

swamp extension update @svendowideit/bom-weather

WHAT IT INSTALLS

Nothing on the host. The bundled workflow declares a cron trigger (four times daily) that fires when the workflow is run under swamp serve; it writes no services, files, or webhooks. The trigger carries a default location (Penrith, NSW) — override it for your own location with swamp workflow trigger set (see CONFIGURE).

02Behaviors1
@svendowideit/bom-weatherv2026.10.12.1bom_weather.ts

Global Arguments

ArgumentTypeDescription
apiUrl?stringBOM weather API base URL (versioned root).
userAgent?stringUser-Agent header sent with every request.
name?stringDefault suburb/town name to search for (e.g. 'Penrith').
postcode?stringDefault Australian postcode to search for (e.g. '2750').
state?stringDefault state/territory code (NSW, VIC, QLD, SA, WA, TAS, NT, ACT)
geohash?stringDefault six-character BOM geohash (e.g. 'r650hv8').
id?stringDefault BOM location id (e.g. 'Penrith-r650hv8'). The trailing
fn resolve()
Resolve a location selector (name, postcode, state, geohash or id)
fn sync()
Resolve a selector and fetch the location's 9-day daily forecast.
fn print(dataName?: string, hourlyHours?: number, warningsDetail?: boolean)
Log a consolidated view of everything the other methods stored:
ArgumentTypeDescription
dataName?stringResource instance holding the forecast to print (sync writes
hourlyHours?numberHow many hourly entries to log when an `hourly` snapshot exists
warningsDetail?booleanInclude each warning's full HTML message text in the log when a
fn sync-hourly()
Resolve a selector and fetch the location's 72-hour hourly forecast
fn observe()
Resolve a selector and fetch the latest observed conditions from the
fn warnings()
Fetch active warnings — either scoped to the resolved location

Resources

location(infinite)— A resolved BOM location (place metadata)
forecast(infinite)— The 9-day daily forecast plus issue metadata
summary(infinite)— The printed today/tomorrow summary
hourly(infinite)— The 72-hour hourly forecast plus issue metadata
observation(infinite)— The latest observed conditions at the nearest station
warnings(infinite)— Active warnings (location-scoped or national)
03Workflows1
@svendowideit/bom-weather191d9c23-353c-4433-af63-2f22c6b9670d

Fetch and print the 9-day BOM forecast for one location, plus the current observations, the 72-hour hourly forecast and any active warnings. The final step prints today and tomorrow with the issue_time / next_issue_time. Location is chosen by any one of name, postcode, state, geohash or id — set the defaults on the `bom` model, or override per run with --input. The cron trigger polls four times daily, and the daily sync records the Bureau's own issue_time so callers can detect a genuinely new f

mainSync the daily forecast and supplementary sources, then print today/tomorrow.
1.sync— Resolve the selector and fetch the 9-day daily forecast. Records issue_time and next_issue_time; the snapshot advances whenever the Bureau issues a new forecast.
2.observe— Fetch the latest observed conditions from the nearest BOM station. Non-fatal: the observations feed is supplementary to the forecast.
3.sync-hourly— Fetch the 72-hour hourly forecast (temperature, wind, rain chance). Non-fatal: it complements the daily précis rather than replacing it.
4.warnings— List active warnings for the location (or nationally). Non-fatal: most runs have no warnings, and a warnings outage must not suppress the forecast print.
5.print— Print a consolidated view: today and tomorrow with issue_time / next_issue_time, the latest observation, the next hours, and any active warnings. Always the last step.
04Previous Versions2
2026.09.23.2

Modified 1 behaviors

2026.09.22.1
05Stats
A
93 / 100
Downloads
26
Archive size
29.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License1/2partial

    no SPDX license declared

  • Verified public repository2/2earned
06Platforms