Inspiration: The Silence Problem
Smart home cameras are fundamentally built for motion: they alert you when an event occurs—a delivery arriving, a car pulling into the driveway, or a stranger at the door.
In elderly care, however, the most critical danger is not activity—it is silence. If an aging parent living alone typically wakes up and walks into the kitchen between 7:00 and 9:00 AM, and one morning there is only complete stillness, that absence of movement is the single most urgent signal of the day.
Existing solutions either require intrusive wearable pendants that seniors forget to charge, or continuous cloud video streaming that invades privacy and costs exorbitant subscription fees. We built Threshold to invert the paradigm: "Ring tells you when something happens. Threshold tells you when something doesn't."
What It Does
Threshold is an automated, pattern-absence monitoring system that turns standard Ring cameras into privacy-first routine monitors with zero external cloud intermediaries:
- Deterministic Absence Detection: Caregivers configure daily activity windows (e.g., Morning Movement 07:00–09:00 with a 30-minute grace buffer). If expected motion is verified, the routine is silently satisfied (
OBSERVED). If the window closes in silence, Threshold edge-triggers an immediate escalation (MISSED). - "Unknown Not Alarm" Safety: A camera that went offline or ran out of battery must never cause a false emergency panic. Threshold continuously polls Ring device health. If a sensor is stale (> 120 min) or unreachable, status derives as
UNKNOWN, silencing absence alerts while alerting the caregiver to the hardware issue. - Fire-Once Escalation & Polite Reminders: The scheduler enforces strict state-machine transitions, dispatching exactly one escalation per missed routine per local day. If unacknowledged, polite reminders follow on subsequent ticks without spamming.
- Bounded Diagnostic Agent: For ambiguous events (like unexpected 2:00 AM motion outside routine windows), a lightweight bounded agent runs strictly off the absence path. It executes a whitelist of five read-only diagnostic tools, with a pure deterministic gate enforcing evidence bars before dispatching a
CHECK NEEDEDalert. - Human Callback & Household Memory: Telegram alert messages include interactive callback buttons (
[False alarm]). Caregiver resolutions are committed to SQLite, creating a localized household memory that prevents duplicate alerts from nuisance triggers. - Local Web Dashboard: Caregivers can view a read-only, loopback status dashboard (
http://127.0.0.1:8080) displaying routine states, device connectivity, and recent diagnostic investigations.
How We Built It
We designed Threshold under strict production constraints:
- Zero External Dependencies: Built 100% on the Python standard library and SQLite in WAL mode. Zero pip packages, zero AWS services, zero external brokers. It can run on a Raspberry Pi, an edge gateway, or a home server.
- Direct Ring Partner API Integration: Direct Bearer token authentication against
api.amazonvision.comfor device discovery, device health queries, event history, and snapshot extraction. - Cryptographic Trust Boundary: Webhooks incoming from Ring cameras require HMAC-SHA256 signature verification computed before JSON parsing. Duplicate deliveries are safely rejected via SQLite composite unique constraints.
- Architectural Safety Isolation: An automated AST import guard test strictly guarantees that our bounded agent module can never import into or alter the deterministic absence detection engine.
Challenges & Ring API Friction Log
Integrating with the Ring Partner API and Developer Playground yielded valuable technical discoveries:
- Two-Step Snapshot Flow: Calling
POST /v1/devices/{id}/media/image/downloadreturnsHTTP 303 See Othereven when no media exists; the missing-media condition (HTTP 416) surfaces only on the subsequentGETto the presigned download CDN. Furthermore, the redirect must be executed without the Bearer token or the download host rejects the call. We designed our client to intercept this cleanly. - Snapshots are Historical Stills, Not Live Shutters: Requesting
at_timestamp=nowconsistently returns HTTP 416. Snapshots are post-recording stills extracted from completed cloud video sessions. We adapted our engine to query retrospective windows (latest_in_range). - Undocumented Response Headers: We discovered that successful snapshot downloads return undocumented headers (
X-Media-Timestamp,X-Media-Origin). Rather than discarding them, Threshold parsesX-Media-Timestampto give caregivers the exact capture time (e.g., "taken 02:10 CDT (2 min ago). Not live"). - Playground Sandbox Differences: In the sandbox account, the camera reports
online: falseduring idle periods. Rather than failing, our status engine proved its real-world resilience by derivingSTATUS_UNKNOWNand safely silencing alerts.
Accomplishments We're Proud Of
- 292 Passing Automated Tests: Full test suite covering timezone DST boundaries, HMAC validation, replay deduplication, database schema migrations, and scheduler state machines.
- Complete Determinism: An offline 6-scene interactive demo (
python3 -m src.threshold demo --serve) that reproduces every edge case deterministically without needing cloud accounts or private keys. - Radical Transparency: The project clearly demarks what is live (HMAC auth, Ring API health, SQLite storage, safety gate, Telegram delivery) versus what is simulated (fictional Dallas household routines, replay traces).
What We Learned
We learned that in vulnerable care contexts, false alarms are as dangerous as missed alarms. If a system cries wolf every time Wi-Fi blips, caregivers mute notifications. Designing safety around "untrusted silence is not evidence of absence" was the foundational principle that made Threshold genuinely trustworthy.
What's Next for Threshold
- Ring Alarm Sensor Integration: Expanding routines to monitor Ring Contact Sensors (e.g. medicine cabinet doors, refrigerator access) alongside camera motion.
- Local Edge Hardware: Packaging Threshold as an open-source, plug-and-play local Home Assistant add-on or Docker image for private home servers.
- Caregiver Voice Confirmations: Integrating Twilio or SIP fallback calls only after multiple unacknowledged escalation reminders.
Log in or sign up for Devpost to join the conversation.