Hi! I got this working in my sitemap. I can select different playlists or radio stations from this
This is the rule
val String Squeeze_OliverMAC = “”
val String Squeeze_StueMAC = “”
val String Squeeze_SurroundMAC = "
val String Squeeze_KitchenMAC = “”
val String Squeeze_RuneMAC = “”
val String Squeeze_BedroomMAC = “”
val String Squeeze_MarkusMAC = “”
val String Squeeze_WorkshopMAC = “”
val org.eclipse.xtext.xbase.lib.Functions$Function2 squeezeplaylist = [
String player,
String playlist |
logInfo(“squeezeplaylist.rules”, "In squeezePlayPlaylist with player of " + player)
var String station
var String requestURL
var boolean success = true
switch(playlist) {
case “0” :
station = “http%3A%2F%2Fopml.radiotime.com%2FTune.ashx%3Fid%3Ds87164%26formats%3Daac%2Cogg%2Cmp3%2Cwmpro%2Cwma%2Cwmvoice%26partnerId%3D16%26serial%3Df29bc9c96a57a8e16b521da616db3839”
case “1” :
station = “%09http%3A%2F%2Fopml.radiotime.com%2FTune.ashx%3Fid%3Ds216726%26formats%3Daac%2Cogg%2Cmp3%2Cwmpro%2Cwma%2Cwmvoice%26partnerId%3D16%26serial%3D2f8e3d8bf8c32452f470e9e55461fb14”
case “2” :
station = “http%3A%2F%2Fopml.radiotime.com%2FTune.ashx%3Fid%3Ds24861%26formats%3Daac%2Cogg%2Cmp3%2Cwmpro%2Cwma%2Cwmvoice%26partnerId%3D16%26serial%3D2f8e3d8bf8c32452f470e9e55461fb14”
case “3” :
station = “http%3A%2F%2Fopml.radiotime.com%2FTune.ashx%3Fid%3Ds9085%26formats%3Daac%2Cogg%2Cmp3%2Cwmpro%2Cwma%2Cwmvoice%26partnerId%3D16%26serial%3Df29bc9c96a57a8e16b521da616db3839”
case “4” :
station = “%09http%3A%2F%2Fopml.radiotime.com%2FTune.ashx%3Fid%3Ds128359%26formats%3Daac%2Cogg%2Cmp3%2Cwmpro%2Cwma%2Cwmvoice%26partnerId%3D16%26serial%3D2f8e3d8bf8c32452f470e9e55461fb14”
case “5” :
station = “http%3A%2F%2Fopml.radiotime.com%2FTune.ashx%3Fid%3Ds69060%26formats%3Daac%2Cogg%2Cmp3%2Cwmpro%2Cwma%2Cwmvoice%26partnerId%3D16%26serial%3D2f8e3d8bf8c32452f470e9e55461fb14”
case “6” :
station = “https%3A%2F%2Fapi.voicerss.org%2F%3Fkey%3Dbe1cf2d7464b42a692baaeade72db451%26f%3D44khz_16bit_stereo%26hl%3Den-gb%26src%3DThis%2520is%2520Major%2520Tom%2520to%2520Ground%2520Control”
case “7” :
station = “”
case “8” :
station = “spotify%3Auser%3Ai%3Aplaylist%3A4R0GXciJ7Wfmjl86t6oHvE”
default : {
logError(“squeezeplaylist.rules”, “Received a request for an unknown playlist!”)
success = false
}
}
if (success == true) {
requestURL = “http://URL OF LOGITECH MEDIA SERVER/status.html?p0=playlist&p1=play&p2=” + station + “&player=” + player
logInfo(“squeezeplaylist.rules”, "Sending playlist request to server: " + requestURL)
sendHttpGetRequest(requestURL)
}
]
rule “Squeeze_Oliver_Play_PlayList”
when
Item Squeeze_Oliver_Play_PlayList received command
then
if (Squeeze_Oliver_Power.state == ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Oliver Squeezebox”)
squeezeplaylist.apply(Squeeze_OliverMAC, receivedCommand.toString)
}
end
rule “Squeeze_Stue_Play_PlayList”
when
Item Squeeze_Stue_Play_PlayList received command
then
if (Squeeze_Stue_Power.state==ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Stue Squeezebox”)
squeezeplaylist.apply(Squeeze_StueMAC, receivedCommand.toString)
}
end
rule “Squeeze_Surround_Play_PlayList”
when
Item Squeeze_Surround_Play_PlayList received command
then
if(Squeeze_Surround_Power.state==ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Surround Squeezebox”)
squeezeplaylist.apply(Squeeze_SurroundMAC, receivedCommand.toString)
}
end
rule “Squeeze_Kitchen_Play_PlayList”
when
Item Squeeze_Kitchen_Play_PlayList received command
then
if(Squeeze_Kitchen_Power.state==ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Kitchen Squeezebox”)
squeezeplaylist.apply(Squeeze_KitchenMAC, receivedCommand.toString)
}
end
rule “Squeeze_Rune_Play_PlayList”
when
Item Squeeze_Rune_Play_PlayList received command
then
if(Squeeze_Rune_Power.state==ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Rune Squeezebox”)
squeezeplaylist.apply(Squeeze_RuneMAC, receivedCommand.toString)
}
end
rule “Squeeze_Bedroom_Play_PlayList”
when
Item Squeeze_Bedroom_Play_PlayList received command
then
if(Squeeze_Bedroom_Power.state==ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Bedroom Squeezebox”)
squeezeplaylist.apply(Squeeze_BedroomMAC, receivedCommand.toString)
}
end
rule “Squeeze_Markus_Play_PlayList”
when
Item Squeeze_Markus_Play_PlayList received command
then
if(Squeeze_Markus_Power.state==ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Markus Squeezebox”)
squeezeplaylist.apply(Squeeze_MarkusMAC, receivedCommand.toString)
}
end
rule “Squeeze_Workshop_Play_PlayList”
when
Item Squeeze_Workshop_Play_PlayList received command
then
if(Squeeze_Workshop_Power.state==ON){
logInfo(“squeezeplaylist.rules”, “Playing playlist on Workshop Squeezebox”)
squeezeplaylist.apply(Squeeze_WorkshopMAC, receivedCommand.toString)
}
We have the sitemap config
Selection item=Squeeze_Oliver_Play_PlayList mappings=[0=“Nova Fm”, 1=“myRock”, 2=“DR P3”, 3=“The Voice”, 4=“Pop FM”, 5=“DR P5”, 7=“Test”]
and the items
Number Squeeze_Oliver_Play_PlayList “Play a radio station” <audio_playlist>
You would need to change the mac adress of the players, and the url for the items can be found in the logitech media server and you need to convert the url with this tool URL Decoder/Encoder and press encode. Not exactly sure if this is what you wanted but here you have it
Or look at this thread for more Squeezebox Playlist selection? - #14 by Oliver_Roed_Scholer