Squeezebox (Logitech Media Server) Control for Smartthings

Hi Melinda,

Thanks for the quick reply. unfortunately the url doesn’t stream directly it attempts to download a .m3u file. I was able to save the link as a playlist item and play from the playlist, but the following command doesn’t work in the preset.

“playlist”,“play”,“majic107”

Thanks in advance!

-Rod

Ok, I’m a bit confused as to what you did. How did you create the playlist inside of LMS? It shouldn’t have anything to do with the downloaded link.

Find the station through LMS. I found Majic 107.5 under Radio > Music > Soul. Only weird note is I first found it through search and play links don’t work in LMS search results for me. Navigating through the Radio menu options worked like a charm.

Start playing it.

Save it, using the Save button in the bottom right of the web interface. Name it majic107.

Then your command should work.

If you were referencing the playlist downloaded to your device, it will not find it that I am aware of.

I’ve followed the steps above and have no trouble getting this all to work, including adding it as a player preset.

Awww shoot! I figured out the issue. We did basically the same steps. Once the playlist is created…its saved to a local folder. My issue was attention to detail. I modified your code to add a few more presets. I had to correct my references to button4. Quick switch to button5…now all good. Thanks!

def button5() {

sendEvent(name: “buttonFive”, value: “on”, isStateChange: true, displayed: false)
def playerId = device.deviceNetworkId
def params = button4Command
if (params) {
if (button4Extra == “shuffle” || button4Extra == “both”) {setPlaybackShuffle(“1”)} else (setPlaybackShuffle(“0”))
if (button4Extra == “repeat” || button4Extra == “both”) {setPlaybackRepeatMode(“2”)} else (setPlaybackRepeatMode(“0”))
parent.makeJSONcall(params, playerId, “JSONhandler”)
}
sendEvent(name: “buttonFive”, value: “off”, isStateChange: true, displayed: false)

}

Oh good, you have it working. I am considering adding a SmartApp to allow additional presets that you wouldn’t see in the device, but would be assigned to virtual buttons. You may have just bumped up my interest in doing so.

That would be way cool…between presets and momentary button things are getting a little confusing and crowded as I add more piCorePlayers throughout the house! But this is sooooo awesome! :slight_smile:

Can you please help me out…I am not getting any players detected. If I try to add a MAC address, it just hangs then eventually errors out. Trying to get these installed to move on with my install and I just can’t figure out why they are not beind discovered either in the device or using the smartapp.

Thanks in advance, the whole thing is awesome…just want to get it to work.

Tony

Sounds like you don’t have the server device set up correctly. It must be manually installed through the IDE and the correct IP address entered. If you are doing anything with the ports in LMS that could be a problem.

If the install helper app isn’t finding players then your server is not configured correctly.

If you have logs that might help.

@mellit7
Thanks for producing this handler. I got it running with no problems.

I have the basics of play, pause, volume and on/off working fine for my two players. I can see from the app and this thread that I could define presets for playlists and I believe presets for individual radio stations.

I suspect it may be impossible due to limitations in Smartthings but I was wondering if there would be anyway for you to allow access to the music library so that via the Smartthings app one could browse the library and select a track or album or artist to start playing. Certainly I would expect this information is accessible via the LMS server but it maybe too much for the Smartthings app to cope with.

Defining buttons to link to playlists is a reasonable solution for most people for merely playing music, but it would be unfeasible to define a button for each individual radio station and clearly a playlist is also not suited for a list of radio stations.

Another thing would if you could show on the button or somewhere the artwork for the currently playing ‘track’ would also be nice. Again this is accessible from the LMS.

I’m glad you are find this useful. Thanks for supplying feedback and suggestions. It is always good to be reminded of the different interests in Smartthings. I am more interested in an automation approach first and control second. But, I do understand your desire for centralizing as much into one app as possible.
limit building a navigation tool. Devices themselves will not allow for dynamic content, and while it probably could be done in a Smartapp, it is significant effort that I’m not able to take on, especially since there are already other separate apps that can handle those functions. I also don’t plan to make any major changes until the new development environment for LAN devices is defined.

As for art work, I would love to have that, but know of no way to have an image as part of a device, especially one that would change. Again, a limitation of Smartthings.

I will suggest that if you do want to consolidate control of several disparate apps into one place, Action Tiles is a great tool for that. I do use it pull together a lot into one screen. I’m currently creating a new set of panels for my tablet to minimize the need to open the Smartthings app, since Action Tiles loads much faster and can show me more.

What you’ve asked for is easily available through Action Tiles. Here is a screen shot of one of my music control panels.

As you can see, I can load artwork via an HTML link, and a link back to the LMS server library for browsing using the same technique. I’m tapping into the Material skin, which I highly recommend, it works great for big and small screens.

