It’s a new year, and it’s time for a new project! Over the course of 2019 I’ll be building a Raspberry Pi Home Hub to display useful information like news, budget updates, energy usage, and more on a screen small enough to sit in the corner of my desk.
I warned you it was coming back in my roundup of all the geeky things I did in 2018. I was determined that 2019 would be the year I finally designed, built, and finished a Raspberry Pi project, and over the Christmas break I was hit with some inspiration for exactly what that could be.
As we covered last week, the first step in any project is to gather the product’s requirements. What should it be able to do? What should it look like? The purpose of this blog post is to do just that. So without further adieu, allow me to introduce you to the Raspberry Pi Home Hub.
The Raspberry Pi Home Hub will be a small device consisting of a screen and a Raspberry Pi. Designed to sit on a desk or table, the Home Hub will pull information from the internet via various APIs and display it on a series of user-friendly screens, which will automatically rotate.
The purpose of the project is to make useful information accessible via one view on one device – not multiple taps and apps. The information will include, news, weather, London Underground status updates, calendar and email information, and finance and energy usage trackers.
The following hardware will be required to build the Raspberry Pi Home Hub:
- Raspberry Pi (version to be decided based on processor/RAM requirements)
- 16GB SD card
- Raspberry Pi, case, mains charger, and WiFi adapter (if required)
- Five-inch screen compatible with the case
I currently have an original Raspberry Pi B, which I will initially use to attempt to run the Home Hub software. If this proves unsuccessful due to processor or memory limitations, I may be required to upgrade to a newer Raspberry Pi model, which may have onboard WiFi.
The Raspberry Pi Home Hub must be WiFi-connected and internet-connected in order to fetch data from the various APIs used. It should be accessible via SSH over WiFi from my main computer for administrative purposes and able to access the internet on ports 80 and 443.
When setting up the Home Hub I will make use of the built-in Linux iptables firewall to ensure that connections to and from other IP addresses or on other ports are dropped.
The Raspberry Pi Home Hub will run new software written in Python. The software will consist of several modules, each of which will query one or more APIs to gather data, populate an HTML template sized for the screen, and display it in the web browser before triggering the next module.
The screens developed for the Raspberry Pi Home Hub v1 will be:
- News – latest UK news headlines via a BBC News RSS feed, today and tomorrow’s weather for London via the Met Office, and Tube line status via Transport for London’s API
- Calendar – upcoming appointments via the Google Calendar API
- Email – inbox summary via the Gmail API
- Financial – banking and budgeting summary via the Monzo API
- Energy – estimates for upcoming bills using data held in Google Sheets
- Sports – last and next Chelsea matches and Formula 1 races (sources to be confirmed)
As well as displaying these screens on rotation, the Home Hub will automatically send a briefing email at around 6:30am every day containing information that would be useful to review each morning.
To make all of this possible, several other small changes will need to be made to the configuration of either Linux or the Firefox web browser on the Raspberry Pi.
The Home Hub software should automatically start when the device is turned on and it should automatically rotate between screens. The cursor should be hidden and Firefox should automatically open the pages in full screen and in the same tab. The Home Hub should also dim its screen in the mornings and evenings (and perhaps even turn it off at night) so it doesn’t light up a dark room.
There will also be a couple of rules as to how all of this functionality will be achieved:
- Initial setup (i.e. the additional features described above) must as far as possible be implemented via a setup script to be run when the Home Hub is first installed
- All configuration (accounts, colours, variables like locations, Tube lines, sports teams, etc.) must be handled via a config.ini file so they can be edited without alterations to the Python scripts
The development of the Raspberry Pi Home Hub will be a regular feature on my blog in 2019, with monthly update posts like those for my Windows forensics gatherer.
To ensure we have something to test and to work with once the hardware arrives, the first post next month will take a look at how to build the news screen, querying BBC News, the Met Office, and Transport for London for information. I’ll see you there!