Skip to content
Just a clock, home weather station and air quality monitoring tool based on Raspberry Pi.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Just clock, home weather station and air quality monitoring tool based on Raspberry Pi.


Web forms

web_form web_form_stats web_form_systyemd pygal_graph


A "solution" consists of several modules:


This is the core module which poles several plugged sensors (temperature, humidity, pressure, air quality) and grab data from Web ( for weather forecast. Script caches the data in memory using memcache. Runs via systemd service.


This module works with simple 7-segment display. In a few words, it gets data from memcache and represent it for end-users (me and my family;). It also runs using systemd service.


Just clears display by sending four whitespaces ( ) to display. Executes via ExecStopPost= directive when piclock_display stops by systemd.


Every hour data is serialized to sqlite database for further retrospective analisys. Script executes via crond. The DB schema is very simple.

CREATE TABLE weather (date text not NULL primary key,
                      inside_temp text,
                      humidity text,
                      pressure text,
                      outside_temp text,
                      co2 text,
                      tvoc text);

- piclock_web(_modules).py

Very simple web frontend (flask) for graphing (pygal). Basically, the SQL query is constructed based on user input. Data from database is used for building a graph. We have a quick link for today's graph as well as an ability to set custom timerange. Moreover, there is a hidden function to controll systemd services via web frontend by stating the service name and state in URL like http://pi.pc.hi/display.down or http://pi.pc.hi/poller.up.

That's it!

Directory structure

├──                # Clears display    
├──                   # Periodic serialization data to DB               
├──              # Display data using 7-segment display
├──               # Sensors polling
├──          # Functions for gathering data from DB and graphing
├──                  # Web Flask fronted
├──                       # You are reading this
├── static                          # Static content
│   ├── apple-touch-icon.png            # favicon for apple
│   └── favicon.ico                     # favicon for "normal" devices...
├── systemd_services                # Here are some systemd service files stored
│   ├── piclock_display.service         # for display
│   ├── piclock_poller.service          # for poller
│   └── piclock_web.service             # for web frontend
├── temp-data.db                    # sqlite3 database
└── templates                       # Simple template for web page rendering
    └── index.html                      # index.html )


You can’t perform that action at this time.