Skip to content

Add FMI weather provider - #4278

Merged
KristjanESPERANTO merged 6 commits into
MagicMirrorOrg:developfrom
i-xul:feature/fmi-weather-provider
Sep 22, 2026
Merged

KristjanESPERANTO merged 6 commits into
MagicMirrorOrg:developfrom
i-xul:feature/fmi-weather-provider

Conversation

@i-xul

@i-xul i-xul commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request adds the Finnish Meteorological Institute (FMI) as a weather provider for the default weather module.

The provider uses FMI Open Data services and does not require an API key.

It supports:

  • Current weather observations from FMI weather stations
  • Automatic selection of the nearest station with the required observations
  • Hourly forecasts using the FMI HARMONIE model
  • Daily forecasts aggregated from HARMONIE forecast data
  • Finnish local calendar days for daily forecast aggregation
  • FMI weather symbol mapping to MagicMirror weather types
  • Temperature, humidity, wind, precipitation, and related weather data

The implementation uses latitude and longitude coordinates, consistent with the existing weather provider configuration.

Related issue

No related issue.

Additional changes

  • Adds FMI-specific unit tests covering configuration, URL construction, observation parsing, station selection, current weather generation, forecast parsing, hourly forecasts, daily forecasts, and forecast fetching.
  • Extends the HTTP fetcher to support the FMI XML responses required by the provider.
  • Adds tests for the HTTP fetcher changes.
  • Adds FMI-related terms to the spelling dictionary.
  • Adds FMI to the weather provider release-note category.

Testing

Tested locally on Windows 11.

FMI provider tests:

17 passed (17)

Full unit test suite:

489 passed, 1 failed (490 total)

The single failing test is tests/unit/classes/systeminformation_spec.js, which expects platform: linux. The local test environment reports platform: Windows. The FMI provider tests pass successfully.

npm run config:check also passes successfully.

The provider was additionally tested with live FMI data in MagicMirror using current, forecast, and hourly weather module instances.

@KristjanESPERANTO KristjanESPERANTO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This looks good overall, except the url usage.

I see potential to consolidate things, since we have some similarities with the provider evcanada. I'd probably address that in a follow-up PR.

Comment thread js/http_fetcher.js Outdated
@KristjanESPERANTO
KristjanESPERANTO merged commit 9f803a4 into MagicMirrorOrg:develop Sep 22, 2026
13 checks passed
@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@i-xul Can you please also add FMI to the docs? :)

https://github.com/MagicMirrorOrg/MagicMirror-Documentation/blob/master/modules/weather.md#general-options

khassel pushed a commit that referenced this pull request Sep 26, 2026
Follow-up to #4278, which introduced support for dynamic URLs in
`HTTPFetcher`.

That support was added as an implicit `string | function` constructor
argument. This works, but is not very explicit at the call site. This PR
cleans that up by using `{ url }` for static URLs and `{ urlFactory }`
for URLs that are resolved for each request.

This also simplifies the `envcanada` provider. It previously had to
track the current hour and restart the fetcher whenever the hourly URL
changed. It now uses the resolved request URL to detect and ignore stale
responses, without restarting the fetcher.
@i-xul
i-xul deleted the feature/fmi-weather-provider branch September 27, 2026 20:52
@KristjanESPERANTO KristjanESPERANTO mentioned this pull request Oct 1, 2026
KristjanESPERANTO added a commit that referenced this pull request Oct 1, 2026
## Release Notes
Thanks to: @ago1776, @alkank, @Antra, @Blackspirits, @deBasMan21,
@flightlesstux, @i-xul, @jamalkamaladdin, @khassel, @KristjanESPERANTO,
@MannXo, @pascalpfammatter, @rejas
> ⚠️ This release needs nodejs version >=22.22.2 <23 || >=24

[Compare to previous Release
v2.37.0](v2.37.0...develop)


