whatisgithub

What is protect-sonos-doorbell?

eddwills95/protect-sonos-doorbell — explained in plain English

Analysis updated 2026-07-25

1PythonAudience · generalComplexity · 4/5Setup · hard

In one sentence

Turns a Raspberry Pi into a smart doorbell that plays a chime on Sonos speakers when someone rings a UniFi Protect video doorbell, and can unlock a gate via a physical button.

Mindmap

mindmap
  root((repo))
    What it does
      Plays chime on Sonos
      Unlocks gate
      Web control panel
    Tech stack
      Python
      Raspberry Pi
      UniFi Protect
      Sonos speakers
    Use cases
      Smart doorbell chimes
      Remote gate opener
      Quiet hours scheduling
    Setup
      Needs Pi Zero
      UniFi Protect console
      Wired push button
    Audience
      Smart home tinkerers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Play a doorbell chime through Sonos speakers when a UniFi Protect doorbell is rung.

USE CASE 2

Unlock a gate using a physical button wired to a Raspberry Pi.

USE CASE 3

Control chime settings, quiet hours, and speaker selection from a local web page.

USE CASE 4

Open a gate remotely from a browser on your local network.

What is it built with?

PythonRaspberry PiUniFi ProtectSonos

How does it compare?

eddwills95/protect-sonos-doorbell0xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultyhardhardhard
Complexity4/54/54/5
Audiencegeneraldeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a Raspberry Pi with wired GPIO button, a UniFi Protect console with Alarm Manager, and Sonos speakers on the same network.

The explanation does not mention a license for this project.

So what is it?

This project turns a Raspberry Pi Zero into a smart doorbell and gate opener that connects two separate home systems: UniFi Protect (a security camera and doorbell platform) and Sonos wireless speakers. The setup does two main things. First, a physical push button wired to the Raspberry Pi can unlock a gate. When pressed, the Pi sends a signal to UniFi Protect's automation system, which triggers the gate lock. Second, when someone rings a UniFi Protect video doorbell, that event triggers a notification to the Pi, which then pauses any music playing on your Sonos speakers, plays a doorbell chime sound, and restores the music exactly where it left off, at the same volume and playback position. A small web interface lets you control the system from a browser on your local network. You can pick which Sonos speakers should play the chime, adjust the volume and number of repeats, set quiet hours when the chime stays silent, and upload a custom chime sound. There is also a button to open the gate remotely. A live log page shows what the service is doing in real time. The setup requires a UniFi Protect console with its Alarm Manager feature configured, at least one Sonos speaker on the same network, and a momentary push button wired to the Pi's GPIO pins. The code communicates with Sonos speakers directly using their built-in network protocol, avoiding external libraries that are slow or difficult to install on the Pi Zero's limited hardware. Configuration is done through a simple environment file where you specify the webhook URLs, API keys, speaker IP addresses, and chime settings. The project runs as two background services on the Pi: one watches the physical button, the other handles the web server that receives doorbell notifications and serves the settings page. One practical note from the documentation: if the settings page or doorbell feels slow or stuck, a configured Sonos speaker is probably offline, and the system has to wait for the connection to time out before continuing.

Copy-paste prompts

Prompt 1
Help me wire a momentary push button to my Raspberry Pi Zero GPIO pins to trigger a UniFi Protect webhook for opening a gate.
Prompt 2
Write a Python script that listens for a webhook from UniFi Protect, pauses a Sonos speaker, plays a chime file, and resumes the original track.
Prompt 3
Create a simple Flask web interface for a Raspberry Pi doorbell project where I can pick Sonos speakers, set quiet hours, and upload a custom chime sound.
Prompt 4
How do I configure UniFi Protect Alarm Manager to send a webhook to my Raspberry Pi when the doorbell rings?

Frequently asked questions

What is protect-sonos-doorbell?

Turns a Raspberry Pi into a smart doorbell that plays a chime on Sonos speakers when someone rings a UniFi Protect video doorbell, and can unlock a gate via a physical button.

What language is protect-sonos-doorbell written in?

Mainly Python. The stack also includes Python, Raspberry Pi, UniFi Protect.

What license does protect-sonos-doorbell use?

The explanation does not mention a license for this project.

How hard is protect-sonos-doorbell to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is protect-sonos-doorbell for?

Mainly general.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.