Sonos as alarm

How do I set up Sonos to play a burglar sound/alarm when a sensor is triggered? I tried using a smartapp listed in the “sound” section but could not 1)set up multiple players for same event and 2) have Sonos to be activated in a reliable manner! Plus, today the smartapp I was using has disappeared from the list of available smartapps. I’m puzzled!

Really, any workaround to setting up an alarm when a sensor is activated would be helpful. I am mentioning Sonos as I have this already available to me but I could consider a separate plug-in siren if any is compatible with ST. Problem is that a burglar system without a siren seems pointless!


1 Like

Also really want this functionality.

I am new to smart things but I have a work around that has been working for me for a few days now.

First I downloaded a siren sound, there are loads of siren sounds that to choose from with a quick google search. I used audacity ( to create a 20 min repeating version of the alarm and added it to my Sonos library.

I then used Sonos Mood Music Smartapp to play this alarm when any one of a number of sensors are activated. If you set it to only come on in away mode it seems to work.

All you need to do then is set the mode to away when you leave the house. Make sure you set the mode to home when you get back otherwise you will jump a bit when you get in (but you can automate this too).

Alarm stays on for however long you you repeat the siren sound (in my case 20 mins). I also set the volume to 100% to give it some really power.

This was something that I felt should exist, so I made it! (well kinda)

I have it working, but it is in very alpha stages. I figured I would share what I have at the moment, but it is a work in progress.

GitHub - SonosWithSpeechAndAlarm.groovy

This uses obycode’s updated Sonos device type (not sure if it is the most recent). You need to go to the IDE, and a new device handler, paste the code and then edit your Sonos’ to use this device type.

At the moment, it is only playing a single siren ( for 17 seconds and at 40% volume. As I continue to work on this, I hope to add options to change the siren, extend the time, etc.

Lots to do on it, but as a POC it works.


I appreciate you working on this as I’ve been DYING for this option ever since I bought both of my SONOS Play:5 speakers.

Also, love the work-around as well Will.

I made some more progress. This is working as well as I can get it with the SONOS functionality that exists. There are changes I would love to make, but there seems to be bugs in the base SONOS code, which I cannot touch.

How it functions now:
-Alarm will play a single alarm file ONCE (I wanted to repeat based on user input duration, but SONOS bug stopped it)
-User configurable (within App)
–Alarm File
–Alarm Volume

What you need to do:
-Log into IDE (
-Go to “My Device Handlers”
-Create New Device Handler
-From Code
-Copy and Paste my code from GitHub in there
-Publish for Me

The new device is now published. Next steps:
-Go to “My Devices”
-Find the SONOS’ that you want to Alarm
-Click on Device
-Click Edit (On device page at bottom)
-Change Type to “Sonos Player with Alarm” (At bottom of list)

The SONOS is now setup to have Alarm capabilities. Not done yet…
-In the SmartThings App find the device(s) that you have changed to “Sonos Player with Alarm”
-Go into the device, you should see a new icon (Alarm Test)
-DON’T try testing it yet, need a few more steps.

If that is there, you were successful at changing the type, still more…

-Edit the device
-You should see two new options
–HTTP path for mp3 file
–Alarm Volume (1-100)
These will have defaults but you can change them to whatever you like. Personally, I took the default file, used Audacity and made a 15 minute loop and I host it locally so that if the internet goes down it can still play.

YOU MUST edit every device that you have changed, only if just to take the defaults. It will not work until you edit and save.

After you have completed these steps, you can select your SONOS as an alarm from SHM or other actions that use Alarm capability.

You can use the Alarm test icon/button under the device to test the functionality. Please note that there can be a delay, nothing I can do about that.

Hopefully we get an updated SONOS device handler soon for SmartThings. There is a lot I would like to do with this.

Let me know if it works for you or if you run into any issues.

@CAB426 - Great job on the device handler. I’ve hit an issue when going into the Edit Device menu and updating the volume…it keeps popping up with a “Please fill out all required fields” message. Any ideas? I’m just adjusting the volume as the sound you have as default works fine for me.

@BlackCatPeanut What are you setting the volume level to? Are you editing in the app or the IDE? I am having trouble reproducing this, any other settings/changes you made that could help me track this down?

Thanks for the prompt response…I was adjusting it to 30. I would navigate to the Edit Details, click and edit the volume and then click the Done button. Then the message would be displayed.

What I’ll do is remove the Device and try again to adjust the details. The main reason is for the sanity of my neighbours :slight_smile: I think 100 would blow them away with the Play 5…

Thank you so much @CAB426 for your programming!

Had also a problem with setting the volume in the app as @BlackCatPeanut. Setting it in IDE worked for me. But I still don not get alarm working. I will continue to try.

Great thread. So is there a curret solution for this?
I am using an ifttt applet that plays a sonos favorite when a smartthing device triggers. It works great but does not allow me to set the volume. I need to setup the volume.
I recorded a track that is a siren noise for 20 seconds followed by an intense voice saying " Alert, intruder detected Police and owner have been notified" then back to 20 seconds of siren.
Can someone point me at a solution?