You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tanner Collin a0e0651703 Logging, timeout 2 years ago
.gitignore Initial commit 3 years ago
LICENSE Add license 3 years ago Fix update bugs 2 years ago Logging, timeout 2 years ago
requirements.txt Implement our own unifi websocket connection 2 years ago Fix update bugs 2 years ago Implement our own unifi websocket connection 2 years ago

Doorbell Ding Dong Ring Ring Doorbell

A doorbell chime controller for my house. Runs on a Raspberry Pi and talks to wifi Unifi G4 Doorbells.



Set up user account, add user to sudo, adm, gpio groups.

Set up wifi:

$ sudo raspi-config
- System Options -> Wireless LAN -> Canada
- Enter wifi credentials
- Reboot

If wifi doesn't work, you're on your own.

For the watchdog to work, we need write access to /dev/watchdog/.

Configure /etc/udev/rules.d/60-watchdog.rules:

KERNEL=="watchdog", MODE="0666"

Change the hostname:

$ sudoedit /etc/hostname
$ sudoedit /etc/hosts


Install dependencies:

$ sudo apt update
$ sudo apt install python3 python3-pip python-virtualenv python3-virtualenv supervisor python3-rpi.gpio

Make sure you have at least Python 3.9 installed.

Clone this repo:

$ cd
$ git clone
$ cd doorbelldingdongringringdoorbell/
$ virtualenv --system-site-packages -p python3 env
$ source env/bin/activate
(env) $ pip install -r requirements.txt

Edit settings for your setup:

$ cp
$ vim

Now you can run the script to test:

$ source env/bin/activate
(env) $ DEBUG=true python  # no watchdog
(env) $ python             # uses watchdog

The watchdog will activate if a doorbell is pressed. It will reboot the Pi if the script stops.

Process management

The script is kept alive with supervisor.

Configure /etc/supervisor/conf.d/doorbell.conf:

command=/home/tanner/doorbelldingdongringringdoorbell/env/bin/python -u

Then run:

$ sudo supervisorctl reread; sudo supervisorctl reload

Script logs to /var/log/doorbell.log. Remove -u from the above command when you're done testing to save SD card writes.


This program is free and open-source software licensed under the MIT License. Please see the LICENSE file for details.

That means you have the right to study, change, and distribute the software and source code to anyone and for any purpose. You deserve these rights.