Skip to content

Repository files navigation

weather-forecast

weather-forecast is a simple weather dashboard that retrieves data from OpenWeatherMap. The project is built for a Raspberry Pi 5" screen. It includes a custom 3d-printed case with stand.

  • Optimized for 800x480 resolution.
  • If you're viewing on a 1920x1080 monitor, zoom the browser to 200% to approximate the intended element sizes on the Pi display.
setup_light setup_dark
index_light index_dark

Contents:

How to setup:

  1. Clone the repository
git clone https://github.com/infinitel8p/weather-forecast.git
  1. Navigate into the project directory
cd weather-forecast
  1. Setup the environment variables in .env file
    • OPENWEATHERMAP_API_KEY — Your OpenWeatherMap API key (used for all weather data and geocoding)
    • OPENWEATHERMAP_API_VERSION — The API tier to use:
    • LANGUAGE — UI language: en (default) for English or de for German. Also affects weather descriptions from the API and date/time formatting.

Note

Choose the API version based on your OpenWeatherMap subscription. The free option allows you to run the dashboard without a paid subscription, but with limited features and less granular forecast data.

  1. Install the dependencies
npm install
  1. Start the development server
npm run dev

Settings

Open /config (or tap the small gear icon in the bottom-right corner of the dashboard) to adjust the dashboard:

  • Night mode - switch between day and night theme on a fixed hour schedule (default: night from 22:00 to 06:00) or automatically at sunrise/sunset for your location.
  • Timezone - used for all displayed dates and times and for the night mode schedule (default: Europe/Berlin). If night mode seems to switch at the wrong time, check this first - it also fixes devices whose system clock runs on UTC.
  • Language - German or English.
  • High contrast - a stronger variant of the day theme for small or low-quality screens (see below).

Settings are stored as cookies in the browser that displays the dashboard, so they survive reboots of a kiosk setup.

High-contrast mode

For small or low-quality screens (like the Raspberry Pi 5" touchscreen), a high-contrast variant of the day theme is available. Enable it on the /config page, or append ?hc to the URL to force it for a single session:

http://localhost:4321/?hc
http://localhost:4321/setup?hc

This increases text contrast, makes cards more opaque, deepens borders, and strengthens the geometric background elements for better readability. The night theme is unaffected.

3D-printed case

WhatsApp Image 2025-05-21 at 07 21 03

The case is designed to fit a Raspberry Pi 5" screen. The design files are available on MakerWorld.

Hardware

  • Raspberry Pi 4
  • 5" HDMI screen such as this one

About

weather-forecast, a simple weather dashboard

Topics

Resources

Stars

11 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages