Skip to content
Image of Sonos
Template

Sonos

by LOXONEBrand: Sonos5 (2)19,245 downloads

Description

This is a HTTP integration for a sonos speaker bassed on the API V1. Keep in mind that updated API versions may lead to functions not working.

The Sonos S2 update, released June 2020, still works with this API integration. But, it might stop working in the future if or when Sonos decide to drop the API support (or UPNP) as the control protocol.

Default port is 1400.

Inputs and outputs · 19

NameTypeCommandUnit
PlayVirtualOut/MediaRenderer/AVTransport/Control
PauseVirtualOut/MediaRenderer/AVTransport/Control
StopVirtualOut/MediaRenderer/AVTransport/Control
Next TrackVirtualOut/MediaRenderer/AVTransport/Control
Previous TrackVirtualOut/MediaRenderer/AVTransport/Control
No Shuffle No RepeatVirtualOut/MediaRenderer/AVTransport/Control
No Shuffle Repeat AllVirtualOut/MediaRenderer/AVTransport/Control
Shuffle No RepeatVirtualOut/MediaRenderer/AVTransport/Control
Shuffle Repeat AllVirtualOut/MediaRenderer/AVTransport/Control
Sleep Timer 15 MinutesVirtualOut/MediaRenderer/AVTransport/Control
Sleep Timer 30 MinutesVirtualOut/MediaRenderer/AVTransport/Control
Sleep Timer 1 HourVirtualOut/MediaRenderer/AVTransport/Control
MuteVirtualOut/MediaRenderer/RenderingControl/Control
UnmuteVirtualOut/MediaRenderer/RenderingControl/Control
VolumeVirtualOut/MediaRenderer/RenderingControl/Control
BassVirtualOut/MediaRenderer/RenderingControl/Control
TrebleVirtualOut/MediaRenderer/RenderingControl/Control
Volume UpVirtualOut/MediaRenderer/RenderingControl/Control
Volume DownVirtualOut/MediaRenderer/RenderingControl/Control

FAQ

No questions have been answered yet.

Ratings and comments

  1. Rated 5 of 5

    hat etwas gedauert... bis ich es endlich verstanden habe, nach der IP Adresse bei mir192.168.xxx.xx:1400 (Doppelpunkt 1400) anzufügen! Jetzt funktioniert es mit dem IKEA Symfonisk Lautsprecher von Sonos. :-)

  2. Rated 5 of 5

    Einfacher Aufbau und schnell Konfiguriert. Mittels Mehrfachklickbaustein, kann der Lox Tastenstandard auch für Sonos Lautsprecher verwendet werden.

