A Delta Chat bot to open your home's doors via chat.
Find a file
2026-04-23 15:05:41 +02:00
.gitignore get unlock.sh to work on the raspi 2026-03-01 19:04:28 +01:00
bot.py more verbose help message 2026-04-23 15:05:41 +02:00
deploy.py delta.disobey.net is down 2026-03-01 19:04:28 +01:00
doorbot.service start doorbot on reboot 2026-03-01 19:04:28 +01:00
README.md link to pass 2026-03-01 19:27:06 +01:00
setup-venv.sh get unlock.sh to work on the raspi 2026-03-01 19:04:28 +01:00
unlock.sh.j2 get unlock.sh to work on the raspi 2026-03-01 19:04:28 +01:00

Door Bot

This repository helps you setup a Delta Chat bot to open your doors via chat.

The bot will be running on a Raspberry Pi. To open your downstairs door, it needs to be connected to your doorbuzzer. To open your upstairs door, it needs to talk via bluetooth to an Eqiva mechanical lock.

Material

Mounting the Eqiva Mechanical Lock to the upstairs door

Following the instructions, mount the mechanical lock to your door.

Warning: From the inside, it needs a key to be permanently in the lock, so make sure you have a lock which can still be opened from the outside if there is already a key on the inside, or you can only enter your door through the mechanical lock. Otherwise you need to buy a lock.

Feel free to test the unlocker with the official app; with the bot you will not need it anymore, though.

Flash the Raspberry Pi

sudo apt install rpi-imager
rpi-imager

Select your Device, OS, and Storage. In my case:

  • Device: Raspberry Pi Zero
  • Operating System: Raspberry Pi OS (32-bit)
  • Storage: /dev/mm.... (whatever the raspi's SD card is called on your system)

Then click "Next", and "Edit Settings":

  • Set Wifi SSID + Password to your local WIFI network
  • Enable Key-based SSH authentication to "user" with an ed25519 key
  • Hostname: r8.local

Add to your /home/user/.ssh/config:

Host r8
    Hostname 192.168.0.12  # adjust the local IP
    User user
    IdentityFile /home/user/.ssh/id_ed25519

Store the keyblepy secrets in pass

In order to enter pairing mode, press and hold the "Unlock" button on the Eqiva until the yellow light flashes. Then register the user:

cd keyble
./keyble.py --register --qrdata <qr_data> --user-name doorbot --user-key <user_key> --verbose

This is how you get the variables (you should store them in pass):

  • pass edit r8/keyblepy/qr_data: scan the QR code on the key card with Delta Chat, use the text
  • pass edit r8/keyblepy/user_key: generate a 32-character hexadecimal string
  • pass edit r8/keyblepy/user_id: 0 if the raspi is your only device, 1 if you have an additional app configured.
  • pass edit r8/keyblepy/device_address: the Eqiva's Bluetooth MAC address, best you scan for it with the laptop. The device is called KEY-BLE.

Setup pyinfra and deploy the bot on the Raspberry Pi

python3 -m venv venv
. venv/bin/activate
pip install pyinfra
pyinfra r8 deploy.py
ssh r8
sudo systemctl stop doorbot
. .local/lib/eqiva.venv/bin/activate
python3 bot.py admin
sudo systemctl start doorbot

The python3 bot.py admin command prints the invite link; join the group with your Delta profile.

Write /open2 to the chat, to test whether the upstairs door unlocks.

Connect door buzzer of downstairs door

Now write /open to the chat to test whether the downstairs door unlocks.