2025
2024
2021
2019
2008
The Ring Doorbell Recorder is an open-source application I developed to capture and manage events from Ring Doorbell and camera devices. It automatically records and organizes doorbell events with a focus on reliable data capture and video storage.
As most projects go it's about scratching one's own itch. I wanted more control over how my Ring doorbell data was stored and accessed. The official Ring app provides cloud storage, but for a literal $price. I wanted a solution that would give me agency over my doorbell data.
One of the most interesting learnings came from implementing the WebRTC connection to Ring's cameras. WebRTC (Web Real-Time Communication) is typically used for browser-based video conferencing, but here I had to implement it in Python to connect directly to Ring's proprietary API.
The WebRTC connection flow involves several complex steps:
Authentication and Preparation
WebRTC Offer Generation
Signaling via WebSocket
Session Maintenance
I'd never thought I'd work on a real-world WebRTC project. Interesting learnings include:
Ring uses a specific message format for its WebRTC signaling - and its fucking picky about everything. If you don't format thing just right, it will not work.:
json{ "method": "live_view", "dialog_id": "uuid-v4-string", "riid": "random-hex-string", "body": { "doorbot_id": 123456789, "sdp": "v=0...", "stream_options": { "audio_enabled": false, "video_enabled": true, "ptz_enabled": false } } }
Correctly implementing this format was crucial for successful connections.
TIL what STUN was. To establish peer-to-peer connections through firewalls and NAT devices, the implementation uses Google's public STUN servers:
I still haven't fully dove into ICE (Interactive Connectivity Establishment) and how it works, but I know it involves gathering candidates and establishing a connection between peers.
The system includes connection monitoring:
The application follows a clean, modular architecture with well-defined components:
Component | Responsibility |
---|---|
App Manager | Bootstraps the system, coordinates components |
Auth Manager | Handles device authentication lifecycle |
Event Listener | Subscribes to API events, dispatches to capture |
Capture Engine | Processes events, handles storage |
LiveView Client | Establishes WebRTC connections to Ring devices |
Storage | Interface for database and file storage |
Honestly, the project will evolve as I need it to. Possible things could be....
This project builds upon and was inspired by several excellent open-source libraries:
The code is available on GitHub under the MIT License. Contributions and feedback are always welcome!