Create "Jukebox" Dashboard with Album Art for Echo or Sonos Devices

This is awesome, But… Is there a way to do this with Google Music?

On what type of device (eg. Sonos or Echo Speaks) and on which platform (eg. SmartThings or Hubitat)?

@Randy_Cooper, if you are using a Sonos speaker, you can create a Sonos playset and add songs from Google music into the playset, and then the rest steps are the same as mentioned in the post. But unfortunately Echo doesn’t Google music if you are using an Echo.

I have Sonos, plus Homes and Mini’s throughout the house and Hubitat.

1 Like

Thanks James, this is what I was hoping to hear. :slight_smile:

1 Like

Don’t forget to post your dashboard in the “show off dashboard” thread, so we can see your “jukebox” dashboard. I’ve learned people have so many creative setup with these and excited to see more. :sunglasses:

It’s going to have to wait, right now I’m not able to pull up any of my playlists.

So how do I get one tap on my dashboard to start playing on multiple Sonos devices in a group?

Unfortunately, neither Hubitat or SmartThings’ Sonos integration supports grouping natively.

If I remember correctly, you’re on Hubitat. Check out the posts in the following thread to see if they work for you. It sounds like some people are using the custom node-sonos-http-api, but this particular post about using a special setTrack() format in order to get existing players to join the group of another player (without other external code) seems particularly interesting:

2 Likes