Questions and answers

  1. Abspielen eines Senderfavouriten

    Open

    Ich teste für einen Kunden dieses Sonos Plugin. Das starten und stoppen über die Ausgänge ist ja kein Problem. Ist der Lautsprecher aber frisch hochgefahren hat er keinen aktiven Sender. Kann man ihm irgendwie einen Sender oder Favouriten mitteilen?

    1 reply

    1. This is not possible based on the changes of the update for the API that sonos has made.

  2. hi, warum ist es nicht möglich den Ausgang Volume zu setzen? Mein Lautsprecher geht auf Lautstärke 0. Danke

    Open

    hi, warum ist es nicht möglich den Ausgang Volume zu setzen? Mein Lautsprecher geht auf Lautstärke 0. Danke

    2 replies

    1. This is because it is not possible to zet a value over the API command's anymore as the SONOS API has been reduced by SONOS.

      So I am sorry but your are not able anymore to send values of volume to the sonos, volume up and volume down is still working. The question will be how long when using cloud controlled devices.

    2. Can not confirm your answer. I'm still usind my own application and can control all Sonos speaker (Sonos 1 and Sonos 2) with direct volume setpoint.

      Setup of http-command of Loxone:

      /MediaRenderer/RenderingControl/Control

      SOAPACTION: "urn:schemas-upnp-org:service:RenderingControl:1#SetVolume"

      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel><DesiredVolume><v></DesiredVolume></u:SetVolume></s:Body></s:Envelope>

  3. Text to Speach

    Open

    Good Morning,

    is it possible to use TTS with Sonos Library?

    Kind Regards

    Oliver

    1 reply

    1. Hello Oliver,

      This is not possible to do over HTTP.

  4. Text to Speach

    Open

    Good Morning,

    is it possible to use TTS with Sonos Library?

    Kind Regards

    Oliver

    No replies

  5. Port needs to remain in the Address properties of the Sonos device

    Open

    There is no documentation or notes that the port 1400 needs to remain at the end of the address of the device.

    1 reply

    1. added in the documentation.

  6. Http Radiosender

    Open

    Hallo kann ich über einen Http Befehl auch einen Radiosender ausführen.

    MFG Peter

    1 reply

    1. It is not possible to request a specific sours using the API.

  7. Favoriten abspielen

    Open

    Guten Tag, ist es mittlerweile möglich einen Senderfavoriten zu starten ?

    Danke

    1 reply

    1. If the command for next track is not working than there is no way to change the favorite using the API.

  8. Funktioniert leider nicht

    Open

    Gibt es eine detaillierte Dokumentation zu dem Template? Bin mit meiner Sonosanlage am Betriebssystem Sonos S2 - sollte somit noch funktionieren?

    1 reply

    1. Hello Alexander,

      We do not have any documentation on this template, this template was made years ago on the Sonos V1 API, since than they have changed a lot on the API. There are commends still working on the V2 but they are limited. So it is best to contact SONOS regarding your question if your Sonos S2 still supports the REST API and where they have the documentation of this API.

  9. Ohne Funktion

    Open

    Hi Leute, gibt es jemanden von euch der Evtl einen Youtube Chanel hat und evtl. ein Video zum Thema Sonos machen kann? Ich bekomme es einfach nicht hin. Und das regt mich echt sehr auf :-D

    1 reply

    1. Hi, Wichtig ist dass die Sonos via Router ne Fixe IP Adresse bekommt. Dann die IP adresse des Master Lautsprechers (Findest du in der App unter "Über dein System") bei dem Gerät in der Config eintragen. Mittels Impuls auf Play oder Pause, müsste der Lautsprecher dann reagieren. Hat bei mir soeben ganz gut funktioniert. z.B. Präsenzbaustein Ausgang mittels Flankenerkennung auf Play und Pause verknüpfen.

      LG

  10. Sonos Box mit Intercom

    Open

    Hallo, ich würde gerne die Sonos Box für die Klingel der Intercom nutzen. Hat sowas schon jemand gemacht bzw. wie könnte das am besten funktionieren? Vielen Dank

    1 reply

    1. Based on the limited web command's available in the API. This is mostly done by using the line out of an audioserver to a Sonos amp and letting Loxone control the Audio source over the line out. And than syncing all Sonos speakers so they play the same source as the Amp.

  11. Zwei Lautsprecher in Verbindung starten?

    Open

    Hallo Ich konnte das Template sehr gut einbinden und habe es sogar noch etwas optimiert, so das die Lautstärke mit einem langzeitdruck nach oben und unten gefahren werden kann.

    Meine Frage ist jedoch, wenn ich zwei Lautsprecher (die in Sonos selbst keine Gruppe sind) gleichzeitig einschalte und Musik abspiele, dann starten diese auch gleichzeitig mit der Wiedergabe. Jedoch sind sie dann in der Sonos App separat die Musik am wiedergeben und nicht als verbunden Lautsprecher. Kann ich das irgend wie auch mit einem Befehl ausgeben, dass Lautsprecher a und Lautsprecher B kombiniert werden?

    No replies

  12. Radio stream change

    Open

    I've just added additional virtual output to the Sonos template, prepared by you - for changing the internet radio stream. Below you can find the example for Radio RMF, but in the simple way it is possible to adapt it to your preffered stations:

    HTTP header:

    SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"

    HTTP body:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"> <InstanceID>0</InstanceID> <CurrentURI>x-rincon-mp3radio://217.74.72.10/rmf_fm</CurrentURI> <CurrentURIMetaData>&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;-1&quot; parentID=&quot;-1&quot; restricted=&quot;true&quot;&gt;&lt;upnp:class xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot;&gt;object.item.audioItem.audioBroadcast&lt;/upnp:class&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</CurrentURIMetaData> </u:SetAVTransportURI> </s:Body> </s:Envelope>

    Best! Artur

    1 reply

    1. Hmmm, it is not too easy to paste here some xml code and there is no possibility to share a picture as well :(

      So below you can find the HTTP body with some text changes:

      YYYs:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"ZZZ YYYs:BodyZZZ YYYu:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"ZZZ YYYInstanceIDZZZ0XXXInstanceIDZZZ YYYCurrentURIZZZx-rincon-mp3radio://217.74.72.10/rmf_fmXXXCurrentURIZZZ YYYCurrentURIMetaDataZZZAAAltBBBDIDL-Lite xmlns=AAAquotBBBurn:schemas-upnp-org:metadata-1-0/DIDL-Lite/AAAquotBBBAAAgtBBBAAAltBBBitem id=AAAquotBBB-1AAAquotBBB parentID=AAAquotBBB-1AAAquotBBB restricted=AAAquotBBBtrueAAAquotBBBAAAgtBBBAAAltBBBupnp:class xmlns:upnp=AAAquotBBBurn:schemas-upnp-org:metadata-1-0/upnp/AAAquotBBBAAAgtBBBobject.item.audioItem.audioBroadcastAAAltBBB/upnp:classAAAgtBBBAAAltBBB/itemAAAgtBBBAAAltBBB/DIDL-LiteAAAgtBBBXXXCurrentURIMetaDataZZZ XXXu:SetAVTransportURIZZZ XXXs:BodyZZZ XXXs:EnvelopeZZZ

      To encode it, you have to change some phrases (XXX, XXX, etc) to the signs, as it was shown below:

      XXX - <\ YYY - < ZZZ - > AAA - & BBB - ;

  13. Open

    Hi, the files are not accessible?

    No replies

  14. Open

    Hi, the files are not accessible?

    No replies

  15. All works except the Stop and Pauze

    Open

    Hi all,

    For the on/off(or pauze) I configured a toggle. First click to put the sonos one on works, second click connected to the toggle off output does not give any effect on the stop or pauze.

    Volume up down all works.

    Any ideas - In the live even if I click the switch directly I see it flash for a second but nothing happens?

    best

    Paul

    No replies

Report this entry

Report abuse

You have to be logged in to report an entry. Log in