How to never miss a video call with Raspberry Pi and NextEvent

Since lockdown started, I’ve found I often miss video meetings. It’s not intentional, I simply lose track of time. Though my phone is set to remind me of upcoming meetings ten minutes before they begin, I have a habit of trying to fill that time with something productive and before I know it, I have Eben on the phone, fifteen minutes after the meeting’s start, asking where I am.

Fixing the issue using code

Due to this, and because I was interested in playing with the Google API and learning a little more Python, I decided to write a simple application that will get your upcoming events from your Google Calendar and give you notifications as often as you want, visually on screen as well as through sound.

I call it NextEvent

Here’s the video tutorial to show you more:

And here’s the written tutorial too!

Installing NextEvent to your Raspberry Pi

To install NextEvent, open a terminal window (Ctrl-Alt-T) on Raspberry Pi and type:

sudo apt update
sudo apt upgrade
git clone https://github.com/ghollingworth/nextevent

This will get the files from my GitHub repository. Next you’ll need to install some dependencies, and I’ve created a script to make that easy:

cd nextevent
./install.sh

The dependencies are dateutil (a library for manipulating time and dates), the Google API client libraries, and the gi-cairo library (which is for drawing the GUI).

Then fire up NextEvent:

python3 nextevent.py

The next thing you’ll see is NextEvent starting up, and then it’ll open Chromium. It is here that you will give Google permission to share your calendar with the application.

You’ll then need to log into your Google account and give NextEvent access to your calendar. Chromium will tell you when everything is fine and you can close the browser.

Now you can see your next five events along with the time left until each one. When the time gets down to five minutes, the application will turn red and ‘ding’ at you. It’ll ‘ding’ twice at one minute to go, and four times when your meeting is about to start!

In case you want to delve into the code, maybe to create a meeting room ‘now and next’ display, the nextevent.py source contains the GUI and event processing part of NextEvent. You should be able to go here and change the number of lines, the colours, and the notification sounds.

How does it work?

If you’re the sort that likes to know HOW the code works, here’s a follow-up to the tutorial video where I explain exactly that!

8 comments
Jump to the comment form

Avatar

Amazing! And even more amazingly, I made something very similar a couple of months ago. In my case we are 5 people at home and it was difficult to track everybody’s activities (classes, work meetings, on-line karate, on-line choir rehearsal… you get the idea) specially in the early days of lockdown. So I got a spare AIY kit I had and made a little Python program very similar to yours. It checks the events in all of our calendars and when an event is in 15 minutes or in 5 minutes, it reads outloud (using a TTS package) something like “Attention nnn, you have yyy in 15 minutes”. The AIY box is placed in a central part of the house with enough volume level so you can listen the announcements no matter where you are. It has a very simple GUI made with Tkinter because the idea was to give it a display, but it runs headless for now.

The first version was a very quick and dirty one, and I had the intention of improving it. But it’s been working flawlessly for a couple of months, so v2 got indefinitely postponed… Now I have to check you code to see what ideas I can use to inspire my version 2!

Reply to Carlos Luna

Avatar

Hi Carlos, a good idea you have there. Would you please share the code on GitHub?

Reply to Khakhathi

Avatar

I’ll try to do it this weekend. Will have to tidy up the code a little bit!

Reply to Carlos Luna

Avatar

I missed a video meeting today because it was a nice morning and I decided to sit outside. I quickly fell asleep

Reply to Anders

Ashley Whittaker

? “Sorry I’m late, I didn’t want to come”

Reply to Ashley Whittaker

Avatar

Sleep and cowsay is no good anymore?

Reply to Harry Hardjono

Avatar

So… I guess y’all haven’t heard of Google reminders, or even the calendar app?

Reply to Jim

Avatar

I have just tried this out and I’m really impressed.

Reply to Khakhathi

Leave a Comment