A Python script to generate a customisable Meteogram, augmented with calendar data, suitable for a passive home weather display https://ianrenton.com/projects/meteogram/
Find a file
2025-09-05 15:20:28 +01:00
.idea Allow not specifying any calendars in config 2024-11-30 12:09:25 +00:00
docs Migrate to new Met Office DataHub server 2024-02-03 15:14:51 +00:00
icons Improve icon resolution and other tweaks 2023-04-14 14:30:08 +01:00
.gitignore Gitignore update 2023-05-03 19:13:33 +01:00
config.yml.example Add the ability to show dates in the month, and month names on the 1st, as well as the name of the day. Closes #13. 2024-11-30 13:54:17 +00:00
datapoint.py Add thunder probability as a criterion for the storm warning. Closes #2 2023-05-07 12:35:05 +01:00
defines.py First part of matplotlib rewrite #5 2023-05-02 20:44:13 +01:00
functions_calendar.py Trap and log errors connecting to iCal URLs instead of crashing 2025-04-03 20:02:56 +01:00
functions_condition_bars.py Fix a bug where the display could fail to update if a cluster of storm or frost times overlapped the start or end of the display. 2023-10-24 18:18:19 +01:00
functions_config.py Migrate to new Met Office DataHub server 2024-02-03 15:14:51 +00:00
functions_plotting.py Fix a bug where the dates for the 11th, 12th & 13th were shown as 11st, 12nd and 13rd 2025-03-16 07:08:58 +00:00
functions_weather.py Migrate to new Met Office DataHub server 2024-02-03 15:14:51 +00:00
LICENSE First commit 2023-04-10 09:20:00 +01:00
meteogram.py Update links 2025-09-05 15:20:28 +01:00
README.md Update links 2025-09-05 15:20:28 +01:00
requirements.txt Fix an issue parsing Nextcloud calendars 2024-11-15 15:05:05 +00:00
setwp.sh Recover working requirements.txt from the Pi and other minor changes 2023-05-05 15:38:24 +01:00

Home Meteogram Display

A python script to display a Meteogram, along with other information. It is designed as a passive weather display for an ultra-widescreen monitor, but the generated image is also suitable for inclusion in web-based dashboards and other types of informational display. Weather forecast data is currently taken from the UK Met Office DataHub API.

The Meteogram display running on a widescreen device

You can read about the background to this project in this blog post, and if you're interested in the hardware as well, the full build guide is here.

Features

  • A red line shows temperature in Celsius between defined limits. Low temperatures in the forecast will cause frost and ice indicators to appear on the chart. You can use the "feels like" or real temperatures.
  • A green line shows wind speed in miles per hour, between zero and a defined limit. The higher dashed green line shows gust speed.
  • A blue line shows precipitation probability from 0 to 100%.
  • Blue bars show precipitation amount, between zero and a defined limit.
  • A purple line shows humidity from 0 to 100%.
  • Vertical yellow bands show hours of daylight, named for their day of the week, and the solid yellow vertical line shows the current time when the meteogram was generated.
  • Weather symbols across the bottom of the meteogram are based on the forecasted conditions.
  • Bars across the bottom of the display warn of frosts and storms, and will also display good days for drying laundry outside.
  • Additional bars aross the bottom of the display can be used to display calendar events.
  • All of these features can be toggled on and off, colours changed, etc. in a config file.

Meteogram example

Running your own copy

If you would like to use this script for yourself, follow these steps:

  1. Ensure you have python version >= 3.8 installed
  2. Clone the repository from Forgejo, and open the directory in a terminal window
  3. Optionally, create a virtual environment ("venv") to install libraries separately to your system Python libraries, with e.g. venv ./venv
  4. Install the required dependencies by running pip install -r requirements.txt

(Running on an old Raspberry Pi and seeing an error about missing compilers when installing scipy, or waiting a very long time for it to install numpy? It's easiest to install these using the package manager, e.g. sudo apt install python3-scipy python3-numpy, rather than letting pip try to build them from source. Once complete, re-run the command above.)

  1. Copy or rename the config.yml.example file to config.yml
  2. Edit config.yml in your preferred editor. You will need:
    • Your approximate position, in latitude and longitude. You can look this up using Google Maps or other online services.
    • A Met Office DataHub API key. To get this, you will need to create an account on the Met Office DataHub site and subscribe to the Site Specific forecast Global Spot product. This is free for 360 API calls per day. (Your page should look like the image below:)

Met Office webpage with the correct product selected

  1. Make any other adjustments to parameters in config.yml based on the climate of your location and your personal preferences, then save it.
  2. Run python meteogram.py
  3. View the meteogram, which will be saved as output.png.

Setting the Desktop Wallpaper

The included setwp.sh script can be used to regenerate the meteogram image, and set it as the desktop wallpaper using pcmanfm, the Raspberry Pi OS default desktop renderer. You can run this manually (after making it executable with chmod +x setwp.sh), or add it as a cron job.

Plotly vs Matplotlib

Up to version 1.0 of this code, the Plotly library was used to draw the chart and all the features on it. Unfortunately Plotly has a limitation when it comes to my use case of running on an original Raspberry Pi Model B, which is that its Kaleido dependency does not have builds for its armv6l architecture. I therefore rewrote the script using Matplotlib, which is easier to get working on the old device.

Thanks / Licence Information

My own original code created for this project is licenced under "The Unlicence" as described in the LICENCE file.

The repository also contains weather icons inside the icons folder which are from the Adwaita icon set and subject to its licence terms (LGPL/CC BY-SA 3), used with many thanks.