Sonos Binding in OpenHAB2 - definition of Switch/Button that acts as Play/Pause

Dear all,

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?

Best regards
Sebastian

Hi Sebastian, do you find solution?
UPD: Seems to be it’s not supported, maybe only volume, answer is here http://docs.openhab.org/addons/io/homekit/readme.html

Dear Altabaev,

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