d-bieber / pi_statusdisplay

Small Python status script, which displays informations on a 2.7" OLED
MIT License
8 stars 2 forks source link

pi_statusdisplay

Small Python status script, which displays information on a 2.7" OLED.

Getting Started

These instruction will help you to run my pi_statusdisplay script. It shows a clock, the weather for two cities, storm warnings (for Germany), PiHole status, a public transport timetable (for German stations) and information about your Pi like temperature or IP-address.

Important: This script is built for my SSD1325 OLED. Thanks to luma.oled it may work out-of-the-box on other displays, but don't expect too much. I'm working on making it more customizable and working on different screens but at the moment you probably have to tweak a few things in the code, to make it do what you want to.

Prerequisites

Installing

  1. Clone this repository on your Pi
  2. Download the fonts from luma.examples and put them in a folder named fonts
  3. Download the FontAwesome - Solid as fa-solid.ttf and also put it into the fonts folder.

Configuring

OUTDATED - Changes only in config.ini necessary.

There are several things that can (and have to) be customized.

Weather

####CONFIG####

#Weather API
CITY1='#######' #City1-ID
CITY2='#######' #City2-ID
API_KEY='YOURKEY'#OpenWeatherMap API-Key

#Storm API
LOCATION_ID = '#######'#Location id from dwd.de for storm warnings

##############


        #Wetter CITY1
        name1 = oled.center("CITY1")#CHANGE ME
        [...]
        #Wetter CITY2
        name2 = oled.center("CITY2")#CHANGE ME

Change the two city names in main.py inside of the weather function.

For information regarding the city-IDs and the query parameters, see the OpenWeatherMap-API Documentation.

PiHole

ip = 'CHANGE ME' #PiHole IP

Change the IP-address from your PiHole in pihole.py.

Timetable

This only works for German stations!

    ####CONFIG####

    STATION='Koeln Hbf'

    ##############

Change the station name in timetable.py to your liking.

haltestelle = "Köln Hbf"

Change it in main.py inside of the timetable function aswell.

Running

To run simply start the main.py with Python3 and the configuration for your display.
For example an ssd1325 display:

python3 main.py -f path/to/your/ssd1325.conf

For new weather data, the getWeather.py has to be run. For automatic weather updates, create a cronjob which runs the script periodically. Just be careful you don't hit the quota for the OpenWeatherMap-API.

Author

License

This project is licensed under the MIT License - see the LICENSE file for details

Thanks to