Rotary Phone Home Control

In our house old rotary phones are used as a remote for Sonos, Philips Hue and to ring the door bell. Turning the dial on one of the phones starts playing an MP3 on the phone. Turning the dial of the phone in another room dims the light, or turns it on or off.

We use an old Ericofoon, a red and green Dutch T65:

I connected the 2 pins of the phones to an ESP8226 (nodemcu). You can buy them for cheap on Chinese webshops.

The C code below is counting pulses. I used platformio to compile the ESP8226 code and upload it. The ESP8226 requests a Raspberry Pi to evaluate an URL. The Python code for the Raspberry Pi will be subject of another post.

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!