Voice Activity Detection to MQTT bridge using ovos-plugin-manager
Project description
vad2mqtt
Bring the entire OpenVoiceOS VAD ecosystem into Home Assistant as IoT sensors.
vad2mqtt is a real-time Voice Activity Detection bridge built on
ovos-plugin-manager. It listens to any microphone, loads any OPM VAD
plugin, and publishes speech probability, noise level, and a speech-detected
binary sensor to MQTT — with full Home Assistant auto-discovery.
Because OPM plugins are interchangeable, every current and future OVOS VAD
plugin instantly becomes a Home Assistant sensor with zero code changes.
Install ovos-vad-plugin-silero today, swap to ovos-vad-plugin-webrtcvad
tomorrow, or drop in a community plugin next week — vad2mqtt adapts
automatically.
A complementary occupancy signal from the microphone you already own.
Why this exists — complementary occupancy detection
Most rooms already have a microphone (smart speakers, SBCs with a cheap USB mic, intercom panels, old phones running Home Assistant Companion). A Voice Activity Detector adds a privacy-respecting complementary occupancy signal with zero extra hardware:
- Complementary, not standalone. VAD is one input among many (PIR, mmWave,
door sensors, etc.). It feeds into a probabilistic occupancy estimator such
as Area Occupancy Detection.
Both the binary
Speech Detectedsensor and the continuousNoise Levelsensor are useful inputs. - No audio ever leaves the device. Only a 0–1 float (speech probability) and a dB value cross the wire. No transcription, no wake-word, no cloud.
- Lightweight. Silero VAD runs in ~1 ms per 30 ms frame on a Raspberry Pi. CPU usage is negligible.
- Fills gaps PIR leaves behind. PIR sensors need motion + heat. VAD catches presence when someone is sitting still at a desk or behind a PIR blind spot. It also misses people who are silent, which is why it must be fused with other sensors rather than used alone.
What it does
- Real-time audio — captures microphone input in small chunks (default 30 ms).
- OPM VAD plugin — loads any
ovos-plugin-managerVAD engine. Default isovos-vad-plugin-silero(ONNX, lightweight). - Speech probability — publishes a 0.0–1.0 float every chunk.
- Noise level — publishes RMS dB at a throttled interval.
- MQTT + Home Assistant — 4 auto-discovered entities under one device.
Quick start (Docker)
# PipeWire / PulseAudio host (most modern desktops)
vim docker-compose.yml # set MQTT_HOST
docker compose up -d
# Pure ALSA host (e.g. Raspberry Pi)
# Uncomment the `devices:` line in docker-compose.yml and set ALSA_CARD
vim docker-compose.yml
docker compose up -d
Quick start (pip)
pip install vad2mqtt
vad2mqtt
Home Assistant entities (4 under one device)
| Entity | Type | Payload | Note |
|---|---|---|---|
| VAD Probability | sensor | 0.87 |
0.0–1.0, state_class: measurement |
| VAD Model | sensor | ovos-vad-plugin-silero |
Static-ish, updates on startup |
| Noise Level | sensor | -45.2 |
dB, device_class: sound_pressure |
| Speech Detected | binary_sensor | ON / OFF |
Derived from threshold |
Configuration
All settings are environment variables:
| Variable | Default | Description |
|---|---|---|
MQTT_HOST |
localhost |
Broker host |
MQTT_PORT |
1883 |
Broker port |
MQTT_USER |
— | Auth user |
MQTT_PASSWORD |
— | Auth password |
MQTT_TOPIC_PREFIX |
vad2mqtt |
Topic root |
SAMPLE_RATE |
16000 |
Audio sample rate |
SOUND_DEVICE |
— | sounddevice device index/name |
ALSA_CARD |
— | ALSA card string (for PipeWire/ALSA) |
VAD_PLUGIN_MODULE |
ovos-vad-plugin-silero |
OPM plugin module name |
VAD_PLUGIN_CONFIG |
— | JSON extra config for plugin |
VAD_THRESHOLD |
0.5 |
Speech / silence cutoff |
HA_ENABLED |
true |
Auto-discovery toggle |
DEVICE_NAME |
vad2mqtt |
HA entity prefix |
DEVICE_ID |
vad2mqtt_01 |
HA device identifier |
PUBLISH_INTERVAL |
0.5 |
Min seconds between VAD publishes |
NOISE_LEVEL_INTERVAL |
2.0 |
Min seconds between noise publishes |
NOISE_LEVEL_DELTA |
3.0 |
dB jump that bypasses interval |
LOG_LEVEL |
INFO |
Logging level |
Switching VAD plugins — the OPM advantage
Because vad2mqtt uses ovos-plugin-manager, you can swap VAD engines with
a single environment variable. Every current and future OVOS VAD plugin is
supported:
# Silero VAD — best accuracy, ONNX, ~1 ms/frame on Pi (default)
pip install ovos-vad-plugin-silero
VAD_PLUGIN_MODULE=ovos-vad-plugin-silero
# WebRTC VAD — lighter, no ML model
pip install ovos-vad-plugin-webrtcvad
VAD_PLUGIN_MODULE=ovos-vad-plugin-webrtcvad
# Noise-based VAD — threshold-based, minimal CPU
pip install ovos-vad-plugin-noise
VAD_PLUGIN_MODULE=ovos-vad-plugin-noise
# Future community plugins — just install and point VAD_PLUGIN_MODULE at them
This is the power of the OVOS plugin ecosystem: new VAD research (new ONNX
models, new algorithms) ships as a plain pip package. vad2mqtt consumes it
immediately with zero code changes.
Architecture
Mic ──► sounddevice ──► 30 ms chunks ──► OPM VAD Plugin
│
┌──────────────────────────┘
▼
MQTT ──► Home Assistant
│
├── vad_probability (continuous)
├── noise_level (throttled)
├── model_name (startup)
└── speech_detected (binary, derived)
Related
- ovos-plugin-manager
- ovos-vad-plugin-silero
- shazam2mqtt — music recognition bridge
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vad2mqtt-0.1.0a1.tar.gz.
File metadata
- Download URL: vad2mqtt-0.1.0a1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72f0055aea7a57285a47350bba1d69fcb58464b638f1e764673ab91518b3e572
|
|
| MD5 |
9845ee038d2991268a1b5290905c481e
|
|
| BLAKE2b-256 |
fbc754bc93b6107cd85471e85c08ab27080fda470411064f3bd3d3e4c1a8a1d5
|
File details
Details for the file vad2mqtt-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: vad2mqtt-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3edb793ed77e36f9a91a3c1e4924a3c72e29e5ab61d93ba80d739f8089ea2a97
|
|
| MD5 |
cf845ad2be0814ebccc2551cbf35f3e8
|
|
| BLAKE2b-256 |
50e78b268c67143b9885d6942a2a1cbc1e6e28414a723a8d02e0d16086f234fd
|