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