A program to display weather and other useless information you could get by looking at the window
Software:
- Python3
- Waveshare e-paper lib
Additional and optional infrastructure:
- InfluxDB
- Grafana
Hardware (you are not required to use the exact same one, but you'll need to adapt the program):
- Raspberry Pi 3A+ (I had some lying around)
- Waveshare 2.13inch e-paper
- DHT22 sensor, for humidity and temperature
Minimal hardware requirements:
- Microcontroller with:
- GPIO
- Ability to connect to Internet
- Whatever e-paper screen (may require some adaptations)
- Display current weather (temperature, humidity, rain)
- Display 24hours forecast
- Display sunrise and sunset time
- Display temperature and humidity from sensor (optional)
- Log data into InfluxDB (optional)
Optionally, install an InfluxDB (1.8 for 32bits RaspberryPi).
You will need to create a Database (no credential used here).
Optionally, install Grafana.
Follow this guide from Installation part.
Add a Datasource, select InfluxDB and put http://localhost:8086
.
Go to OpenWeather, create an account and create a key for the Professional Collection Free Tier. This tier does not require a credit card.
Download the lib
folder
from waveshare repository,
and put it at the root of the project
Copy the file config.example.yaml
and name the new file config.yaml
. Inside, you will need to configure the
following elements:
API_KEY
: The OpenWeather key you created just before. This your personal key, it won't leave you deviceunit
:metric
orimperial
coordinates
: Coordinates of the place you want to track the weather of. Use this website for help: LatLong.netrefresh_period_min
: How often to refresh the data or the screen in minutes (data
being lower thanscreen
will have no effect)city
: Name of the location of the place you are tracking the weather of. OpenWeather API does not always give a relevant city namemetrics
: If you wish to monitor data. Setrecord_metrics
tofalse
ortrue
. Setdatabase_url
anddatabase_name
to the one setup during InfluxDB installation.
Run pip install -Ur requirements.txt
, sudo apt-get install libgpiod2
Copy the file systemd/epaper-weather.example.service
and name the new file systemd/epaper-weather.service
. Inside, you will need to configure the
following elements:
User
: Put your own userPATH_TO_PROJECT
: Path of your project location
sudo cp systemd/epaper-weather.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable epaper-weather
sudo systemctl start epaper-weather
Some projects that helped me overcome some issues:
- inkyWeather: a similar project with Inky pHAT. I borrowed some graphical parts to speed up the development process
- E-paper Weather Display: a similar project with a bigger screen