Sonos jukebox start volume

Is it possible to set a volume on the Sonos when played through the sharptools jukebox method? As it is now, on the jukebox tile, when play is selected, the music volume is max…causing frantic tapping of the volume down button!

The audioNotification capability in SmartThings supports supplying a level parameter:

playTrack(uri, level)

Some of this depends on how the device driver has implemented things though. If you’re using playPreset() instead, it doesn’t have a level parameter, but nother approach would be to send a setLevel() or setVolume() command before you send the command to start playing audio.

Hi Josh, I’m using the jukebox tile to directly interface with the Sonos (thing), instead of activating a scene in Smartthings…because of that, I think I need to use the set level command method you mentioned…would I create an “if” rule to determine if the level is set before the play command is sent? I’m not sure how I would send the set level, and then play with one touch? Or would it be more stable to add a scene in Smartthings that sets the audio notification level and add the command to run that scene in the same sharptools rule that runs the jukebox?

I might be misunderstanding what you mean by “Jukebox Tile”.

We don’t have anything we officially refer to as a “Jukebox Tile” and instead have a Music Player Tile and an Album Art Tile.

When most people comment about “Jukebox Dashboards” they’re usually referring to the approach in the following thread which is what I thought you were referring to. In that thread, a common approach is to add artwork for your various ‘stations’ or ‘presets’ as a Media Tile and then configure each media tile to run a rule when it’s tapped. That’s why I figured you were already using a rule and would be using one of the above commands.

Hi Josh, yes, I am sorry for the sloppy terminology. I followed James instructions, (in your link), to create the music player tile and album artwork tile. I placed them on its own dashboard with a dashboard tile on the “home” dashboard to go to that music dashboard. Once on the “music” dashboard, I press the play button, (which I am using a sonos device), and the predefined, (in the sonos ap), source begins playing, but at 100% volume! I use the sonos device for other notifications as well, so setting the sonos device at a static volume isn’t possible. I added rules and rule tiles for the volume control. What I am having trouble wrapping my head around is how to send the set volume command without it having to be its own tile and having to remember to activate it before navigating to the “music” dashboard. I wonder if there is a way to program the dashboard tile, or smart tile to not only switch dashboards, but at the same time send the volume set command or send a command to run a smartthings scene that has the set volume programmed? The following would probably be a feature request, if its even possible, but to have an option in the rule engine to see dashboard tiles as “devices”… something like: when a tile is tapped or activated, that could be seen like a device button or contact has been activated?

Interesting. So it sounds like the Music Player Tile which just sends a play() command.


Is the volume getting set to 100% for notifications or something else? So when it resumes playback, it’s resuming at the previous volume?

One workaround might be to recreate the Music Player tile as a Super Tile. Add icons for the next and previous tracks along with a Play/Pause Icon. It won’t be quite as feature rich as the Music Player tile and would miss the option to tap the settings icon in the bottom left to pull up more details, but that way you could program the play/pause button to execute a rule…

In your rule, you would have an IF Condition to determine if it should send a play() or pause() command based on the current playback status… and it it was going to send a play command, you could have it send a setVolume() command just before that so the device automatically gets set to your desired volume.

Of course, you could riff on this in many ways including adding volume quick setpoints to the Super Tile or other concepts.

Im not sure how to find that out?

Yes, there is a notice that plays every morning. its set up through smartthings and there is a set volume field there. it needs to be set to 100% for the notice. I think it will stay at what ever the last set volume command tells it to, because when I play the music and adjust the volume there, the next day its 100%, after the notice function executes and I play the music function again.

What sort of features would I sacrifice? I probably wouldn’t miss them, as I didn’t know there were additional features… haha!

Thats what I was wondering about, only I was stuck on including the set volume command on the tile that navigates to the music dashboard… I didn’t think of using the play music tile… Thanks Josh! I will mess around with that using a super tile! (if the loss of the features is bearable)…

I suppose it was more of a statement. :laughing: If you are using the music player tile that looks like the one in my screenshot, then that’s all it’s doing is sending the play command when you tap the play icon.

That could be an easier way to resolve this and actually sounds like the root of the issue. If you’re doing that in a rule, you could snapshot the current volume level to a variable, make your announcement, then explicitly issue a setLevel() command using your variable as the level.

Or if you are currently doing it in a SmartThings Routine, you might consider moving it to a SharpTools rule. SmartThings has made some of the TTS functions a bit harder to get at, but if you can share more details about what you’re doing, I’m sure we can get you pointed in the right direction.

I would also check if the volume level is expressly required. Many commands take the volume level as an optional parameter that you could remove… that is of course unless you prefer having the volume at 100 for announcements.

Mainly the ones I laid out. There’s lots of subtle things like the controls getting grayed out based on playback status, the parsing of the audio track data (JSON) to pull out the currently playing song name, and then all the controls you can access by tapping the settings icon in the bottom left.

would it affect the album art?

I’m not following? The Album Art Tile is a separate tile from the Music Player tile.

Since it sounds like the volume is being set as part of the announcement, that sounds like it would be the easier/better fix in my opinion.

Hi Josh, with your patience and help, I solved the problem. what I did is in smartthings, I added an action to all of the notifications to set a vswitch on and auto off in 10 minutes, (the sonos driver has a volume setting within the action, set to my desired notification volume level)… then I made a rule in sharptools to watch that vswitch, and when it changes to off, send a set volume command to the sonos to set volume at 35… so far it seems to be working. Thanks for your help! super appreciated!

1 Like