Squeezebox (Logitech Media Server) Control for Smartthings

Curiosity question -

Is anyone using any of the Android apps that makes your phone/tablet into a Squeezebox player, not controller, player? Since they are paid apps and I’ve never needed that functionality, I haven’t used one. I’m wondering how well they work.

It dawned on me that if the apps work, then old phones/tablets can be used as ST speakers. If I ever decide to set up Action Tiles, then in theory, I could have the tablet pull double duty as a speaker.

Just figured this out, speaking of Action Tiles, assuming it handles LAN http calls, the address

internalIP:9000/?player=xx:xx:xx:xx:xx:xx

will bring up the web ui with the player specified by the MAC address selected so you can access your full music library with a simple tile tap, so you can play more than just the presets, because, sometimes you just want something different. I find the ability to specify a player useful, because different rooms might use different players.

Yes, I use old Android devices all around the house with their using Squeeze player app. Works great. I also have an old Android tablet with Action Tiles, motion sensor and also as a speaker for squeeze. All works great! Tablet was a pain to set up to sleep and wake up with motion but finally got a recipe to work.

Thanks for the tips on music tiles. Will have to try that out.

Quick question from a noobie with groovy on ST. If I add a custom command to a device handler, do I need to uninstall the device and reinstall/rediscover to see it? Trying to do that and add a voice command for webCORE. But not showing up.

No you do not need to delete the device. However, for it to be exposed outside the device to WebCore, you have to define it with the command statement. It goes in the same area as capabilities and attributes definitions. I do this in my code if you need an example.

Thanks for the player app info.

Yes, that’s exactly what I had tried. However didn’t show up in webcore choices for that squeeze player device. I think I may need to remove and add back the device in webCore. Maybe webCore keeps the old device handler? Anyways, I’ll play with it :slight_smile:

command “extVoice”, [“string”]

Got it to work. I added the command and use webCORE adding string parameters and can change to any voice (even switching voices in one Piston). Now it’s getting good.

Basically created the setVoice command and its awesome. However a better way would have the voice choices available in webCORE but not there yet. good stuff.

However I have to say, I still don’t know how to refresh webCORE to see the new custom commands after editing the device handler. I got lucky somehow and it finally picked it up. But it’s painful if you want to edit the device handler and see the results right away in webCORE :frowning:

ignore the webCORE thing. seems to be a browser cache issue. Using icognito works better.

Hi Melinda,

I added the setVoice into the squeeze player as show below however I have not added a “bad input” handler yet to check if it’s a valid voice, working on a clean way to do that.

def setVoice(sentvoice) { //Eugene - added command to receive Voice externally such as webCore
state.customVoice = sentvoice
}

