Ankündigung

Einklappen
Keine Ankündigung bisher.

Sonos-Notification

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Sonos-Notification

    Hallo,

    ich bin ganz neu im Bereich OpenHab. Ich habe gestern Openhab auf meinem Raspberry installiert und läuft auch soweit. Nun möchte ich Sonos einbinden, was auch schon ganz gut klappt.
    Eine Funktion, die ich gerne nutzen möchte ist die Notification. Daher habe ich folgendes angelegt:

    Sonos.items:
    Code:
    Group Sonos <player>
    Player Sonos_Controller   "Controller"                          (Sonos) {channel="sonos:PLAY5:living:control"}
    Dimmer Sonos_Volume       "Volume [%.1f %%]" <soundvolume>      (Sonos) {channel="sonos:PLAY5:living:volume"}
    Switch Sonos_Mute         "Mute"             <soundvolume_mute> (Sonos) {channel="sonos:PLAY5:living:mute"}
    Switch Sonos_LED          "LED"              <switch>           (Sonos) {channel="sonos:PLAY5:living:led"}
    String Sonos_CurrentTrack "Now playing [%s]" <text>             (Sonos) {channel="sonos:PLAY5:living:currenttrack"}
    String Sonos_State        "Status [%s]"      <text>             (Sonos) {channel="sonos:PLAY5:living:state"}
    String Sonos_Radio        "Radio"                               (Sonos) {channel="sonos:PLAY5:living:radio"}
    String Sonos_Notificationsound "Notificationsound"              (Sonos) {channel="sonos:PLAY5:living:notificationsound"}
    Sonos.things:

    Code:
    Thing sonos:PLAY5:living [ udn="RINCON_xxx", refresh=60, notificationVolume=25]
    Thing sonos:PLAY1:bath_up [ udn="RINCON_xxx", refresh=60, notificationVolume=25]
    Thing sonos:PLAY1:kitchen [ udn="RINCON_xxx", refresh=60, notificationVolume=25]
    Meine Rule:

    Code:
    rule "Sonos Notfication"
    when
        Item Licht_UG_buero_decke received command
    then
        
        Sonos_Notificationsound.sendCommand(if (receivedCommand == ON) "essen.mp3" else none)
    end
    Allerdings wird nur der letzte Titel abgespielt, der auf dem Player lief. Was mache ich falsch?

    Ich habe schon den Pfad geändert (/etc/openhab2/sounds/essen.mp3) allerdings brachte es auch nichts.

    Für jeden Tipp bin ich dankbar.

    Gruß Manuel

    #2
    Hallo Manuel,

    bei mir läuft das mit dieser rule:
    Code:
    // Klingelzeichen
    rule "Klingelzeichen"
    when
        Item Z_Klingel_Haustuer changed from OFF to ON
    then  
        {
        logInfo("Klingl", "Es hat geklingelt. Jemand steht vor der Tür")
        sendCommand(sonosWZSave, "ON")              //saves what is currently playing
        sendCommand(sonosWZNotificationVol, 10)     //sets the notification volume
        sendCommand(sonosWZNotification, "http://a.b.c.d:8080/static/tuerklingel.mp3")  //the sound file to play
        sendCommand(sonosWZRestore, "ON")           // restores the previously playing music
        }
    end
    PS: ja ich weiss, ist noch die alte "sendCommand Syntax ... muss ich noch ändern 😐

    und die Items:
    Code:
    String sonosWZNotification      "Notification Sound"    <songtitle>     {channel="sonos:PLAYBAR:wz:notificationsound"}
    Dimmer sonosWZNotificationVol   "Notification Volume"   <volume>        {channel="sonos:PLAYBAR:wz:notificationvolume"}
    Switch sonosWZSave              "Save Playlist"                         {channel="sonos:PLAYBAR:wz:save"}
    Switch sonosWZRestore           "Restore Playlist"                      {channel="sonos:PLAYBAR:wz:restore"}

    die mp3 Datei muss im Verzeichnis /etc/openhab2/html liegen.

    Einziges Problemchen ... Anscheined gibt das Sonos Binding die Lautstärke für die Notification nicht durch. Hier wird das Default Volume für den Notification Sound genutzt ...
    Hat da jemand schon eine Lösung?

    Gruß
    Frank
    Zuletzt geändert von azzkikrboy; 01.04.2020, 18:48.

    Kommentar


      #3
      HI,
      Zitat von azzkikrboy Beitrag anzeigen
      [/CODE]


      die mp3 Datei muss im Verzeichnis /etc/openhab2/html liegen.
      das war die Lösung.

      Gruß und danke

      Kommentar

      Lädt...
      X