Tips

Command line actions for a Sonos player

How to pause the player (replace IP with the actual IP address of the player)

curl -H 'SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Pause"' -X POST -H 'Content-type: text/xml' -d '<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></u:Pause></s:Body></s:Envelope>' IP:1400/MediaRenderer/AVTransport/Control

How to restart the player (replace IP with the actual IP address of the player)

curl -H 'SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Play"' -X POST -H 'Content-type: text/xml' -d '<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></u:Play></s:Body></s:Envelope>' IP:1400/MediaRenderer/AVTransport/Control

How to get the now playing information (replace IP with the actual IP address of the player)

curl -H 'SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#GetPositionInfo"' -X POST -H 'Content-type: text/xml' -d '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetPositionInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:GetPositionInfo></s:Body></s:Envelope>' IP:1400/MediaRenderer/AVTransport/Control