Skip to content

refactor: Fusion engine should pick best value per field, not duplicate across sources #492

@Orinks

Description

@Orinks

Summary

In auto mode, the fusion engine merges data from all available sources but doesn't always pick the most appropriate value per field. For example, London's visibility shows 42 mi (from Open-Meteo's 67.6 km model value) instead of PW's more realistic 8.7 mi / 14 km.

Current Behavior

Auto mode fetches from all configured sources in parallel and merges results. For international locations, Open-Meteo has highest priority, so its values win for fields like visibility even when other sources may have more accurate data.

Proposed Behavior

The fusion engine should be smarter about per-field source selection:

  • Visibility: Prefer sources that report values consistent with current conditions (e.g., if there's fog/rain, prefer the lower visibility value)
  • Temperature: Average or prefer the source with highest temporal resolution
  • Wind: Prefer sources that include gust data
  • Alerts: Already merges correctly (NWS for US, PW for international)
  • General principle: For each field, pick the source most likely to be accurate rather than always defaulting to source priority order

Context

  • Open-Meteo returns clear-sky theoretical visibility (up to 75 km) which can be much higher than actual observed conditions
  • PW blends multiple models which tends to give more conservative/realistic visibility
  • NWS uses actual station observations for US locations

References

  • Fusion engine: src/accessiweather/weather_client_fusion.py
  • Source priority: src/accessiweather/config/source_priority.py
  • Observed: London showing 42 mi visibility (Open-Meteo) vs 9 mi (PW standalone)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions