Blue Iris Audio Alerts and MPD

Joined
Jul 8, 2021
Messages
186
Reaction score
450
Location
Oregon, USA
Thank you everyone! I have received so much from this community, and I am very appreciative of all the insight
and knowledge (hard won sometimes, I can tell). I wanted to contribute something, perhaps
trivial, and only one of many ways to skin the cat, but I find it useful and am hoping that
others might find it useful. I have tried to keep this description succinct, but I am happy
to elaborate on any configurations or any parts that I have poorly described.

I have a fairly extensive Home Assistant setup and one feature that I appreciate is audio alerts.
Home Assistant can send commands to a piece of software called the Music Player Daemon (MPD) Music Player Daemon
An MPD instance is just a tiny software server that listens for commands to manage and
play audio files on the host computer. I run three MPD servers on three Raspberry Pi's on
three floors. The Raspberry Pi's have this device connected:
In one "black box" it is a 1) USB sound card, 2) a 5W digital amplifier, and 3) loud speaker (two drivers and some folded horn kindofa thing)

As an example, I have an Home Assistant automation that turns on the front porch lights
at sundown and turns them off at sunrise. As part of that automation, Home Assistant
sends a command to the MPD servers and over their speakers they "speak" "Porch Lights On"
and "Porch Lights Off". Similarly, if the garage side man door is opened,
an automation sends a command to the MPD servers and their speakers announce "Garage
Man Door Open". (I have the volume set so the announcements are about the same volume
as a typical analog doorbell)

Home Assistant has built-in support (an integration) for MPD, but it is easy to send audio alerts through
Blue Iris as well using an MPD command line client called MPC mpc - Music Player Daemon
On the MPC downloads page there is a Windows executable: that Blue Iris can execute as a Windows Command.com batch file. Here is an example of
the batch file that my Blue Iris instance executes for a particular camera:
Code:
# play audio file when Blue Iris triggers an alert
# clear the playlist because HomeAssistant might have been the last mpd user
mpc --host 10.0.0.217 clear
mpc --host 10.0.0.218 clear
mpc --host 10.0.0.219 clear

# add the alert sound to the mpd queue
mpc --host 10.0.0.217 add DrivewayLeftCameraAlert.mp3
mpc --host 10.0.0.218 add DrivewayLeftCameraAlert.mp3
mpc --host 10.0.0.219 add DrivewayLeftCameraAlert.mp3

# play the queue
mpc --host 10.0.0.217 play
mpc --host 10.0.0.218 play
mpc --host 10.0.0.219 play
(The Raspberry Pi's are on the 10.0.0.xxx network, but my Blue Iris cameras are on a 192.168.1.xxx
network, with the Blue Iris computer having dual network adapters for each subnet).

Note that MPD just plays an audio file, so there are numerous websites to generate Text To Speech (TTS) audio files,
including Free Text to Speech Online Converter There are also numerous websites with free, remarkably creative audio
files likes buzzers, chimes, alerts, barking dogs, death rays, trains, etc., including Free Sound Clips | SoundBible.com
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Top