Skip to content

[Feature Request] Weather module: Offset unit conversion to the Provider when supported #4111

Closed as not planned

Description

@PDStig

Prerequisites

  • I am running the latest version of MagicMirror², and know that this feature is not available now.
  • I know my issue is not related to a third-party module.
  • I have searched for existing issues that already include this feature request, without success.

Describe the Feature Request

Support passing in the unit type into API requests for weather providers when supported. Use the current implementation (the module does the conversions) otherwise.

Describe the Use Case

The current implementation of the weather module always requests metric units in the Provider APIs. This is bad for rounding reasons. Some providers (e.g. WeatherFlow) support providing data with precision (e.g., the tenths place for temperature). When using C (which has a smaller available range), we lose accuracy by as much as 0.2F when manually converting the API response to F.

Note: WeatherFlow does not support providing units in the conditions API where it provides precision; it always returns C. But it supports units in the better_forecast endpoint (however, it always rounds to the nearest whole number for the temperature, which is unfortunate).

A better example of this might be OpenWeatherMap. They provide precise temperatures and support specifying units. Therefore, a C return being converted to F by the module may result in a loss of accuracy due to double-rounding (the API rounds for C, and the module rounds again for F).

Describe Preferred Solution

  • New public readonly property in provider JS classes. This property defines whether the provider supports specifying units in the API. If this is false, then the weather module does its own conversions (as it currently does). If true, then the module assumes the returned data from the Provider is already converted (and does not convert anything).
  • When a provider supports unit conversions, use the specified MagicMirror configuration for units if possible. Pass this in the API call for the provider. For special cases, add new Provider-specific configuration properties.

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

Participation

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

Activity

  1. changed the title [-][Feature Request] Offset unit conversion to the Provider when supported[/-] [+][Feature Request] Weather module: Offset unit conversion to the Provider when supported[/+] on Apr 18, 2026
  2. PDStig commented on Apr 21, 2026

    @PDStig
    Author

    Per #4107 (comment)

    I started working on this in a local branch. However, I came across a potential issue with Weather API that is blocking me. The implementation does not align with their API docs. It uses the forecast API to get the current conditions. But their docs do not indicate that a "current" object is returned in that API. I have to run tests to confirm if that is true. I'll file a separate issue (and fix) if so.

  3. sdetweil commented on Apr 21, 2026

    @sdetweil
    Collaborator

    Always start w develop as the base, right?
    git checkout develop
    Then
    git checkout -b new_brsnch_name

  4. PDStig commented on Apr 21, 2026

    @PDStig
    Author

    Good call. I didn't clone develop for some reason. Thanks! I'll stash the changes, recreate the branch from develop, and pop.

  5. github-actions commented on Jun 27, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions