Skip to content

Instantly share code, notes, and snippets.

@Hadjimina
Last active February 27, 2019 07:13
Show Gist options
  • Save Hadjimina/7148df3f50c080410a42028f2b113493 to your computer and use it in GitHub Desktop.
Save Hadjimina/7148df3f50c080410a42028f2b113493 to your computer and use it in GitHub Desktop.
List of SOAP requests used to control a Sonos device

Sonos Sopa requests

AVTransport requests

Pause

Request Header:

SOAPAction:"urn:schemas-upnp-org:service:AVTransport:1#Pause"

Request Body:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"> <InstanceID>0</InstanceID> <Speed>1</Speed> </u:Pause> </s:Body> </s:Envelope>

Address:

[SONOS IP]:1400/MediaRenderer/AVTransport/Control

Play

Request Header:

SOAPAction:"urn:schemas-upnp-org:service:AVTransport:1#Play"

Request Body:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"> <InstanceID>0</InstanceID> <Speed>1</Speed> </u:Play> </s:Body> </s:Envelope>

Address:

[SONOS IP]:1400/MediaRenderer/AVTransport/Control

Play Previous

Request Header:

    SOAPAction:"urn:schemas-upnp-org:service:AVTransport:1#Previous"

Request Body:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:Previous xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"> <InstanceID>0</InstanceID>  </u:Previous> </s:Body> </s:Envelope>

Address:

[SONOS IP]:1400/MediaRenderer/AVTransport/Control

Play Next

Request Header:

    SOAPAction:"urn:schemas-upnp-org:service:AVTransport:1#Next"

Request Body:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:Next xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"> <InstanceID>0</InstanceID>  </u:Next> </s:Body> </s:Envelope>

Address:

[SONOS IP]:1400/MediaRenderer/AVTransport/Control

RenderingControl Requests

Change Volume by certain amount

Request Header:

SOAPAction: "urn:schemas-upnp-org:service:RenderingControl:1#SetRelativeVolume"

Request Body:

<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetRelativeVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel><Adjustment>[VOLUME CHANGE AMOUNT]</Adjustment></u:SetRelativeVolume></s:Body></s:Envelope>

Address:

[SONOS IP]:1400/MediaRenderer/RenderingControl/Control

Get Sonos Volume

Request Header:

SOAPAction: "urn:schemas-upnp-org:service:RenderingControl:1#GetVolume

Request Body:

<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body><u:GetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel></u:GetVolume> </s:Body></s:Envelope>

Address:

[SONOS IP]:1400/MediaRenderer/RenderingControl/Control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment