Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time
August 4, 2018 20:08
August 4, 2018 20:08
August 4, 2018 20:08
August 4, 2018 20:08
August 15, 2018 15:57
February 22, 2018 17:44
August 6, 2018 14:20
August 4, 2018 19:12
August 4, 2018 19:12
August 4, 2018 19:12
August 4, 2018 20:08
August 4, 2018 19:12
August 4, 2018 20:08
August 4, 2018 19:12
August 4, 2018 19:12

OpenDoor a Raspberry Pi Application to open doors in an apartment building

For some people it is simply convinient to open the apartment door via a web application. Some reasons may be: Lots of visitors to a certain time (let them all in if needed), being handicapped (no need to go to the door to open it) or simply being lazy :-).


The best use case for OpenDoor exists of a front door that is controlled by a intercom system (in my case a Siedle HTA 811-0W) and the door to the apartment. OpenDoor is able to open both doors through a Raspi Zero that is connected to the Siedle. An electromechanical door opener controls the apartment door and does the Voodoo (Hörmann PortaMatic).

How does it work?

Most likely you have a different hardware setup. To make OpenDoor to work with it, you must provide 3 functions:

  1. On one of the Raspi GPIO inputs you must detect doorbell ringing
  2. One GPIO output controls the relais for the front door (release buzzer for 5 sec)
  3. The other GPIO output controls the relais for the apatment door (parallel to the door opener switch)

Features of OpenDoor

  1. Open front or apartment door through a Web Interface
  2. HTTPS-WebServer with basic Authentication for the Web Interface
  3. User dependent authorizations for API usage
  4. Weekly time based open actions when someone rings the bell
  5. Web notifications when the door bell rings
  6. Logging ringing and who opened which door at a time
  7. English and German language support
  8. Mobile ready

Technology used

  • Nginx Web server as a reverse proxy for the used Thin application server
  • A Sinatra app using Ruby and Thin with Web-Sockets for notifications
  • Haml, Bootstrap 3 and Javascript for the Web-Front-End
  • SQLite3 for persistent data storage
  • A Python-GPIO program using Unix IPC (pipes) to communicate with the Thin application server

Installing OpenDoor on a Raspberry Pi Zero (Raspbian Stretch Lite - 2018-06-27)

Programm your SD-Card (Etcher) and setup a headless configuration so you can use ssh over WLan. Get an internet connection and

Update your Raspbian with

sudo apt-get update
sudo apt-get upgrade

Install Git with

sudo apt-get install git

Checkout OpenDoor directly into /home/pi and create the directory below

mkdir ~/.opendoord
sudo chmod -R 775 ~/.opendoord

Next install a recent Ruby 2.5.1 (.rbenv) with

~/ # (not sudo)

This takes about 2h on a raspi zero! Next we need more Raspbian and Python3 packages

sudo apt-get install python3-pip python3-dev monit libsqlite3-dev
sudo pip3 install setproctitle docopt pytz

Change directory to ~/etc and execute the following script to add monit, startup-skripts, SSL-Certs etc.


Install the used Gems (Thin, Sinatra, SQLite and more)

The Ruby app makes usage of several Gems which need to be installed. Execute the following commands:

cd ~/app
gem install bundler
bundle install

Define your Basic Auth password

The default login/password is: admin / baseball. However you want to change the password by

vi ~/app/.env

add line and replace passwd and use your own



Add two entries to the crontab for the user pi:

crontab -e


@reboot sudo /home/pi/

IMPORTANT: Do not forget to change the default pi password.

Additional remarks

WLan gets bored and falls asleep

I am using a Raspi-Zero (1st Generatiom) without build-in WLan. Instead, I connected an Edimax WLan-Adapter (Chipset: Realtek) to the Mico-USB. I noticed after several hours of idleing that the WLan turned it self off and got unresponsive for up-to 30 secs (not great if you want to open the door immediately while you have someone waiting).

Turning off WLan Power saving mode

First check if you have a similar WLan adapter in use:


if you see a module named "8192cu" you might turn off the power saving mode, but first check if power saving is on.

iw wlan0 get power_save

If it says "Power save: on" then turn it off

sudo vi /etc/modprobe.d/8192cu.conf

by adding the following line

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

afterwards execute a reboot

sudo reboot

and check again with

iw wlan0 get power_save

It should be off now.