### [core]
- Prepare Release 2.38.0 (#4285)
- fix: let Electron select the Wayland display (#4268)
- fix(http): improve access error messages (#4281)
- fix: always redact client configuration (#4275)
- refactor: migrate browser scripts to ESM (#4272)
- refactor: convert animateCSS to ES module (#4266)
- use filter instead of find to get all allowed secrets when multiple
instances of a module are active (#4265)
- refactor: convert notificationFx to ES module (#4263)
- refactor: enforce function expression style (#4262)
- fix: validate client IP behind trusted proxies (#4261)
- prefer arrow over function (#4252)
- refactor(utils): simplify configuration validation and error handling
(#4240)
- fix(server): validate request origins (#4234)
- remove codeql warning (#4231)
- refactor(socket): use direct ESM import in main (#4225)
- refactor(socket): load Socket.IO client via ESM (#4224)
- style: simplify Electron startup checks (#4213)
- refactor: consolidate electron bootstrap into async function (#4210)
- refactor(module): simplify and fix configMerge (#4203)
- refactor: convert Translator to ES module (#4202)
- docs: add CodeQL review steps and restructure after-release checklist
(#4200)
- refactor: centralize server port resolution (#4198)
- refactor: use const instead of let for variable declarations (#4196)
- refactor: replace Loader object with named exports (#4195)
- set next release dev number
- refactor(eslint): enforce prefer-arrow-callback rule (#4251)
- refactor(http_fetcher): make dynamic URL handling explicit (#4282)
- refactor: use explicit global config (#4233)
- expand logic of hideConfigSecrets, add more tests (#4229)
- refactor: make browser startup more explicit (#4214)

### [dependencies]
- update dependencies (#4276)
- update dependencies incl. electron to v44 (#4250)
- chore: update eslint incl. plugins + review rules (#4236)
- Bump actions/stale from 10 to 11 (#4215)
- update dependencies (#4221)
- Bump actions/setup-node from 6 to 7 (#4204)
- chore: update dependencies (#4201)
- Bump electron from 42.5.2 to 43.0.0 (#4192)

### [modules/alert]
- Move alert translations into common translations (#4284)

### [modules/calendar]
- Fixes issue 4243: Ensure while loop in calendar module does not get
stuck when no entries (#4244)
- fix(calendar): escape HTML in event title and location (#4260)
- calendar: allow custom events to override symbol class (#4257)
- Fix calendar crash when yearmatchgroup regex does not match (#4239)
- fix(calendar): keep yearly events in DTSTART's month when BYMONTH is
missing (#4222)
- fix(calendar): correct multi-day slice day counts (#4232)
- chore: update dependencies + adapt calendar tests (#4211)
- fix(calendar): sliced multi-day events start at 00:00, not 23:59
(#4208)

### [modules/newsfeed]
- newsfeed: don't use cors url in njk template (#4279)
- refactor(newsfeed): extract feed item normalization into feeditem.js
(#4271)
- refactor(newsfeed): replace feedme lib with feedparser (#4269)
- newsfeed: fix allowedBasicHtmlTags (#4258)
- newsfeed: update checkArticleUrl (#4256)

### [modules/updatenotification]
- feat(updatenotification): implement trusted module configuration for
update commands (#4259)

### [modules/weather]
- feat: add FMI weather provider (#4278)
- feat(weather): enable CSS ordering for forecast and hourly columns
(#4118)
- fix(weather): respect initial load delay (#4254)
- fix(weather): restrict provider loading to the providers directory
(#4235)
- refactor(weather): extract WeatherProvider base class (#4228)

### [testing]
- ci: fail lint on warnings (#4230)
- add test if install works for minimal node version (#4197)

### [translation]
- feat(i18n): add Azerbaijani translation (#4283)
- feat(i18n): complete Turkish translations (#4277)
- Improve Portuguese translations (#4274)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Kevin G. <crazylegstoo@gmail.com>
Co-authored-by: veeck <gitkraken@veeck.de>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Jboucly <33218155+jboucly@users.noreply.github.com>
Co-authored-by: Jboucly <contact@jboucly.fr>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarno <54169345+jarnoml@users.noreply.github.com>
Co-authored-by: sam detweiler <sdetweil@gmail.com>
Co-authored-by: Jordan Welch <JordanHWelch@gmail.com>
Co-authored-by: Blackspirits <blackspirits@gmail.com>
Co-authored-by: Samed Ozdemir <samed@xsor.io>
Co-authored-by: in-voker <58696565+in-voker@users.noreply.github.com>
Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com>
Co-authored-by: cgillinger <christian.gillinger@gmail.com>
Co-authored-by: Sonny B <43247590+sonnyb9@users.noreply.github.com>
Co-authored-by: sonnyb9 <sonnyb9@users.noreply.github.com>
Co-authored-by: Morgan McBee <egeekial@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Mike Bishop <mbishop@evequefou.be>
Co-authored-by: ago1776 <andi.goepfert@gmx.de>
Co-authored-by: pascalpfammatter <pascal.pfammatter@mirific.ch>
Co-authored-by: Pascal Pfammatter <304897782+pascalpfammatter@users.noreply.github.com>
Co-authored-by: Anders Demant van der Weide <antra@antra.dk>
Co-authored-by: Bas Buijsen <72604903+deBasMan21@users.noreply.github.com>
Co-authored-by: Parman Mohammadalizadeh <prmma23@gmail.com>
Co-authored-by: alkank <alkankizilca@gmail.com>
Co-authored-by: Henkka <121262594+i-xul@users.noreply.github.com>
Co-authored-by: Ercan Ermis <18646235+flightlesstux@users.noreply.github.com>
Co-authored-by: Jamal Kamaladdinoglu <jamalkamaladdin@gmail.com>
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