Displays the current weather conditions on a Pimoroni Unicorn HAT or Unicorn HAT HD.
These instructions assume a fresh installation of Raspberry Pi OS Trixie.
sudo apt update
sudo apt full-upgrade
sudo apt install build-essential git libgif-dev scons python3-full python3-venv python3-pip libopenjp2-7 libjpeg-dev
cd ~
git clone --recursive https://github.com/SeanCline/UnicornHatWeather.git
cd UnicornHatWeather/Gif2UnicornHat
make dependencies && make
cd ..
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip setuptools wheel
.venv/bin/python -m pip install -r requirements.txt
This is the recommended weather collector.
- Sign up for OpenWeatherMap and retrieve your API key from here.
- Open
config.pyand replaceYOUR_OPENWEATHERMAP_API_KEYwith your API key. - Set your city by either updating the zip code or by using one of the other formats for defining your city.
Optionally, if you have a WeatherFlow Tempest station, more accurate and up-to-date temperature values can be displayed by enabling the tempest_udp_* parameters in config.py
The Tempest UDP API is local-only, so while its temperature data is very good, the weather condition icon does not use the more advanced weather models that cloud APIs like OpenWeatherMap or WeatherFlow Tempest's cloud can use. Even with the Tempest UDP API enabled, it's recommended to also configure OpenWeatherMap or the Tempest Cloud API for more accurate current conditions icons.
If you have a WeatherFlow station, you can
- Generate a WeatherFlow Token from here.
- Open
config.pyand replaceYOUR_TEMPESTWX_API_KEYwith your API key. - Configure the rest of the
tempest_cloud_*configuration settings.
sudo ./UnicornHatWeather.py
In order to start the weather display whenever the Raspberry Pi is booted, run the following:
sudo cp gif.service /etc/systemd/system/gif.service
sudo systemctl daemon-reload
sudo systemctl enable gif.service