Hi all, I am a new sharptools user. My amazon music setup is that I have 2 echo dots paired as left and right channels across the room from each other. I use voice commands to play music primarily from tune-in radio and amazon music. I came across a youtube video for “Creating a Smart Music Command Center | Sharptoold Dashboards” ( https://www.youtube.com/watch?v=Vz8bzMLz224&t=34s ). I liked the Idea of having presets to play my favorite music. After having difficulties getting it to work, I unpaired the speakers and I successfully setup the music center using 1 speaker.

I later found another video “Automate Multi-Room Music on Alexa Groups | SmartThings & SharpTools” ( https://www.youtube.com/watch?v=YcHr0L-UKwY&feature=youtu.be ). That gave me hope that I could at least use both speakers, even if not a stereo pair. This is not working out for me. I am hoping someone can help me solve this.

The difference in the rule is supposed to be as follows:

Single speaker rule

 (select Device = speaker1, select command = searchAmazonMusic, string = artist1)

Speaker Group rule

 (select Device = speaker1, select command = searchAmazonMusic, string = artist1 on group1)

Test1 = Orig working rule test1 says:

(select Device = speaker1, select command = searchAmazonMusic, string = artist1)

Results = sharptools reports exec rule / speaker lights up white / music plays

I then created speaker group using speaker1 and speaker2 called Group1

I Ran command vocally - play artist1 on Multigroup1

results = music plays on the group and alexa presents vol control for each speaker within the group.

Test2 = New rule test2 says:

 (select Device = speaker1, select command = searchAmazonMusic, string = artist1 on group1)

Results = sharptools reports exec rule / speaker does not respond.

Test3 = New rule test3 says:

  *  I added a trigger device  ( Virtual Switch 1 - switch changes to 'on') as presented in the 2nd video

 (select Device = speaker1, select command = searchAmazonMusic, string = artist1 on group1)

Results = sharptools reports exec rule / speaker does not respond.

Is anyone able to provide different results? Thx in advance.

Hi @johnm93359, welcome to the community and SharpTools family. Unfortunately, it appears Amazon Echo MRM (multi-room music) may have a weird out-of-sync issue when mixed using both group and individual echo music, even with the voice control. According to Anthony, the author of Echo Speaks, this MRM(multi-room music) can be observed in the native Alexa app as well.


That being said there is likely an issue with MRM itself, but I guess playing music using MGM, instead of mixing between single and MGM, may help better avoid the issue.

Thanks for the update. Now that you know, I think it might be a good idea to pin a note in the multiroom video. I spent over 8 hrs trying to understand and figure out why it worked in the video, but never for me. I had other concerns also. The volume buttons in the player seem to only be able to point to a single device. Also there would be global coding changes within the player needed to switch from one speaker group to another. My real desire wasnt really multiroom, it was for a speaker pair to give me stereo separation and additional volume. I still enjoyed the jukebox project and find it useful. I will default it to a single device (echo input) which I can then hardwire or bluetooth connect to my desired target speakers.

I’ve post the MRM issue note in my original MRM thread. I still think the MRM should work for you, and the out-of-sync issue should matter when Alexa was asked to play music on individual device and MRM after a few times. So I am curious why it doesn’t work for you at all.

Unfortunately, grouping is fundamentally not supported by SmartThings capability model. However, to adjust volume across to different devices, you may consider to use the Number variable, and a rule to set volumes on the desired devices using this Number variable, when this variable value changes. So the variable value can be adjusted in the dashboard, and populated to multiple devices’ volume level.

Hi James -

I’m trying to make this work. Hubitat hub user. The step about grabbing the uri: and referencing the “x-rincon-queue:RINCON…” string from the device view of the Sonos speaker I’m targeting and plugging that into the playTrack action doesn’t seem to have the desired result.

My desire is to have the rule execute a Spotify Playlist on that Sonos speaker. But, all I can get it to do is to simply continue playing an already chosen playlist on that speaker, and not even the one I want. If I use the native Sonos app and chose the Spotify playlist I want and begin playing it, then executing the rule will continue to play that playlist. But, if there is nothing playing in the queue on the speaker, executing the rule does nothing.

Any thoughts on how to program the rule to target a particular Spotify Playlist? Ideally the dashboard will have a few buttons that map to rules for playlist a, playlist b, playlist c, etc. and if I click the tile for playlist a, that playlist begins playing at the top of its list. Then if I click the tile for playlist b the playlist that was playing is blown away and replaced with playlist b.

Thanks for any thoughts.

There’s another trick you can use for playing Spotify playlists. Sonos supports a special format for playing Spotify content… let me see if I can find the notes from when I tested that…

Hi

I’m using the hyperlink + rule option to open a radio stream on my echo and it works really well.

Is there any way to have the tile function as a toggle? i.e.Tap to run rule and then tap to stop music?

Thanks

@Ronan_Ryan, there are a couple ways to do it. You can add a IF_Condition in the rule to check the current echo status. If the echo is not playing, then play the radio; otherwise, pause echo. (Please also note that you can just add the rule tile in the dashboard directly, instead of Hyperlink tile with the $runRule() syntax.)

The downside of this approach is you cannot tell the echo status by looking at the tile since rule or hyperlink tile doesn’t have “active/inactive” status.

The other approach is to create a True/False variable (or a virtual switch with a few more steps). Create a rule to play or pause echo based on the variable status, and another rule to sync echo’s status to the variable in case the echo is asked to play from somewhere else or via voice control. Then add this variable to the dashboard and change its tap action from toggle to hyperlink where you can do the $runRule() syntax like you did with the hyperlink tile, and customize the icon/color based on the variable value, so you can tell if echo is playing by looking the tile. See screenshots below for details:

Create a True/False variable.

Rule 1: Play or pause echo based on the variable status when this rule is executed from the dashboard

Rule 2: Sync variable status when echo status is changed

Add the variable to the dashboard and customize tap action, icon and color as desired.

Hi Josh,
I’m not sure if I’m missing something here, but how do I connect to a spotify playlist I created to play on a specific sonos speaker? I can see how to do it with a song but not a playlist in spotify.
M

Hi @Mark_W, welcome to the community.
You will need to create a preset in Sonos and add your Spotify playlist in the Sonos preset, and use playPreset/playTrack command (depends on if you use SmartThings or Hubitat hub) to play this preset.
Please refer to how to create rule to change the playlist section in the original post for more details.

Thanks James - My presets only appear to be single tracks on media sources when I look in my Smartthings IDE. I created a Sonos playlist (called Gym IT) from the Spotify playlist (Gym), but in the IDE on the device it only ever shows singular track info. How do I create a Sonos Preset that is the playlist that I can reference when calling on with playPreset and the relevant ID?