As a home automation expert with years of experience building smart systems, I've seen the frustration many face: devices like Amazon Echo respond brilliantly to voice commands but can't proactively announce messages. That's where Sonos speakers shine, especially when paired with a Raspberry Pi. In this guide, I'll walk you through setting up reliable voice notifications on your Sonos system using proven tools like IFTTT recipes and OpenHAB integrations.
Note: The native Sonos binding for OpenHAB can cause memory leaks due to a faulty UPnP library. Skip it and follow this battle-tested method instead.
This setup works best on a Raspberry Pi running Raspbian (though any Linux server should suffice). I'm using a Pi also hosting OpenHAB, our go-to open-source home automation platform. For details, see our Introduction to OpenHAB Home Automation on Raspberry Pi. Assume you have SSH access; learn how in our Setting up your Raspberry Pi for headless use with SSH guide.
Check your Node version:
node -vVersion 6 is unsupported. Uninstall it first if present. If no v5.x or errors occur, install as follows (use armv6l for older Pis):
wget https://nodejs.org/download/release/latest-v5.x/node-v5.12.0-linux-armv7l.tar.gz
tar -xvf node-v5.12.0-linux-armv7l.tar.gz
cd node-v5.12.0-linux-armv7l
sudo cp -R * /usr/local/Verify:
node -vInstall NPM and dependencies:
sudo apt-get install npm
sudo npm install -g npm
sudo npm install -g node-gypThis tool runs a local web server for controlling Sonos via simple HTTP calls, perfect for voice announcements.
git clone https://github.com/jishi/node-sonos-http-api.git sonos
cd sonos
npm install --production
npm startMissing modules? Run npm install [module] and retry. C++11 errors? Fix with:
sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternative --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternative --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternative --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternative --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50Success looks like:

API format: https://[SERVER_IP]:5005/[ROOM]/[ACTION]
Example: https://192.168.1.99:5005/kitchen/playlist/chillout
For announcements: https://192.168.1.99:5005/kitchen/say/make%20use%20of%20is%20awesome/en-gb
First try prompts for VoiceRSS key. Edit nano settings.json and add:
"voicerss": "YOURAPIKEY"(CTRL+X, Y to save.) Restart and test. Use en-us for US English.
Auto-start on boot: sudo nano /etc/rc.local, add before exit 0:
node /home/pi/sonos/server.js </dev/null &Now ping URLs from anywhere on your LAN for instant announcements.
Example: Announce garden motion.
rule "Motion detected in garden"
when
Item Garden_Motion changed
then
var String message = "You have a visitor"
sendHttpGetRequest("https://localhost:5005/kitchen/say/" + message.encode("UTF-8") + "/en-gb")
endIntegrate into any rule effortlessly.
Enable My.OpenHAB for secure external access (setup in our OpenHAB guide).
Create OpenHAB string item Todays_Weather. Initialize: https://raspberrypi.local:8080/CMD?Todays_Weather=Sunny (adjust host/IP).
Verify in My.OpenHAB Items list.

In IFTTT: Weather trigger (set location/time), My.OpenHAB action updating Todays_Weather.

OpenHAB rule:
rule "Announce daily weather"
when
Item Todays_Weather received update
then
sendHttpGetRequest("https://localhost:5005/kitchen/say/" + Todays_Weather.state.toString.encode("UTF-8") + "/en-gb")
endTest: https://raspberrypi.local:8080/CMD?Todays_Weather="Cloudy with a chance of meatballs."
For public IFTTT access without OpenHAB: Use dynamic DNS (e.g., DuckDNS or router's). Forward port 80 to Pi's 1337. Reserve Pi's IP.

git clone https://github.com/sebauer/if-this-then-node.git
cd if-this-then-node
npm install
node server.js
Edit config.js, restart.

Test: [DDNS]/ifttn/ shows uptime. Auto-start: Add to /etc/rc.local node /home/pi/if-this-then-node/server.js </dev/null &.
Custom Sonos plugin:
cd plugins
wget https://gist.githubusercontent.com/jamesabruce/4af8db24ba3452b94877/raw/d11c1cff3aa44dbb6a738eeb15202f3db461de75/sonos.js
npm install requestRestart server. Plugin uses /sayall/ for all speakers or target specific.
Test via IFTTT Maker:

URL: [DDNS]/ifttn/, POST JSON:
{
"action": "sonos",
"user": "YOURUSER",
"pw": "YOURPASSWORD",
"message": "Dinner is ready!"
}Expect log scans; normal internet noise.

With 350 daily VoiceRSS requests (~1 every 4 mins), unleash endless announcements. Share your recipes in comments!