apps.header.allAppsCount
BabyMonitor
apps.detail.types.app from Selfhosters
apps.detail.sections.overview
Readme
View on GitHubBaby Monitor — RTSP Audio Noise Alert for Home Assistant
A lightweight Docker container that continuously monitors audio from an RTSP camera stream and sends alerts to Home Assistant when noise exceeds a configurable threshold. Designed for baby monitoring but works with any RTSP camera.
How It Works
Uses FFmpeg's ebur128 filter to sample audio volume from the RTSP stream every few seconds. When the volume exceeds the threshold for N consecutive readings, it fires a webhook to Home Assistant and publishes the raw volume to an MQTT topic.
RTSP Camera → FFmpeg → Volume check → MQTT (live volume)
→ HA Webhook (noise alert)
Features:
- Configurable dBFS threshold and trigger count (avoids false positives)
- Dual camera support — automatically falls back to a secondary URL on connection loss
- Auto-reconnect loop with configurable retry delay
- MQTT volume publishing for dashboards/graphs
- Home Assistant webhook integration for automations
- Fully configurable via environment variables — no code changes needed
Quick Start
Docker Compose
services:
baby-monitor:
image: ghcr.io/aldendana/ha-baby-monitor:latest
restart: unless-stopped
environment:
- CAMERA_URL=rtsp://user:pass@192.168.1.x:554/stream
- THRESHOLD=-30
- MQTT_HOST=192.168.1.x
- MQTT_USER=mqtt_user
- MQTT_PASS=mqtt_password
- WEBHOOK_URL=http://homeassistant:8123/api/webhook/your_webhook_id
Build locally
docker build -t baby-monitor .
docker run --restart unless-stopped \
-e CAMERA_URL="rtsp://user:pass@192.168.1.x:554/stream" \
-e THRESHOLD=-30 \
-e MQTT_HOST=192.168.1.x \
-e MQTT_USER=mqtt_user \
-e MQTT_PASS=mqtt_password \
-e WEBHOOK_URL="http://homeassistant:8123/api/webhook/your_webhook_id" \
baby-monitor
Environment Variables
| Variable | Default | Description |
|---|---|---|
CAMERA_URL |
(required) | Primary RTSP stream URL |
CAMERA_FALLBACK_URL |
(empty) | Secondary RTSP URL — used when primary fails |
THRESHOLD |
-30 |
Noise threshold in dBFS. Higher = more sensitive (e.g. -25 triggers on quieter sounds) |
TRIGGER_COUNT |
2 |
Consecutive loud readings required before alert fires |
SAMPLE_INTERVAL |
2 |
Seconds between volume samples |
MQTT_HOST |
localhost |
MQTT broker host |
MQTT_PORT |
1883 |
MQTT broker port |
MQTT_USER |
homeassistant |
MQTT username |
MQTT_PASS |
(empty) | MQTT password |
MQTT_TOPIC |
home/baby_monitor/volume |
Topic for live volume readings |
WEBHOOK_URL |
http://homeassistant:8123/api/webhook/baby_noise_alert |
HA webhook URL to call on alert |
RETRY_DELAY |
5 |
Seconds to wait before retrying after connection loss |
FFMPEG_LOGLEVEL |
verbose |
FFmpeg log verbosity |
Home Assistant Setup
1. Create the webhook automation
- alias: Baby noise alert
triggers:
- trigger: webhook
webhook_id: baby_noise_alert
allowed_methods: [POST]
local_only: true
actions:
- action: notify.mobile_app_your_phone
data:
title: Baby Monitor
message: Noise detected in baby room
2. MQTT sensor for live volume (optional)
mqtt:
sensor:
- name: Baby Room Volume
state_topic: home/baby_monitor/volume
unit_of_measurement: dB
device_class: signal_strength
Threshold Tuning
The ebur128 filter measures integrated loudness in dBFS. Typical values:
| Environment | Typical range |
|---|---|
| Silent room | -60 to -45 dB |
| Baby sleeping (white noise) | -40 to -30 dB |
| Baby crying | -20 to -10 dB |
| Speech | -30 to -15 dB |
Start with -30 and adjust based on the MQTT volume readings. Enable debug logging (FFMPEG_LOGLEVEL=verbose) to see real-time volume output.
License
MIT — see LICENSE
apps.marketingCta.appInstallTitle
apps.marketingCta.appInstallDescription
apps.detail.sections.categories
apps.detail.sections.related
apps.detail.related.exploreCategories
apps.detail.related.exploreAllapps.detail.sections.links
apps.detail.sections.details
ghcr.io/aldendana/ha-baby-monitor:latestapps.detail.sections.runtime
- apps.detail.details.network
bridge- apps.detail.details.shell
bash- apps.detail.details.privileged
- false
apps.detail.sections.configuration
Primary RTSP stream URL — e.g. rtsp://user:pass@192.168.1.x:554/stream
- apps.detail.config.target
- CAMERA_URL
Secondary RTSP URL — used automatically when the primary fails (optional)
- apps.detail.config.target
- CAMERA_FALLBACK_URL
Volume threshold in dBFS. Higher = more sensitive. Silent room: -60 to -45. Baby crying: -20 to -10. Start at -30 and adjust.
- apps.detail.config.target
- THRESHOLD
- apps.detail.config.default
- -30
Consecutive loud readings required before alert fires — avoids false positives from brief sounds
- apps.detail.config.target
- TRIGGER_COUNT
- apps.detail.config.default
- 2
Seconds between volume samples
- apps.detail.config.target
- SAMPLE_INTERVAL
- apps.detail.config.default
- 2
MQTT broker IP address (e.g. 192.168.1.x)
- apps.detail.config.target
- MQTT_HOST
MQTT broker port
- apps.detail.config.target
- MQTT_PORT
- apps.detail.config.default
- 1883
MQTT username
- apps.detail.config.target
- MQTT_USER
- apps.detail.config.default
- homeassistant
MQTT password
- apps.detail.config.target
- MQTT_PASS
Topic for live volume readings (used for MQTT sensor in HA)
- apps.detail.config.target
- MQTT_TOPIC
- apps.detail.config.default
- home/baby_monitor/volume
Home Assistant webhook URL to call when noise is detected
- apps.detail.config.target
- WEBHOOK_URL
- apps.detail.config.default
- http://homeassistant:8123/api/webhook/baby_noise_alert
Seconds to wait before reconnecting after camera connection loss
- apps.detail.config.target
- RETRY_DELAY
- apps.detail.config.default
- 5
FFmpeg verbosity: warning, verbose, debug
- apps.detail.config.target
- FFMPEG_LOGLEVEL
- apps.detail.config.default
- warning