I’m running a OpenHAB 2 server on my Raspberry since 2 weeks. Everything is working great for the time being unless that I’m not able to define a play/pause button (or switch) in my sitemap. For Z-Wave Switches I normally simply need to link the switch to the channels defintions that show up in the Paper UI, e.g. zwave:device:XYZ:switch_binary.
In case of my Sonos Connect Amp I only get a Control channel, i.e. sonos:CONNECTAMP:RINCON_XXX:control .
The integration of all buttons (play/pause/next) as a Player item works seemly.
But I could not arrange a simple Play/Pause switch in order for linking it to Homekit or something else. Any idea or does this not work?
I found a solution which was two folded. First I needed to update my openhab 2 as my version had some errors in terms of the control widget. Second I found a solution here in the forum that uses a rule for the play/pause issue that works like a charm:
// Play or pause kitchen speakers, with Alexa
rule "play or pause speakers"
when
Item Play_Or_Pause_Wohnzimmer received update
then
if (Play_Or_Pause_Wohnzimmer.state==ON) {
sendCommand(Sonos_Wohnzimmer_Control, PLAY)
} else {
sendCommand(Sonos_Wohnzimmer_Control, PAUSE)
}
end