]> git.basschouten.com Git - openhab-addons.git/commitdiff
Update README.md (#15209)
authorjoke24 <info@jonaskemmer.de>
Mon, 17 Jul 2023 15:27:20 +0000 (17:27 +0200)
committerGitHub <noreply@github.com>
Mon, 17 Jul 2023 15:27:20 +0000 (17:27 +0200)
Added sample to play Web Radio URI.
I had to do a lot of searching to find out, that you have to put "x-rincon-mp3radio://" before the Stream-URL url. Hope this helps someone.

Signed-off-by: joke24 <info@jonaskemmer.de>
bundles/org.openhab.binding.sonos/README.md

index 80a8b3f4747f31ecddb1bf7d34ee21eb6af10b2e..d2731c89b86d6ea7e4aa7851877e978c0c7d014f 100644 (file)
@@ -149,6 +149,8 @@ Switch Sonos_Mute         "Mute"             <soundvolume_mute> (Sonos) {channel
 Switch Sonos_LED          "LED"              <switch>           (Sonos) {channel="sonos:PLAY1:living:led"}
 String Sonos_CurrentTrack "Now playing [%s]" <text>             (Sonos) {channel="sonos:PLAY1:living:currenttrack"}
 String Sonos_State        "Status [%s]"      <text>             (Sonos) {channel="sonos:PLAY1:living:state"}
+String Sonos_PlayUri      "Playing URI [%s]" <text>             (Sonos) {channel="sonos:PLAY1:living:playuri"}
+Switch PlayWebRadioUri
 ```
 
 demo.sitemap:
@@ -163,6 +165,21 @@ sitemap demo label="Main Menu"
         Switch  item=Sonos_LED
         Text    item=Sonos_CurrentTrack
         Text    item=Sonos_State
+        Text    item=Sonos_PlayUri
+        Switch  item=PlayWebRadioUri
     }
 }
 ```
+
+sonos.rules:
+
+```java
+rule "Sonos Play Web Radio URI"
+when Item PlayWebRadioUri changed to ON
+then
+    //Set URI to play
+    Sonos_PlayUri.sendCommand("x-rincon-mp3radio://https://streams.egofm.de/egoFMBW-hq")
+    //Set the Volume
+    Sonos_Volume.sendCommand(40)
+end
+```