BabyMonitor

BabyMonitor

Docker app from Selfhosters

Overview

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. Uses FFmpeg ebur128 filter for accurate volume measurement. Publishes live volume to MQTT and fires a Home Assistant webhook when noise is detected. Features dual camera fallback on connection loss, auto-reconnect, and configurable threshold + trigger count to avoid false positives. No code changes needed — fully configured via environment variables.

Baby Monitor — RTSP Audio Noise Alert for Home Assistant

License: MIT Docker

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


Support

This is a spare-time project, shared free under the MIT licence and maintained as time allows. If it saved you an afternoon, you're welcome to sponsor on GitHub or buy me a coffee — completely optional, and it never gates features, fixes or support. A good bug report is worth more than a donation.

Install BabyMonitor on Unraid in a few clicks.

Find BabyMonitor in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for BabyMonitor Review the template variables and paths Click Install

Categories

Related apps

Explore more like this

Explore all

Details

Repository
ghcr.io/aldendana/ha-baby-monitor:latest
Last Updated2026-09-13
First Seen2026-08-13

Runtime arguments

Network
bridge
Shell
bash
Privileged
false

Template configuration

Primary Camera URLVariable

Primary RTSP stream URL — e.g. rtsp://user:pass@192.168.1.x:554/stream

Target
CAMERA_URL
Fallback Camera URLVariable

Secondary RTSP URL — used automatically when the primary fails (optional)

Target
CAMERA_FALLBACK_URL
Noise Threshold (dBFS)Variable

Volume threshold in dBFS. Higher = more sensitive. Silent room: -60 to -45. Baby crying: -20 to -10. Start at -30 and adjust.

Target
THRESHOLD
Default
-30
Trigger CountVariable

Consecutive loud readings required before alert fires — avoids false positives from brief sounds

Target
TRIGGER_COUNT
Default
2
Sample Interval (s)Variable

Seconds between volume samples

Target
SAMPLE_INTERVAL
Default
2
MQTT HostVariable

MQTT broker IP address (e.g. 192.168.1.x)

Target
MQTT_HOST
MQTT PortVariable

MQTT broker port

Target
MQTT_PORT
Default
1883
MQTT UsernameVariable

MQTT username

Target
MQTT_USER
Default
homeassistant
MQTT PasswordVariable

MQTT password

Target
MQTT_PASS
MQTT TopicVariable

Topic for live volume readings (used for MQTT sensor in HA)

Target
MQTT_TOPIC
Default
home/baby_monitor/volume
HA Webhook URLVariable

Home Assistant webhook URL to call when noise is detected

Target
WEBHOOK_URL
Default
http://homeassistant:8123/api/webhook/baby_noise_alert
Retry Delay (s)Variable

Seconds to wait before reconnecting after camera connection loss

Target
RETRY_DELAY
Default
5
FFmpeg Log LevelVariable

FFmpeg verbosity: warning, verbose, debug

Target
FFMPEG_LOGLEVEL
Default
warning