hi Joe,
The multi-room features are part of how Sonos works, so you can
link a source to a Sonos device, and then distribute that to any other
Sonos device you have. Below is how I implement the doorbell in my
house:
in .rules:
rule DoorbellPracticeRule
when
Item DoorbellPractice changed to ON
then
stateSwitches.sendCommand(ON)
Thread::sleep(1000)
volumes.sendCommand(50)
SonosURIs.sendCommand("guestbathroom")
playSound("doorbellpractice.mp3")
stateSwitches.sendCommand(OFF)
end
in .items:
Switch practiceSwitch (stateSwitches) {sonos="[ON:practice:save],[OFF:practice:restore]"}
Switch masterbathroomSwitch (stateSwitches) {sonos="[ON:masterbathroom:save],[OFF:masterbathroom:restore]"}
Switch diningroomSwitch (stateSwitches) {sonos="[ON:diningroom:save],[OFF:diningroom:restore]"}
...
and
Dimmer diningroomVolume (volumes) {sonos="[diningroom:volume],
[INCREASE:diningroom:volume],
[DECREASE:diningroom:volume]", knx="5.001:5/2/5,3.007:5/2/4"}
....
and
String practiceURI "URI is [%s]" (SonosURIs) {sonos="[practice:playline]"}
String masterbathroomURI "URI is [%s]" (SonosURIs) {sonos="[masterbathroom:playline]"}
String diningroomURI "URI is [%s]" (SonosURIs) {sonos="[diningroom:playline]"}
....
to be complete, the "guestbathroom" sonos player happens to be
the instance that is connected to my openHAB host line-out (all my Sonos
players are in a 19" rack in the basement, I just happened to pick one
at random to connect to my OH host). In short, the script stores the
actual state of the Sonos's in the house, then sets the volume on all
devices, make them connect to the line-in of the guestbatrhoom player
(e.g .OH host), play the doorbell.mp3 file on the OH host, and finally
restore all the previously stored states (so that a player playing your
favorite playlist will return to doing that after that the doorbell.mp3
is played)
The same can be achieved also by first grouping all the players
into a single group (a sonos feature), and then have that group play the
line-in of the guestbatrhoom device. Grouping is also a sonos feature
whereby a single source of music is "synced" accross a number of devices