Hi
Here the ddefinition section of the players in the openhab.cfg file
Id (MAC address) of your first Squeezebox. MAC addresses of players are case-sensitive.
Use small letters (a-f) if the address contains them. Example:
entries for players/raspberry pi’s
squeeze:livingroom.id=b8:27:eb:85:60:b7
squeeze:kitchen.id=74:da:38:26:9d:48
squeeze:guestroom1.id=74:da:38:26:b1:28
squeeze:library.id=b8:27:eb:e5:1f:6b
squeeze:mainbedroom.id=b8:27:eb:cd:16:00
squeeze:guestroom2.id=b8:27:eb:d4:cb:fe
squeeze:unknownplayer.id=b8:27:eb:bf:d0:91
entries ending in sq are the entries for the o2jogglers/controllers
squeeze:livingroomsq.id=00:0e:8e:22:8e:44
squeeze:kitchensq.id=00:0e:8e:24:fc:59
squeeze:guestroom1sq.id=00:0e:8e:24:d7:b8
squeeze:mainbedroomsq.id=00:0e:8e:24:c4:09
squeeze:guestroom2sq.id=00:0e:8e:24:cc:36
and here is the items file (i only did 2 of the players to start with)
/* SqueezeBox */
Missing declarations
Group gPlayerPower
Group gPlayerPowerAll
Group gPlayerPowerOG
Group gPlayerVolume
Group gTV
Group gPlayerPowerEG
Number squeezeSelectedPlayer
Number squeezeSelectedStation
Switch squeezePlay
Switch squeezelivingroomPower “livingroom” (gPlayerPower, gPlayerPowerOG) { squeeze=“livingroom:power” }
Switch squeezelivingroomPlay “livingroom” { squeeze=“livingroom:play” }
Dimmer squeezelivingroomVolume “livingroom [%.1f %%]” (gPlayerVolume) { squeeze=“livingroom:volume” }
Switch squeezekitchenPower “kitchen” (gPlayerPower, gPlayerPowerOG) { squeeze=“kitchen:power” }
Switch squeezekitchenPlay “kitchen” { squeeze=“kitchen:play” }
Dimmer squeezekitchenVolume “kitchen [%.1f %%]” (gPlayerVolume) { squeeze=“kitchen:volume” }
and finall the rules file
import org.openhab.core.library.types.*
import org.openhab.model.script.actions.*
import org.openhab.action.squeezebox.*
// Handle squeezebox radio station UI
rule "SqueezePlayerRadioStation"
when
Item squeezePlay changed
or
Item squeezeSelectedStation changed
or
Item squeezeSelectedPlayer changed
then
logInfo("squeeze.rules", "SqueezePlayerPlay")
var String [] players = newArrayList("livingroom", "kitchen","guestroom1","guestroom2","library","mainbedroom");
var String[] urls = newArrayList(
"http://stream.srg-ssr.ch/drs1/mp3_128.m3u", // Radio SRF1
"http://stream.srg-ssr.ch/drs2/mp3_128.m3u", // Radio SRF2
"http://stream.srg-ssr.ch/drs3/mp3_128.m3u", // Radio SRF3
"http://www.swissgroove.ch/listen.m3u", // Swiss Groove
"http://icecast.argovia.ch/argovia128.m3u", // Radio Argovia
"http://stream.srg-ssr.ch/rsj/mp3_128.m3u", // Swiss Jazz
"http://mp3-live.swr3.de/swr3_m.m3u" // SWR 3
)
logInfo("squeeze.rules", squeezeSelectedStation.toString)
var stationIndex = ((squeezeSelectedStation.state as DecimalType).intValue - 1)
var station = urls.get(stationIndex) as String;
var playerIndex = ((squeezeSelectedPlayer.state as DecimalType).intValue - 1)
var player = players.get(playerIndex) as String
logInfo("squeeze.rules", player)
logInfo("squeeze.rules", station)
if (squeezePlay.state == ON) {
squeezeboxPlayUrl(player, station)
} else {
squeezeboxStop(player)
}
end
I tried to keep to the examples but had to translate the german example to english
Any advice would be appreciated - Thanks