Vintage Phone Home Control Center

An old phone, a raspberry pi, a handful of resistors and a simple python script make a very nice home control center.
The phone is a T65 TDK. It was very popular in the Netherlands in the 70’s and 80’s. It comes in a few colors, but preferably orange.

The phone now controls our Sonos audio system and our Philips Hue lights. The little black button rings the front door bell, great gimmick for the kids.

Button functions:

  • 1: a radio station
  • 2: volume up
  • 3: another radio station
  • 4: previous song
  • 5: play / pause
  • 6: next song
  • 7: a playlist
  • 8: volume down
  • 9: another playlist
  • *: Philips Hue off
  • 0: Philips Hue dimmed
  • #: Philips Hue bright

And the Python script

The script calls an URL on the home server: another raspberry pi which controls all connected devices. A description of this home server will be the subject for a future picnic.

Control Sonos with Python using SoCo 0.9

I made a python wrapper function around SoCo 0.9 because the documentation of SoCo is very limited. I hope it helps 🙂

iot is a homebrew logger

Python sunset timer for Philips Hue

The Philips Hue has a nice API. It took me a few picnics to figure out how it works. So for your convenience I give you a few snippets of Python code.

First you have to figure out what your username is:

With this username you can check lights or turn them on and off:

And now a wrapper function:

The iot class is a homebrew event logger:

You can use crontab to set timers. But why not make it yourself 🙂

You have to put all timers in timers.txt
Yes, I know, it looks a lot like crontab. This one is not better, but I made it myself 🙂

And you need to know when the sun rises and sets. I didn’t write this class myself but I also forgot where I found it. Credits to the anonymous maker!

Convert gedcom to html with bootstrap, d3 and jquery using python

What did the life of my grandfather look like? Did he have siblings? Who were his parents? I had many question and on one of these Sunday afternoon I decided to go for it. I tried some genealogy websites and offline programs and selected Gramps. I found my grandfather into some of those websites that have digitized family records and started filling my database with ancestors, aunts, great aunts. I found that my grandfather had a small brother who died at the age of 3 and that his mother died of Spanish flu.

And then the moment came to share the result with my family, the ones that are still alive. I tried a few html generators but they all looked fairly old fashioned. Therefore I wrote one myself: gedcom2html. Gedcom is a (or the) standard for genealogy files. Gedcom2html uses d3 sunbursts for an ancestor and descendant fan chart. It uses d3 force simulation for a graph of all individuals in the gedcom file.

An example says more than words. So have a look at the family tree of the Dutch Royal Family  You can convert a gedcom file to html yourself using my script on github: gedcom2html

Unfortunately the solution doesn’t scale. It works excellent for a gedcom file with a few hundred individuals. But with a larger gedcom file (>2000) the html files explode to 500 kB each. The script should be improved by moving functionality from the server (python) to the client (javascript). All data should be in a single json file and be read by the JS script. To be fixed during a future picnic.