Binary clock with weather API integration designed for Pimoroni's UnicornHat HD
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2021-07-14 16:29:56 +02:00
.gitlab/issue_templates chore: Add GitLab issue templates 2021-07-14 16:29:56 +02:00
README.md Update README.md 2021-06-25 10:47:14 +00:00
unicornhathd.service Update unicornhathd.service 2020-08-26 23:00:27 +02:00
unicornhathd.timer Create unicornhathd.timer 2020-08-26 22:51:27 +02:00
weatherclock.py Update weatherclock.py 2018-03-02 20:53:50 +01:00

UnicornHat HD Weather Clock

[[TOC]]

Binary clock with weather API integration designed for Pimoroni's UnicornHat HD.

Displays hours, minutes and seconds in binary format, as well as providing weather status (rainy, cloudy, sunny, etc), humidity and temperature.

Humidity is shown on the top bar in units of 10%; temperature is shown on the bottom bar in units of 5degC.

Dependencies

Requires pytz, pyowm and unicornhathd

Usage

In order for the weather API to function properly you'll need to sign up and get an API key from openweathermap.org and insert it on line 11 of weatherclock.py. Next, enter your location on line 12.

If you want to use a different timezone, enter that on line 16.

Run after boot

If you want to run the clock right after booting up your Pi, copy unicornhathd.timer && unicornhathd.service to /etc/systemd/system followed by sudo systemctl enable unicornhathd.timer

Note that the service expects the file to be in /home/pi/Downloads/weatherclock/

Automate the whole thing because we're lazy

#!/bin/bash
#Downloads the clock and enables run after boot

cd ~/Downloads && git clone https://github.com/Griefed/UnicornHatHD-Weather-Clock.git ./weatherclock
sudo cp ~/Downloads/weatherclock/unicornhathd.timer /etc/systemd/system/ && sudo cp ~/Downloads/weatherclock/unicornhathd.service /etc/systemd/system/
sudo systemctl enable unicornhathd.timer
print("To test, run: sudo reboot")