def getSound(msg) {
def myVoice = state.customVoice ?: speechVoice ?: “Salli(en-us)”

def setVoice(sentvoice) { //Eugene - added command to receive Voice externally such as webCore
state.customVoice = sentvoice
if(sentvoice && ![“Zhiyu(cmn-CN)”,“Ivy(en-us)”,“Joanna(en-us)”,“Joey(en-us)”,“Justin(en-us)”,“Kendra(en-us)”,“Kimberly(en-us)”,“Salli(en-us)”,
“Amy(en-gb)”,“Brian(en-gb)”,“Emma(en-gb)”,“Miguel(es-us)”,“Penelope(es-us)”,“Ruben(nl-NL)”,“Lotte(nl-NL)”,“Mads(da-DK)”,“Naja(da-DK)”,“Russell(en-AU)”,“Nicole(en-AU)”,
“Aditi(en-IN hi-IN)”,“Raveena(en-IN)”,“Geraint(en-GB-WLS)”,“Mathieu(fr-FR)”,“Celine(fr-FR)”,“Léa(fr-FR)”,“Chantal (fr-CA)”,“Hans(de-DE)”,“Marlene(de-DE)”,“Vicki(de-DE)”,
“Karl(is-IS)”,“Dora(is-IS)”,“Giorgio(it-IT)”,“Carla(it-IT)”,“Takumi(ja-JP)”,“Mizuki(ja-JP)”,“Seoyeon(ko-KR)”,“Liv(nb-NO)”,“Jacek(pl-PL)”,“Jan(pl-PL)”,“Ewa(pl-PL)”,“Maja(pl-PL)”,
“Ricardo (pt-BR)”,“Vitoria (pt-BR)”,“Cristiano(pt-PT)”,“Ines(pt-PT)”,“Carmen(ro-RO)”,“Maxim(ru-RU)”,“Tatyana(ru-RU)”,“Enrique(es-ES)”,“Conchita(es-ES)”,“Astrid(sv-SE)”,
“Filiz(tr-TR)”,“Gwyneth(cy-GB)”].contains(sentvoice))
state.customVoice = “”
}
ugly but does the trick

If you are looking for a simpler method, you might want to use try and catch to handle the exception a bad voice would throw.

Hi Melinda,

Might be slightly off topic however I noticed using WebCORE speak to the LMS speakers seem to a lot slower than Big Talker 2. Would you happen to know if there is a way to speed it up or is it just the nature of Logitech Media Server?

Thanks so much for this. It is very exciting to finally have a way to control Squeezebox players from SmartThings! Everything has been working great for me, except the Preset buttons. I’m following these instructions:

I am not able to trigger a playlist called ‘gg’ with “playlist”,“play”,“gg”. Any suggestions for how to troubleshoot this? Thanks!

The way this works is Big Talker 2 and this code use TTS to create a mp3 file that LMS then plays. So, LMS is only playing what is sent to it. As far as LMS is concerned, it knows no difference.

So are you asking about the speed/pace of the speech itself or the delay before the announcement starts.

If it is the speech itself, I don’t know if Big Talker 2 is doing something different to pace the speech. When I looked at that impressive set of code, I did not see anything along those lines.

If you are talking about the delay to start, as I’m guessing, then I suspect that is the difference between a SmartApp and WebCORE. I would suspect there may be some delay due to the way WebCORE is built, but I honestly haven’t done anything with WebCORE yet. I wrote a simple SmartApp to do my testing, and I didn’t notice much difference between it and Big Talker 2. Does WebCORE depend on cloud to cloud communication? If so, that could account for the delay and several seconds would not be unexpected.

I am wondering if this falls under the picky details category. When I typed the instructions, I was using a text editor, so the double quotes are the kind that one is upside down. I have no idea what they are called. So if you cut and pasted, you might have gotten those. I definitely need to fix my docs.

“playlist”,“play”,“Morning Mix”

However when I went and looked at one I have working, my double quotes are the plain boring kind that are always the same. It is possible that is tripping up the command parse. Computers are so picky!

“playlist”,“play”,“gg”

Otherwise, your command looks right. Maybe this will fix it??

Forgot to add. Playlist names are case sensitive in LMS. You must match it exactly.

benharris

    October 4

Thanks so much for this. It is very exciting to finally have a way to control Squeezebox players from SmartThings! Everything has been working great for me, except the Preset buttons. I’m following these instructions:

mellit7:
If you are using the preset buttons, they need to be changed to the JSON format. Documentation has been updated to reflect this. For example, p0=playlist&p1=play&p2=Morning%20Mix, is now “playlist”,“play”,“Morning Mix”.

I am not able to trigger a playlist called ‘gg’ with “playlist”,“play”,“gg”. Any suggestions for how to troubleshoot this? Thanks!

You are probably right. After looking at code, I don’t see anything to cause the delay. I believe the nature of webCORE is definitely through the cloud thus slowing things down.

And yes, the moment a trigger happens, the time to hear the speech from the speakers is what I was referring to. It is quite slow with webCORE compared to direct Big Talk 2 with LMS and others.

Thanks for your helpful suggestion. I figured out my problem and now feel pretty dumb. The problem was simply that I didn’t have my playlist folder set up with the correct permissions. I would create a new playlist in LMS and it appear to have worked, but it wasn’t actually being saved to the playlists folder. As a result, Smartthings-SqueezeBox-Control couldn’t find the playlist to play it.

With that fixed now, the presets are working great! Thanks again!

1 Like

Small updated has been uploaded. Wanted it done before the holidays get the best of me.

This contains a few updates related to speech and a player installation helper SmartApp.

Speech updates include new voice that I either missed or was new to Polly, Chinese voice.

The speak command now has format speak(msg,voice). Existing instances do not need changing, voice is an optional command that will override any defaults for the individual instance only. Voice must be formatted to match a voice from the selection list in the player device.

An error in the speak command will now play a “ding ding” to indicate an error, logs should contain the error details. Most often this will be from a bad voice string being used.

New SmartApp to help with player installation, especially if you have many players. Its use is optional, original manual method still works. The app will find all known LMS players for you and eliminate the need for finding and entering player MAC addresses. Server device still must be set up manually before you can use the app.

Let me know if I broke something.

Hi Melinda,

It’s me again! Trying to set a internet radio stream as a preset. Here’s what I’ve tried. Can you point me in the right direction?

“playlist”,“play”,“http://opml.radiotime.com/Tune.ashx?id=s38989&formats=aac,ogg,mp3,wmpro,wma,wmvoice&partnerId=16&serial=ec40ea682b12328d77531d1503697c1e

“playlist”,“play”,“url:http://opml.radiotime.com/Tune.ashx?id=s38989&formats=aac,ogg,mp3,wmpro,wma,wmvoice&partnerId=16&serial=ec40ea682b12328d77531d1503697c1e

Thanks in advance!

  • Rod

I will confess, non music library items like radio and plugins don’t get much use by me, so I’m not very knowledgeable here. So, here’s what little I can offer.

First of all, the “url:” prefix in the second option is unnecessary for the basic “playlist” “play” format. The simple complete url is all you need, as in the first option.

Second, the url must be one that is working if you just enter it into a web browser without having to navigate through something else. You should be able to put in the url and it should start playing. Otherwise, it won’t work. Have you tested this? Does the station have a direct url for streaming?

Can you navigate via the LMS web interface (or other app interface) to the radio station you are trying to play? If so, then you should be able to save it as a playlist once it is playing that could be referenced by “playlist”,“play”,“playlistname”. It’s a bit of a cheat, but may solve your problem.

The LMS forum is massive, but sometimes you can find a gem of information by looking around there.

Sorry I am no more help.

Melinda