Skip to content

SMHI weather provider broken — PMP3gv2 API returns 404 since March 31, 2026 #4081

@cgillinger

Description

@cgillinger

What problem do you want to solve with this change?

The SMHI weather provider is completely broken since March 31, 2026. SMHI discontinued the PMP3gv2 forecast API, and all requests to category/pmp3g/version/2 now return HTTP 404.

This affects all MagicMirror² users using weatherProvider: "smhi".

You can verify by running:

# Old API — returns 404:
curl -s -o /dev/null -w "%{http_code}" "https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/point/lon/18.07/lat/59.33/data.json"

# New API — works:
curl -s "https://opendata-download-metfcst.smhi.se/api/category/snow1g/version/1/geotype/point/lon/18.07/lat/59.33/data.json" | head -c 200

SMHI migration announcement: https://www.smhi.se/data/om-smhis-data/uppdateringar-oppna-data/uppdateringar-i-smhis-oppna-data/2025-09-12-nya-apier-for-meteorologiska-prognoser-och-analyser

What do you think is the correct solution?

Update defaultmodules/weather/providers/smhi.js to use the new SNOW1gv1 API. The changes needed:

  1. URL: category/pmp3g/version/2category/snow1g/version/1
  2. Data structure: The parameters array (with name/values objects) is replaced by a flat data object (e.g. entry.data.air_temperature)
  3. Time key: validTimetime
  4. Parameter names: tair_temperature, wswind_speed, wdwind_from_direction, rrelative_humidity, Wsymb2symbol_code, mslair_pressure_at_mean_sea_level, pcatpredominant_precipitation_type_at_surface, pmeanprecipitation_amount_mean, pmedianprecipitation_amount_median, pminprecipitation_amount_min, pmaxprecipitation_amount_max
  5. Coordinates: geometry.coordinates is now [lon, lat] (flat), not [[lon, lat]] (nested)
  6. Missing values: All parameters use 9999 as sentinel — should be filtered out

New API docs: https://opendata.smhi.se/metfcst/snow1gv1
Parameter reference: https://opendata.smhi.se/metfcst/snow1gv1/parameters

Participation

  • I am willing to submit a pull request for this change.

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions