Plugin: mam-nws-weather

What it does

Shows National Weather Service (NWS) forecast cards in the mobile app — a horizontally swipeable weather strip on the home screen, opened to the location nearest the user. Forecast data comes from the free api.weather.gov service (US locations); no API key is needed.

Weather appears in the app two ways:

  • Home screen stack element — while this plugin is active, a Weather section is available in the home screen stack editor. Add it to any role’s stack and the app renders the weather strip in that position. If no weather data is available (plugin deactivated, no locations configured, NWS unreachable), the element hides itself — it never shows an empty box.
  • Content section — a Weather Data content type is registered for content-section buttons, returning the same forecast cards.

Where the locations come from

Two sources, controlled by the Weather Locations Source setting (default Automatic):

  1. GeoDirectory listings — each listing’s coordinates get their own forecast, optionally limited to listings in specific categories (GeoDirectory Categories for Weather setting). This is the zero-configuration path for GeoDirectory apps.
  2. Developer filter — a custom list of locations supplied in code via the mam_nws_weather_for_home_screen_stack filter, for apps without GeoDirectory.

Automatic uses the developer filter when one is wired, otherwise GeoDirectory.

How data flows

  • A scheduled job (Update Weather from the National Weather Service, every 15 minutes, visible under Mobile App Mgr → Scheduled Jobs) resolves each location to an NWS forecast grid and caches the forecast — in listing post meta (nws_grid, nws_weather) for GeoDirectory locations, or in the {prefix}mam_nws_weather table for filter locations.
  • When the app requests its data, the plugin adds a top-level weather array of forecast cards to the payload — only for payloads that will actually render it (a Weather section is in that role’s home screen stack, or the site uses the developer filters).
  • Cached forecasts are reused for the Forecast Cache Duration (default 15 minutes), then refreshed on demand; if NWS is unreachable, the last cached forecast is served.

Settings

All settings live in Mobile App Mgr → App Settings, Weather panel, and apply per app (not per role). See Recipe: Configure the Weather settings. Per-role control is simply whether that role’s stack contains the Weather element.

Hooks for developers

Hook Type Purpose
mam_nws_weather_for_home_screen_stack filter Supply a custom list of weather locations.
mam_nws_geodirectory_categories filter Override which GeoDirectory categories get weather.
mam_nws_weather_phone_data filter Adjust the app payload after weather is added.
mam_nws_get_weather_data filter Fetch weather cards for an arbitrary location list.

A refresh can also be triggered manually via the nws_weather AJAX action (rate-limited to once per minute).



Metadata

Field Value
Article type Plugin Overview
Plugin slug mam-nws-weather
Applies to plugin version 2.0+
Category Plugin Reference
Depends on MAM Main (June 2026+ — plugin-registered home-screen-stack sections)
Works with MAM GeoDirectory
Last verified 2026-06-12
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!