Git Product home page Git Product logo

home-meteogram-display's Introduction

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 Github, 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.