Skip to content

SMHI: migrate to SNOW1gv1 API (replace deprecated PMP3gv2)#4082

Merged
rejas merged 3 commits intoMagicMirrorOrg:developfrom
cgillinger:fix/smhi-snow1g-migration
Apr 3, 2026
Merged

SMHI: migrate to SNOW1gv1 API (replace deprecated PMP3gv2)#4082
rejas merged 3 commits intoMagicMirrorOrg:developfrom
cgillinger:fix/smhi-snow1g-migration

Conversation

@cgillinger
Copy link
Copy Markdown

Summary

This PR migrates the SMHI weather provider from the deprecated PMP3gv2 API to the new SNOW1gv1 API.

The old API (pmp3g/version/2) started returning HTTP 404 on 2026-03-31.

Changes

  • Updated API endpoint:
    • pmp3g/version/2snow1g/version/1
  • Updated response parsing:
    • validTimetime
    • parameters[]data (flat structure)
  • Updated parameter names:
    • tair_temperature
    • wswind_speed
    • etc.
  • Updated precipitation handling to match new predominant_precipitation_type_at_surface
  • Updated coordinate parsing (flat [lon, lat])
  • Added missing value handling (9999 → null)

Notes

  • Maintains backward compatibility for precipitationValue config
  • No UI changes
  • Symbol mapping unchanged (same codes 1–27)

Testing

  • Verified against live SMHI SNOW1gv1 API responses
  • Confirmed old API returns HTTP 404

Impact

Fixes broken SMHI provider due to API deprecation.

@rejas
Copy link
Copy Markdown
Collaborator

rejas commented Apr 2, 2026

Thanks for the PR. Did you make sure to start your work from the latest develop branch?

@cgillinger
Copy link
Copy Markdown
Author

Thanks for the PR. Did you make sure to start your work from the latest develop branch?

I’m not entirely sure, I’ll double-check and update my branch if needed. I’m still getting familiar with the GitHub workflow.

@cgillinger cgillinger force-pushed the fix/smhi-snow1g-migration branch from 3c95958 to 8ace125 Compare April 2, 2026 19:35
@khassel
Copy link
Copy Markdown
Collaborator

khassel commented Apr 2, 2026

I'm not a fan of these code style tests, but others here value them. Could you please remove the warnings in smhi.js? They're visible in the "files changed" tab. Thanks!

@rejas rejas merged commit d2304af into MagicMirrorOrg:develop Apr 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants