Skip to content

A web application that compares weather forecasts from multiple sources against actual data from a personal weather station, enabling accuracy analysis and trend tracking over time.

Notifications You must be signed in to change notification settings

m90att/weather-forecast-comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

Weather Forecast Comparison App

A web application that compares weather forecasts from multiple sources against actual data from a personal weather station, enabling accuracy analysis and trend tracking over time.

🎯 Project Goals

  • Compare forecast accuracy between different weather services (Met Office, OpenWeatherMap)
  • Track forecast performance over time with interactive visualizations
  • Provide data-driven insights for choosing the most reliable forecast sources
  • Mobile-optimized interface for quick weather accuracy checks

πŸ“‹ Features

MVP Features

  • βœ… Personal Weather Station data ingestion via webhook
  • βœ… Met Office and OpenWeatherMap API integration
  • βœ… Interactive timeline charts with mobile touch controls
  • βœ… Real-time accuracy metrics for temperature, wind, and rainfall
  • βœ… Configurable location and API settings
  • βœ… Responsive design optimized for mobile devices

Future Enhancements

  • πŸ”„ Additional weather service integrations
  • πŸ”„ Home Assistant custom component
  • πŸ”„ User-defined accuracy thresholds
  • πŸ”„ Lead-time performance analysis (1h, 6h, 24h forecast buckets)
  • πŸ”„ Advanced data archiving and retention policies

πŸ—οΈ Architecture

Backend

  • Framework: FastAPI (Python)
  • Database: PostgreSQL with TimescaleDB
  • Caching: Redis
  • APIs: Met Office DataHub, OpenWeatherMap

Frontend

  • Framework: React
  • Charts: Recharts + D3.js for timeline interactions
  • Styling: Tailwind CSS
  • PWA: Workbox for offline functionality

Infrastructure

  • Containerization: Docker
  • CI/CD: GitHub Actions
  • Deployment: Docker Compose on Proxmox

πŸ“š Documentation

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • API keys for Met Office and OpenWeatherMap
  • Personal Weather Station with Home Assistant integration

Local Development

  1. Clone the repository

    git clone https://github.com/m90att/weather-forecast-comparison.git
    cd weather-forecast-comparison
  2. Set up environment variables

    cp .env.example .env
    # Edit .env with your API keys and configuration
  3. Start the development environment

    docker-compose up -d
  4. Access the application

Weather Station Setup

Configure your Home Assistant to send weather data to the webhook endpoint:

# configuration.yaml
rest_command:
  local_weather_webhook:
    url: "http://your-app-server:8000/api/v1/webhook/weather-data"
    method: POST
    content_type: "application/json"
    payload: >
      {
        "PASSKEY": "{{ passkey }}",
        "stationtype": "{{ stationtype }}",
        "dateutc": "{{ dateutc }}",
        "tempf": "{{ tempf }}",
        "humidity": "{{ humidity }}",
        "winddir": "{{ winddir }}",
        "windspeedmph": "{{ windspeedmph }}",
        "rainratein": "{{ rainratein }}",
        "dailyrainin": "{{ dailyrainin }}",
        "baromrelin": "{{ baromrelin }}"
      }

πŸ§ͺ Testing

Run Tests

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

# End-to-end tests
npm run test:e2e

Mobile Testing

# Test responsive design
npm run test:mobile

# Performance testing
npm run test:lighthouse

πŸ“± Mobile Optimization

The app is designed mobile-first with:

  • Touch-friendly timeline scrubbing
  • Responsive chart layouts
  • Progressive Web App capabilities
  • Optimized for iOS and Android devices

πŸ“Š Data Management

Data Retention

  • Active Data: 3 months of detailed hourly readings
  • Archived Data: 1+ years of aggregated summaries
  • Automatic Cleanup: Configurable retention policies

Supported Weather Parameters

  • Temperature (Β°C)
  • Humidity (%)
  • Wind Speed/Direction (mph/degrees)
  • Rainfall (mm)
  • Pressure (hPa)
  • Solar Radiation (W/mΒ²)
  • UV Index

πŸ”§ Configuration

Environment Variables

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/weather_app
REDIS_URL=redis://localhost:6379

# API Keys
MET_OFFICE_API_KEY=your_met_office_key
OPENWEATHERMAP_API_KEY=your_openweather_key

# Weather Station
WEATHER_STATION_PASSKEY=your_passkey
WEATHER_STATION_LAT=51.5074
WEATHER_STATION_LON=-0.1278

# Application
APP_DEBUG=false
APP_LOG_LEVEL=info

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

πŸ“ˆ Roadmap

Phase 1: MVP (Current)

  • Core functionality implementation
  • Mobile optimization
  • Basic accuracy metrics
  • Deployment automation

Phase 2: Enhanced Features

  • Additional weather service integrations
  • User-defined accuracy thresholds
  • Advanced visualization options
  • Data export capabilities

Phase 3: Community Features

  • Home Assistant integration
  • Public API development
  • Multi-user support
  • Community weather station network

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™‹β€β™‚οΈ Support

For questions and support:

  • Create an issue for bugs or feature requests
  • Check existing documentation
  • Review the API documentation at /docs when running locally

About

A web application that compares weather forecasts from multiple sources against actual data from a personal weather station, enabling accuracy analysis and trend tracking over time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published