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

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.

1 Like

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?

@Mark_W, see below for the detailed steps:

  1. Open Sonos mobile app. Go to “Browse” from the bottom navigation tab, select Spotify, find the specific play lists (not just a single track), tap the Spotify playlist and hold until the menu pops.

  2. Select “Add Playlist to My Sonos”. Please note that only those playlists/stations added in “My Sonos” will be shown as presets in SmartThings IDE. If you just created the Sonos playlist, there won’t be a preset created for it in ST.

  3. Now go back to “My Sonos” from the bottom navigation tab, and you should be able to find this newly added playlist from Spotify.

  4. This preset should be shown in SmartThings IDE like this, and you can create rule to play this preset.

2 Likes

Unbelievable support. Thank you so much James! Adding it to “My Sonos” was the trick I missed and I’d never have gotten it without you.

2 Likes

Really having fun creating the “Jukebox” as described. Using Hubitat with Echo Speaks and Amazon Music as my music service. Have created Media Tiles with artists, playlists and stations that work beautifully to play on my Echo devices. The only problem I am having is that the album artwork does not change when the song changes. If I press the Music Player tile settings in the lower left corner and press refresh, the song title and album artwork change to the currently playing tract. How can I get my tiles to refresh automatically? Don’t know much about rules, but thinking that using that might solve my problem. Any suggestions?

If you watch the Current States section of the device details in your Hubitat admin UI, does the audioTrackData attribute update whenever the song changes?

If not, it sounds like something about the Echo Speaks integration isn’t working as expected as the attribute should automatically update when tracks are changed. If the device attributes aren’t updating when the track data changes, it would probably be best to post in the Hubitat Echo Speaks release thread.

@Bill_Findley, does the album art eventually change after a few moments if you don’t manual refresh as described? In my experience, echo responds reasonably quickly when commends are sent over SmartThings/Hubitat, Echo Speaks smart app and the Echo Speaks virtual server you host in Heroku, but sometimes it can take tens of seconds for the data updates to be reported in SmartThings/Hubitat, and that might be the reason why you didn’t see the album art changed. It seems the latency of track data update is significantly smaller if I press next few times in a row, but the latency is more obvious when I cold start to play something. I haven’t looked into the Echo Speaks sever code/config much, and am wondering if the Heroku server goes idle/sleep if no activities for a period so there’s a delay for the data to be updated to SmartThings/Hubitat in that case.

James & Josh…thank you! I realized that I might not have the most recent update to Echo Speaks and that seemed to do the trick.
I don’t think this is available for variables but now that I have created a “Jukebox” for one of my Echo devices it would very time consuming to create rules for the same artists, playlists, stations, etc for another Echo and link it to a different dashboard. I would like to be able to select my device with a tile and use the rule for Amazon music search selecting that device.
Then I could carry around my own jukebox on my phone and have the music play on the Amazon device that is currently in the room with me. Wouldn’t that be cool?
I like it because I can never remember the names of playlists and get tongue tied when asking Alexa to play one.
If not available, please consider it in the future.

1 Like

That is indeed a cool idea. Select device based on the variable value is not currently supported, so I will have to note it down and see the interests from other users. Meanwhile, while it is not quite the same and does require some work in rules, you can use few True/False variables - kitchenEcho, bedroomEcho, garageEcho for example, and add a few IF_Conditions in your music playlist rules to check these variables’ value and decide which device to send the play (music search) command. And create another rule to turn the other variables to False, when either of them is turned True. Then added these variables tiles to the dashboard, Tap one of them to select the device first, and then the playlist/artist rule tile so the music will be played to the specific device, and by looking at those variables in the dashboard, you know which device is already selected.

3 Likes

Thanks for the advise. I have begun working on this and so far so good. A little time consuming but with the copy function of the rules I will be able to get it done without too much work. I decided to put a true/false tile for each device and speaker group.

Do you have any ideas on the use of Album Art and the media player for multiple devices? Right now I would need two 3 tiles for every Echo device (True/False, Album Art, Player).
A Visible/Invisible tile (if you had it) would not work because you can not put tiles on top of each other.
Any other great ideas?

@Bill_Findley, can you please provide a bit more details what you are trying to achieve (or the issue you have) with the 2 sets of the 3 tiles? Are you not having enough landscape for those tiles? Or something I missed?

Here is an example screenshot. I have tiles for each device, tiles for music searches (artists, stations, playlists) and a tile for the AlbumArt and one is the media play. Right now the AlbumArt and Media player tile are for one particular Echo device. I am trying to have only two tiles (one each) instead of 2 tiles for every device.
So I would either need a Media Player and AlbumArt tile be able to represent multiple Echo devices are tile on top of each other that would disappear when not active (true)
I hope that helps.

3 Likes

@Bill_Findley, thanks for the details and screenshot. The music player and album art is not able to represent multiple devices unfortunately, but you may create rules to execute play, pause, fast forward, rewind, volume-up or volume-down command on specific devices by checking the True/False variables, like your playlist rules, and add these rule tiles to the dashboard to replace the “Music Player” tile.

See the screenshot below for example. (The play tile in the screenshot is actually a True/False variable that uses $.runRule() syntax to execute a rule to send play command to the specific device and toggle the variable value to have the tile “active/inactive” color effect and change the icon.)

image

But you will have to add the album art tile for each device to be able to show the image played on each of them though.

1 Like

Thank you! That will work great. The AlbumArt is not something I need to look at on my phone anyway just something cool…but I could make a tile that gives the currently playing song.
Great timely response. Thanks again.

1 Like

Don’t forget to post your final setup in the “Show Off Your SharpTools Dashboards!” thread. I believe it will be very cool and inspiring to the others! :wink:

This looks really cool and something I have spent hours today trying to get the first step done, only to find that there seems to be an ongoing issue where echo speaks is not working in the UK :confused:

Are there any alternative options for using Echo speakers?

It sounds like some people in the main SmartThings Echo Speaks thread have figured out a workaround for UK logins:

https://community.smartthings.com/t/release-echo-speaks-v3-actions/173073/986?u=joshua_lyon

(I would also note that SmartThings had an outage for European users last night as well)

1 Like