I have been using OH1 for quite some time, and have now started the merge towards OH2.
For my first ‘hello world’ test, I am trying to use an Amazon Echo Dot to play/pause my Sonos kitchen speaker.
I have OH2 beta 4 installed on a Raspi3, and can access the UIs through the web interface. I installed the Sonos binding through the paper UI, and it automagically found my speakers (nice feature!). Through the paper UI I can control the speaker, and play/pause. So far, so good.
I then want to set up my own sitemap, and make a simple test switch to play/pause the speaker. Later, I can make Alexa control the switch, without exposing it in the UI.
This is where I start to struggle…
The Sonos device is in the paper UI, but I guess that I need to create it in config through Eclipse as well, to make the Switch item.
I have simplified as much as possible, to try and locate the problem.
The only config file in the system is:
sonos.items
Player SonosKitchenControl "Control [%s]" { channel="sonos:PLAY3:RINCON_XXXXXXXXXXXXXXXXX:control"}
Switch SonosKitchenOnOff "Play/Pause" { sonos="[ON:sonos:PLAY3:RINCON_XXXXXXXXXXXXXXXXX:control:play], [OFF:sonos:PLAY3:RINCON_XXXXXXXXXXXXXXXXX:control:pause]"}
and the simple sitemap:
test.sitemap
sitemap test label="Main Menu"
{
Frame label="Sonos Kitchen" {
Default item=SonosKitchenControl label="Sonos" icon="settings"
Switch item=SonosKitchenOnOff
}
}
When I navigate to the classicUI and append the sitemap to the url, i get the two items, as expected. However, only the ‘Player’ item is working. I get a play and a pause button, which works perfectly.
I also get the switch item shown, but nothing happens when I use it.
I have tried replacing ‘play’ and ‘pause’ with ‘start’ and ‘stop’, with no change.
It is great that the stability has improved for the OH2 Sonos binding, but the documentation is extremely limited: https://github.com/sumnerboy12/openhab2/tree/master/addons/binding/org.openhab.binding.sonos
Any tips, or pointing out any obvious mistakes I made, will be appreciated.
(on a side note: It seems that when you create a new sitemap through eclipse, you need to restart the system (or maybe just OH), before the sitemap is available to browse. This took me a bit of time to realise)