I also have my SqueezePi controls from Smartthings, a couple of buttons for presets, the ability to turn on and off my receiver zone 2 (via Smartthings), and am using AutoApps to send commands back to Tasker to handle some device level commands for my Kitchen speakers (through Harmony Hub and harmony plugin). That’s a lot in one screen.

Sorry I am not more help. Would love to hear of other ideas and solutions,

@mellit7
Do you have an article detailing how to add Squeezebox to ActionTiles? I presume it still requires your device handlers.

Forgive me if you already know most of this.

Action Tiles (@tgauchat) is a separate web page based service that tightly integrates with Smartthings. It is a paid service, about the cost of adding a sensor to Smartthings, so in my mind well priced for what you get, personalized custom control of Smartthings devices with some bonus integrations as well.

Since your players are already defined in Smartthings, they can be used in Actions Tiles with no additional work other than authorizing them as part of the set up. You treat them like any other “thing” tile, when you add it you select the music player capability for the player and Action TIles knows how to handle it from there. The artwork is an HTML tile link back to LMS as well as the browse music library tile. I posted a link for it in an earlier post in this thread.

Hope this answers your questions. The Action Tiles forums are full of help and ideas on how to use it.

1 Like

Hi Melinda,

Thanks again for all of your hard work developing this! I absolutely love it! I’ve started integrating with Action Tiles. I have a couple of questions for you.

  1. Does your album art on your Action Tiles panel update as each song changes?

  2. What url are you using to populate your “My Media” link in Action Tiles? Is the url pointing to locally stored album art? I’m using Spotify playlist in LMS and would like to point the album art for each song in the playlist to an Action Tiles panel for my players.

I tried right clicking on the artwork for the current song playing in the LMS UI (https://i.scdn.co/image/513933125404c7d706a0081008b40b52b266ee88), of course that didn’t work because that changes after each song.

Is there a way to dynamically up the “My Media” link in Action Tiles as songs change?

Thanks,
Rod

Disregard! I found what is needed. Thx

http://<server>:<port>/music/current/cover.jpg?player=<playerid>

Great! Glad you found the correct link. I think there is a setting in action tiles that determines refresh interval, but not extremely knowledgeable in that area.

Hi Melinda,

Unfortunately I have no coding experience, but some decent ideas. I would like to have the ability control the volume of a given player by voice. Similarly how I control presets by voice with the momentary buttons. My idea would be that calling the momentary button would increment up/down by 2.

Is there any easy way to accomplish this?

How can I call the setlevel (level) definition?

Will I have to use Webcore or can I invoke somehow with a momentary button?

Thanks,
Rod

With Webcore this should be doable, but I’m not sure I’ve ever done relative volume testing, but as I review the code, it should work as is.

You would need to create your momentary buttons. Then in Webcore set your condition as when the button is pressed. The action would then be performed on the player of choice as the device and the action would be a setLevel command with a parameter of “+2” or “-2”. The plus and minus indicate relative volume changes.

I don’t have time to do extensive testing, so if you aren’t comfortable with Webcore, I can probably throw a quick Smartapp together, but you will have to be willing to do the heavy testing and report back to me.

Looked quickly at existing Button Control SmartApp. Give me an hour or so, and I think I can add the functions to it, but again, with limited “beta” level implementation. Will update when it is ready.

I have updated the Button Control SmartApp to add a volume up and volume down option. Minimal testiing looks ok, but that is all I have done right now. The volume change is in increments of 2 right now, hopefully later I can make that an input value, but this is the only tiny window of time I have right now, before things get busy for a while here.

Hi Melinda,

Thank you soo much! I’ll test. I appreciate your time.

Sincerely,
Rod

Hi all,

Being new to SmartThings and having used Squeezeboxes since the first Slimdevices days I was really pleased to see this. Many thanks Melinda! :slight_smile:

I’ve got it partly working with my setup but I seem to be missing some functionality. I’m not sure if I’m misunderstanding the capabilities or way to go about things, so here goes… I’m using a v3 hub and have both apps installed. I’ve got all five of my players installed and I can control them with both apps. However I want to use Scenes so that I can control them using Google Home. While setting up a scene in the new app I only have the following options available for each player:

Power
Music player (Play, Pause, Stop)
Volume
Mute
Unmute
Media track control (Next, Previous)

If I use the classic app then there is even less available, just the power control. I’d like to be able to select playlists and change the shuffle settings. I could access each player directly from within Google Home but that also only offers power control so I can’t do it that way either.

Maybe I need to be using an extra app to access these other settings or maybe it has been broken by SmartThings recently? Can anybody please confirm what I should be able to access from within the apps?

Many thanks!