Sonos Stop Commands

Hello, would someone kindly be able to tell me/help me understand why I cannot get Sonos “stop” command to work.

My application would be, one rule tells my Sonos device to play a track from my dropbox (which works great), then another rule that could stop that playback. I cannot seem to get any stop or pause commands to work.

Thank you in advance.

@Ridyn_2007, I just did a quick test and found the same result that I cannot stop, pause or even mute the audio after the sending the playTrack command. What I found out is, when using playTrack to play a file from internet, the Sonos device’s playback status actually didn’t change to play in SmartThings. It almost seems the playTrack tells the Sonos to play the file, and Sonos basically does so without even knowing it’s playing. I am not sure if this is due to SmartThings integration or Sonos’ API though.

Can you describe your use case and maybe we can help come up with some other idea?

Hello @James, Thank you for looking into this. This use case is for my children. HaHa

I have attached 2 screenshots. The idea is to use the Sonos Move in their room as an alarm clock for school at 6:55am and 7:05am. The rule in “Alarm Schedule” also fades in their bedroom light. I have a different track for 6:55 and 7:05 Mon, Wed & Fri. Then a separate set of tracks for the same times Tue, & Thur. Then, I have a smartthings button that we pressed, stops the playback for that time. (Essentially a Snooze button). However, it they press and hold the button, it stops the current payback AND prevents the second alarm from going off at all.

Hopefully my screenshots explain better.

As always, thank you for the help.


1 Like

@Ridyn_2007, instead of sending stop or pause command, you can setVolume to 0, to basically stop/snooze it. Since you always reset its volume to ~25 before play the file, turning down the volume should work in this case.

@James, I tried that, and discovered another anomaly. I set up a test with setting the volume to “0”, and I did not go to zero. At least I don’t think it did, because the sound never completely went away. Whats more, is I then tried to volume all the way down using the physical volume buttons on the Sonos speaker itself and to my surprise, those buttons did not allow me to turn the volume down all the way either.

This behavior only happens when using the “playTrack” command. The volume WILL go all the way down using the Sonos volume buttons, if I start playback of something from the Sonos app. I tried this test on a different speaker, and had the same results.

Crazy! Haha

@James, I have been unsuccessful getting this to work. The set volume to zero is a great idea, but it does not work in this case. (per my post above)

I was just checking in to see if you or anyone else has had any success with this.

@James , a bit of an old topic, but curious if there has been anymore discoveries with the stop command for Sonos?

Again, when a track is played to Sonos via Dropbox, there is no way to stop it with SharpTools commands. Whats crazy, is it DID work for a few days in a rule I created under the the new smartthings integration, and after the migration tool provided by Sharptools.

I cannot seem to find out out why it worked for a few days then quit.

Also if a SharpTools rule triggers a playTrack command from drop.box, then I play a song from my Sonos app, both songs play at the same time.

The only way to stop a drop box playback file is to push the play/pause physical button on the speaker.

Just wondering if you have any thought.

It sounds like an issue with how the device is integrated into SmartThings. Have you asked SmartThings if they have any insights? Ideally, if it’s something you can reproduce in a SmartThings Routine or other first-party feature, they’re more likely to provide help.

I suspect that with the Groovy transition, they’re going to be pretty bogged down though.

@josh , unfortunately I will not be able to replicate the issue using a SmartThings routine because I cannot start playback of a track from my DropBox account like I can from SharpTools, or start any track for that matter.

When SharpTools sends the command to play a track from DropBox, it does do it, but the playback status within Smartthings does not update, to show that anything is playing. When SharpTools tells the speaker to play, it’s almost as if that speaker, smartthings and the Sonos app doesn’t even know that it’s playing a track. I cannot stop playback from even the Sonos app at that point. Even if I set a delay for 60 seconds then send a volume control conmand, SmartThings will reflect that change, but the speaker will not actually change volume.

Not sure if this changes anything, but thought it might be a useful piece of information.

Not from the SharpTools side of things as the Rule Engine is just using the commands that the device exposes, but it might be a clue for SmartThings/Sonos.