AVTransport service
Service that controls stuff related to transport (play/pause/next/special URLs)
The AVTransport service is available on these models: Sonos Play:1 (S1) S2
/ Sonos One (S13) S2
/ Sonos Beam (S14) S2
/ Sonos One (S18) S2
/ SYMFONISK Bookshelf (S21) S2
/ Sonos Roam (S27) S2
/ Sonos Play:3 (S3) S2
/ SYMFONISK Bookshelf (S33) S2
/ Sonos One SL (S38) S2
/ Sonos Play:5 (S6) S2
/ Sonos Playbar (S9) S2
/ Sonos Sub (Sub) S2
.
- Available actions
- AddMultipleURIsToQueue
- AddURIToQueue
- AddURIToSavedQueue
- BackupQueue
- BecomeCoordinatorOfStandaloneGroup
- BecomeGroupCoordinator
- BecomeGroupCoordinatorAndSource
- ChangeCoordinator
- ChangeTransportSettings
- ConfigureSleepTimer
- CreateSavedQueue
- DelegateGroupCoordinationTo
- EndDirectControlSession
- GetCrossfadeMode
- GetCurrentTransportActions
- GetDeviceCapabilities
- GetMediaInfo
- GetPositionInfo
- GetRemainingSleepTimerDuration
- GetRunningAlarmProperties
- GetTransportInfo
- GetTransportSettings
- Next
- NotifyDeletedURI
- Pause
- Play
- Previous
- RemoveAllTracksFromQueue
- RemoveTrackFromQueue
- RemoveTrackRangeFromQueue
- ReorderTracksInQueue
- ReorderTracksInSavedQueue
- RunAlarm
- SaveQueue
- Seek
- SetAVTransportURI
- SetCrossfadeMode
- SetNextAVTransportURI
- SetPlayMode
- SnoozeAlarm
- StartAutoplay
- Stop
- Events
- Custom errors
Service data
name | value |
---|---|
Control URL | http://192.168.x.x:1400/MediaRenderer/AVTransport/Control |
Event subscription URL | http://192.168.x.x:1400/MediaRenderer/AVTransport/Event |
Discovery URL | http://192.168.x.x:1400/xml/AVTransport1.xml |
Service ID | urn:upnp-org:serviceId:AVTransport |
Service type | urn:schemas-upnp-org:service:AVTransport:1 |
Sample request
POST /MediaRenderer/AVTransport/Control
Host: 192.168.x.x:1400
soapaction: "urn:schemas-upnp-org:service:AVTransport:1#{ActionName}"
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
{ActionBodyHere}
</s:Body>
</s:Envelope>
Available actions
AddMultipleURIsToQueue
Action body:
<u:AddMultipleURIsToQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<UpdateID>ui4</UpdateID>
<NumberOfURIs>ui4</NumberOfURIs>
<EnqueuedURIs>string</EnqueuedURIs>
<EnqueuedURIsMetaData>string</EnqueuedURIsMetaData>
<ContainerURI>string</ContainerURI>
<ContainerMetaData>string</ContainerMetaData>
<DesiredFirstTrackNumberEnqueued>ui4</DesiredFirstTrackNumberEnqueued>
<EnqueueAsNext>boolean</EnqueueAsNext>
</u:AddMultipleURIsToQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
UpdateID | ui4 | Â |
NumberOfURIs | ui4 | Â |
EnqueuedURIs | string | Â |
EnqueuedURIsMetaData | string | Embedded XML |
ContainerURI | string | Â |
ContainerMetaData | string | Embedded XML |
DesiredFirstTrackNumberEnqueued | ui4 | Â |
EnqueueAsNext | boolean | Allowed values: 1 (= true) / 0 (= false) |
Outputs:
parameter | type | description |
---|---|---|
FirstTrackNumberEnqueued | ui4 | Â |
NumTracksAdded | ui4 | Â |
NewQueueLength | ui4 | Â |
NewUpdateID | ui4 | Â |
AddURIToQueue
Adds songs to the SONOS queue
Action body:
<u:AddURIToQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<EnqueuedURI>string</EnqueuedURI>
<EnqueuedURIMetaData>string</EnqueuedURIMetaData>
<DesiredFirstTrackNumberEnqueued>ui4</DesiredFirstTrackNumberEnqueued>
<EnqueueAsNext>boolean</EnqueueAsNext>
</u:AddURIToQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
EnqueuedURI | string | Â |
EnqueuedURIMetaData | string | Embedded XML |
DesiredFirstTrackNumberEnqueued | ui4 | use 0 to add at the end or 1 to insert at the beginning |
EnqueueAsNext | boolean | Allowed values: 1 (= true) / 0 (= false) |
Outputs:
parameter | type | description |
---|---|---|
FirstTrackNumberEnqueued | ui4 | Â |
NumTracksAdded | ui4 | Â |
NewQueueLength | ui4 | Â |
Remarks In NORMAL play mode the songs are added prior to the specified DesiredFirstTrackNumberEnqueued
.
AddURIToSavedQueue
Action body:
<u:AddURIToSavedQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<ObjectID>string</ObjectID>
<UpdateID>ui4</UpdateID>
<EnqueuedURI>string</EnqueuedURI>
<EnqueuedURIMetaData>string</EnqueuedURIMetaData>
<AddAtIndex>ui4</AddAtIndex>
</u:AddURIToSavedQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
ObjectID | string | Â |
UpdateID | ui4 | Â |
EnqueuedURI | string | Â |
EnqueuedURIMetaData | string | Embedded XML |
AddAtIndex | ui4 | Â |
Outputs:
parameter | type | description |
---|---|---|
NumTracksAdded | ui4 | Â |
NewQueueLength | ui4 | Â |
NewUpdateID | ui4 | Â |
BackupQueue
Action body:
<u:BackupQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:BackupQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
BecomeCoordinatorOfStandaloneGroup
Leave the current group and revert to a single player.
Action body:
<u:BecomeCoordinatorOfStandaloneGroup xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:BecomeCoordinatorOfStandaloneGroup>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
DelegatedGroupCoordinatorID | string | Â |
NewGroupID | string | Â |
BecomeGroupCoordinator
Action body:
<u:BecomeGroupCoordinator xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<CurrentCoordinator>string</CurrentCoordinator>
<CurrentGroupID>string</CurrentGroupID>
<OtherMembers>string</OtherMembers>
<TransportSettings>string</TransportSettings>
<CurrentURI>string</CurrentURI>
<CurrentURIMetaData>string</CurrentURIMetaData>
<SleepTimerState>string</SleepTimerState>
<AlarmState>string</AlarmState>
<StreamRestartState>string</StreamRestartState>
<CurrentQueueTrackList>string</CurrentQueueTrackList>
<CurrentVLIState>string</CurrentVLIState>
</u:BecomeGroupCoordinator>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
CurrentCoordinator | string | Â |
CurrentGroupID | string | Â |
OtherMembers | string | Â |
TransportSettings | string | Â |
CurrentURI | string | Â |
CurrentURIMetaData | string | Embedded XML |
SleepTimerState | string | Â |
AlarmState | string | Â |
StreamRestartState | string | Â |
CurrentQueueTrackList | string | Â |
CurrentVLIState | string | Â |
BecomeGroupCoordinatorAndSource
Action body:
<u:BecomeGroupCoordinatorAndSource xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<CurrentCoordinator>string</CurrentCoordinator>
<CurrentGroupID>string</CurrentGroupID>
<OtherMembers>string</OtherMembers>
<CurrentURI>string</CurrentURI>
<CurrentURIMetaData>string</CurrentURIMetaData>
<SleepTimerState>string</SleepTimerState>
<AlarmState>string</AlarmState>
<StreamRestartState>string</StreamRestartState>
<CurrentAVTTrackList>string</CurrentAVTTrackList>
<CurrentQueueTrackList>string</CurrentQueueTrackList>
<CurrentSourceState>string</CurrentSourceState>
<ResumePlayback>boolean</ResumePlayback>
</u:BecomeGroupCoordinatorAndSource>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
CurrentCoordinator | string | Â |
CurrentGroupID | string | Â |
OtherMembers | string | Â |
CurrentURI | string | Â |
CurrentURIMetaData | string | Embedded XML |
SleepTimerState | string | Â |
AlarmState | string | Â |
StreamRestartState | string | Â |
CurrentAVTTrackList | string | Â |
CurrentQueueTrackList | string | Â |
CurrentSourceState | string | Â |
ResumePlayback | boolean | Allowed values: 1 (= true) / 0 (= false) |
ChangeCoordinator
Action body:
<u:ChangeCoordinator xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<CurrentCoordinator>string</CurrentCoordinator>
<NewCoordinator>string</NewCoordinator>
<NewTransportSettings>string</NewTransportSettings>
<CurrentAVTransportURI>string</CurrentAVTransportURI>
</u:ChangeCoordinator>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
CurrentCoordinator | string | Â |
NewCoordinator | string | Â |
NewTransportSettings | string | Â |
CurrentAVTransportURI | string | Â |
ChangeTransportSettings
Action body:
<u:ChangeTransportSettings xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<NewTransportSettings>string</NewTransportSettings>
<CurrentAVTransportURI>string</CurrentAVTransportURI>
</u:ChangeTransportSettings>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
NewTransportSettings | string | Â |
CurrentAVTransportURI | string | Â |
ConfigureSleepTimer
Stop playing after set sleep timer or cancel
Action body:
<u:ConfigureSleepTimer xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<NewSleepTimerDuration>string</NewSleepTimerDuration>
</u:ConfigureSleepTimer>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
NewSleepTimerDuration | string | Time to stop after, as hh:mm:ss or empty string to cancel |
Remarks Send to non-coordinator returns error code 800
CreateSavedQueue
Action body:
<u:CreateSavedQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<Title>string</Title>
<EnqueuedURI>string</EnqueuedURI>
<EnqueuedURIMetaData>string</EnqueuedURIMetaData>
</u:CreateSavedQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Title | string | Â |
EnqueuedURI | string | Â |
EnqueuedURIMetaData | string | Embedded XML |
Outputs:
parameter | type | description |
---|---|---|
NumTracksAdded | ui4 | Â |
NewQueueLength | ui4 | Â |
AssignedObjectID | string | Â |
NewUpdateID | ui4 | Â |
DelegateGroupCoordinationTo
Delegates the coordinator role to another player in the same group
Action body:
<u:DelegateGroupCoordinationTo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<NewCoordinator>string</NewCoordinator>
<RejoinGroup>boolean</RejoinGroup>
</u:DelegateGroupCoordinationTo>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
NewCoordinator | string | uuid of the new coordinator - must be in same group |
RejoinGroup | boolean | Should former coordinator rejoin the group? Allowed values: 1 (= true) / 0 (= false) |
Remarks Send to non-coordinator has no results - should be avoided.
EndDirectControlSession
Action body:
<u:EndDirectControlSession xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:EndDirectControlSession>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
GetCrossfadeMode
Get crossfade mode
Action body:
<u:GetCrossfadeMode xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetCrossfadeMode>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
CrossfadeMode | boolean | 1 for true and 0 for false |
Remarks Send to non-coordinator may return wrong value as only the coordinator value in a group
GetCurrentTransportActions
Get current transport actions such as Set, Stop, Pause, Play, X_DLNA_SeekTime, Next, X_DLNA_SeekTrackNr
Action body:
<u:GetCurrentTransportActions xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetCurrentTransportActions>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
Actions | string | Â |
Remarks Send to non-coordinator returns only Start
and Stop
since it cannot control the stream.
GetDeviceCapabilities
Action body:
<u:GetDeviceCapabilities xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetDeviceCapabilities>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
PlayMedia | string | Â |
RecMedia | string | Â |
RecQualityModes | string | Â |
GetMediaInfo
Get information about the current playing media (queue)
Action body:
<u:GetMediaInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetMediaInfo>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
NrTracks | ui4 | Â |
MediaDuration | string | Â |
CurrentURI | string | Â |
CurrentURIMetaData | string | Embedded XML |
NextURI | string | Â |
NextURIMetaData | string | Embedded XML |
PlayMedium | string | Possible values: NONE / NETWORK |
RecordMedium | string | Possible values: NONE |
WriteStatus | string | Â |
GetPositionInfo
Get information about current position (position in queue and time in current song)
Action body:
<u:GetPositionInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetPositionInfo>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
Track | ui4 | Â |
TrackDuration | string | Â |
TrackMetaData | string | Embedded XML |
TrackURI | string | Â |
RelTime | string | Â |
AbsTime | string | Â |
RelCount | i4 | Â |
AbsCount | i4 | Â |
GetRemainingSleepTimerDuration
Get time left on sleeptimer.
Action body:
<u:GetRemainingSleepTimerDuration xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetRemainingSleepTimerDuration>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
RemainingSleepTimerDuration | string | Format hh:mm:ss or empty string if not set |
CurrentSleepTimerGeneration | ui4 | Â |
Remarks Send to non-coordinator returns error code 800
GetRunningAlarmProperties
Action body:
<u:GetRunningAlarmProperties xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetRunningAlarmProperties>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
AlarmID | ui4 | Â |
GroupID | string | Â |
LoggedStartTime | string | Â |
GetTransportInfo
Get current transport status, speed and state such as PLAYING, STOPPED, PLAYING, PAUSED_PLAYBACK, TRANSITIONING, NO_MEDIA_PRESENT
Action body:
<u:GetTransportInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetTransportInfo>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
CurrentTransportState | string | Possible values: STOPPED / PLAYING / PAUSED_PLAYBACK / TRANSITIONING |
CurrentTransportStatus | string | Â |
CurrentSpeed | string | Possible values: 1 |
Remarks Send to non-coordinator always returns PLAYING
GetTransportSettings
Get transport settings
Action body:
<u:GetTransportSettings xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:GetTransportSettings>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Outputs:
parameter | type | description |
---|---|---|
PlayMode | string | Possible values: NORMAL / REPEAT_ALL / REPEAT_ONE / SHUFFLE_NOREPEAT / SHUFFLE / SHUFFLE_REPEAT_ONE |
RecQualityMode | string | Â |
Remarks Send to non-coordinator returns the settings of it’s queue
Next
Go to next song
Action body:
<u:Next xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:Next>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Remarks Possibly not supported at the moment see GetCurrentTransportActions
NotifyDeletedURI
Action body:
<u:NotifyDeletedURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<DeletedURI>string</DeletedURI>
</u:NotifyDeletedURI>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
DeletedURI | string | Â |
Pause
Pause playback
Action body:
<u:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:Pause>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Play
Start playing the set TransportURI
Action body:
<u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<Speed>string</Speed>
</u:Play>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Speed | string | Play speed usually 1, can be a fraction of 1 Allowed values: 1 |
Previous
Go to previous song
Action body:
<u:Previous xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:Previous>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Remarks Possibly not supported at the moment see GetCurrentTransportActions
RemoveAllTracksFromQueue
Flushes the SONOS queue.
Action body:
<u:RemoveAllTracksFromQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:RemoveAllTracksFromQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Remarks If queue is already empty it throw error 804. Send to non-coordinator returns error code 800.
RemoveTrackFromQueue
Action body:
<u:RemoveTrackFromQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<ObjectID>string</ObjectID>
<UpdateID>ui4</UpdateID>
</u:RemoveTrackFromQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
ObjectID | string | Â |
UpdateID | ui4 | Â |
RemoveTrackRangeFromQueue
Removes the specified range of songs from the SONOS queue.
Action body:
<u:RemoveTrackRangeFromQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<UpdateID>ui4</UpdateID>
<StartingIndex>ui4</StartingIndex>
<NumberOfTracks>ui4</NumberOfTracks>
</u:RemoveTrackRangeFromQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
UpdateID | ui4 | Leave blank |
StartingIndex | ui4 | between 1 and queue-length |
NumberOfTracks | ui4 | Â |
Outputs:
parameter | type | description |
---|---|---|
NewUpdateID | ui4 | Â |
ReorderTracksInQueue
Action body:
<u:ReorderTracksInQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<StartingIndex>ui4</StartingIndex>
<NumberOfTracks>ui4</NumberOfTracks>
<InsertBefore>ui4</InsertBefore>
<UpdateID>ui4</UpdateID>
</u:ReorderTracksInQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
StartingIndex | ui4 | Â |
NumberOfTracks | ui4 | Â |
InsertBefore | ui4 | Â |
UpdateID | ui4 | Â |
ReorderTracksInSavedQueue
Action body:
<u:ReorderTracksInSavedQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<ObjectID>string</ObjectID>
<UpdateID>ui4</UpdateID>
<TrackList>string</TrackList>
<NewPositionList>string</NewPositionList>
</u:ReorderTracksInSavedQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
ObjectID | string | Â |
UpdateID | ui4 | Â |
TrackList | string | Â |
NewPositionList | string | Â |
Outputs:
parameter | type | description |
---|---|---|
QueueLengthChange | i4 | Â |
NewQueueLength | ui4 | Â |
NewUpdateID | ui4 | Â |
RunAlarm
Action body:
<u:RunAlarm xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<AlarmID>ui4</AlarmID>
<LoggedStartTime>string</LoggedStartTime>
<Duration>string</Duration>
<ProgramURI>string</ProgramURI>
<ProgramMetaData>string</ProgramMetaData>
<PlayMode>string</PlayMode>
<Volume>ui2</Volume>
<IncludeLinkedZones>boolean</IncludeLinkedZones>
</u:RunAlarm>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
AlarmID | ui4 | Â |
LoggedStartTime | string | Â |
Duration | string | Â |
ProgramURI | string | Â |
ProgramMetaData | string | Embedded XML |
PlayMode | string | Allowed values: NORMAL / REPEAT_ALL / REPEAT_ONE / SHUFFLE_NOREPEAT / SHUFFLE / SHUFFLE_REPEAT_ONE |
Volume | ui2 | Â |
IncludeLinkedZones | boolean | Allowed values: 1 (= true) / 0 (= false) |
SaveQueue
Saves the current SONOS queue as a SONOS playlist and outputs objectID
Action body:
<u:SaveQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<Title>string</Title>
<ObjectID>string</ObjectID>
</u:SaveQueue>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Title | string | SONOS playlist title |
ObjectID | string | Leave blank |
Outputs:
parameter | type | description |
---|---|---|
AssignedObjectID | string | Â |
Remarks Send to non-coordinator returns error code 800
Seek
Seek track in queue, time delta or absolute time in song
Action body:
<u:Seek xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<Unit>string</Unit>
<Target>string</Target>
</u:Seek>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Unit | string | What to seek Allowed values: TRACK_NR / REL_TIME / TIME_DELTA |
Target | string | Position of track in queue (start at 1) or hh:mm:ss for REL_TIME or +/-hh:mm:ss for TIME_DELTA |
Remarks Returns error code 701 in case that content does not support Seek or send to non-coordinator
SetAVTransportURI
Set the transport URI to a song, a stream, the queue, another player-rincon and a lot more
Action body:
<u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<CurrentURI>string</CurrentURI>
<CurrentURIMetaData>string</CurrentURIMetaData>
</u:SetAVTransportURI>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
CurrentURI | string | The new TransportURI - its a special SONOS format |
CurrentURIMetaData | string | Track Metadata, see MetadataHelper.GuessTrack to guess based on track uri Embedded XML |
Remarks If set to another player RINCON, the player is grouped with that one.
SetCrossfadeMode
Set crossfade mode
Action body:
<u:SetCrossfadeMode xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<CrossfadeMode>boolean</CrossfadeMode>
</u:SetCrossfadeMode>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
CrossfadeMode | boolean | Allowed values: 1 (= true) / 0 (= false) |
Remarks Send to non-coordinator returns error code 800. Same for content, which does not support crossfade mode.
SetNextAVTransportURI
Action body:
<u:SetNextAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<NextURI>string</NextURI>
<NextURIMetaData>string</NextURIMetaData>
</u:SetNextAVTransportURI>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
NextURI | string | Â |
NextURIMetaData | string | Embedded XML |
SetPlayMode
Set the PlayMode
Action body:
<u:SetPlayMode xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<NewPlayMode>string</NewPlayMode>
</u:SetPlayMode>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
NewPlayMode | string | New playmode Allowed values: NORMAL / REPEAT_ALL / REPEAT_ONE / SHUFFLE_NOREPEAT / SHUFFLE / SHUFFLE_REPEAT_ONE |
Remarks Send to non-coordinator returns error code 712. If SONOS queue is not activated returns error code 712.
SnoozeAlarm
Snooze the current alarm for some time.
Action body:
<u:SnoozeAlarm xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<Duration>string</Duration>
</u:SnoozeAlarm>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Duration | string | Snooze time as hh:mm:ss , 10 minutes = 00:10:00 |
StartAutoplay
Action body:
<u:StartAutoplay xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
<ProgramURI>string</ProgramURI>
<ProgramMetaData>string</ProgramMetaData>
<Volume>ui2</Volume>
<IncludeLinkedZones>boolean</IncludeLinkedZones>
<ResetVolumeAfter>boolean</ResetVolumeAfter>
</u:StartAutoplay>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
ProgramURI | string | Â |
ProgramMetaData | string | Embedded XML |
Volume | ui2 | Â |
IncludeLinkedZones | boolean | Allowed values: 1 (= true) / 0 (= false) |
ResetVolumeAfter | boolean | Allowed values: 1 (= true) / 0 (= false) |
Stop
Stop playback
Action body:
<u:Stop xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>ui4</InstanceID>
</u:Stop>
Inputs:
parameter | type | description |
---|---|---|
InstanceID | ui4 | InstanceID should always be 0 |
Events
The AVTransportService has variables that might be emitted if you subscribe to events.
Subscribe to events
SUBSCRIBE /MediaRenderer/AVTransport/Event
Host: 192.168.x.x:1400
callback: <http://...>
NT: upnp:event
Timeout: Second-3600
Event variables
Variable | Sends events* | type | possible values |
---|---|---|---|
AbsoluteCounterPosition | Â | i4 | Â |
AbsoluteTimePosition | Â | string | Â |
AlarmIDRunning | Â | ui4 | Â |
AlarmLoggedStartTime | Â | string | Â |
AlarmRunning | Â | boolean | 1 for true and 0 for false |
AVTransportURI | Â | string | Â |
AVTransportURIMetaData | Â | string | Embedded XML |
CurrentCrossfadeMode | Â | boolean | 1 for true and 0 for false |
CurrentMediaDuration | Â | string | Â |
CurrentPlayMode | Â | string | NORMAL / REPEAT_ALL / REPEAT_ONE / SHUFFLE_NOREPEAT / SHUFFLE / SHUFFLE_REPEAT_ONE |
CurrentRecordQualityMode | Â | string | Â |
CurrentSection | Â | ui4 | Â |
CurrentTrack | Â | ui4 | Â |
CurrentTrackDuration | Â | string | Â |
CurrentTrackMetaData | Â | string | Embedded XML |
CurrentTrackURI | Â | string | Â |
CurrentTransportActions | Â | string | Â |
CurrentValidPlayModes | Â | string | Â |
DirectControlAccountID | Â | string | Â |
DirectControlClientID | Â | string | Â |
DirectControlIsSuspended | Â | boolean | 1 for true and 0 for false |
EnqueuedTransportURI | Â | string | Â |
EnqueuedTransportURIMetaData | Â | string | Embedded XML |
LastChange | ✔ | string |  |
MuseSessions | Â | string | Â |
NextAVTransportURI | Â | string | Â |
NextAVTransportURIMetaData | Â | string | Embedded XML |
NextTrackMetaData | Â | string | Embedded XML |
NextTrackURI | Â | string | Â |
NumberOfTracks | Â | ui4 | Â |
PlaybackStorageMedium | Â | string | NONE / NETWORK |
PossiblePlaybackStorageMedia | Â | string | Â |
PossibleRecordQualityModes | Â | string | Â |
PossibleRecordStorageMedia | Â | string | Â |
QueueUpdateID | Â | ui4 | Â |
RecordMediumWriteStatus | Â | string | Â |
RecordStorageMedium | Â | string | NONE |
RelativeCounterPosition | Â | i4 | Â |
RelativeTimePosition | Â | string | Â |
RestartPending | Â | boolean | 1 for true and 0 for false |
SleepTimerGeneration | Â | ui4 | Â |
SnoozeRunning | Â | boolean | 1 for true and 0 for false |
TransportErrorDescription | Â | string | Â |
TransportErrorHttpCode | Â | string | Â |
TransportErrorHttpHeaders | Â | string | Â |
TransportErrorURI | Â | string | Â |
TransportPlaySpeed | Â | string | 1 |
TransportState | Â | string | STOPPED / PLAYING / PAUSED_PLAYBACK / TRANSITIONING |
TransportStatus | Â | string | Â |
If the variable has a ✔
in the Sends events column, the service discovery specifies this variable emits events. Other properties might be send as a part of LastChange
Custom errors
The AVTransportService has the following known custom errors.
Error code | Description |
---|---|
701 | Transition not available |
702 | No content |
703 | Read error |
704 | Format not supported for playback |
705 | Transport is locked |
706 | Write error |
707 | Media protected or not writeable |
708 | Format not supported for recording |
709 | Media is full |
710 | Seek mode not supported |
711 | Illegal seek target |
712 | Play mode not supported |
713 | Record quality not supported |
714 | Illegal MIME-Type |
715 | Content busy |
716 | Resource not found |
717 | Play speed not supported |
718 | Invalid InstanceID |
737 | No dns configured |
738 | Bad domain |
739 | Server error |
800 | Command not supported or not a coordinator |
This file is automatically generated with @svrooij/sonos-docs, do not edit manually.
Device | Software generation | Software version | Discovery date |
---|---|---|---|
Sonos Play:1 (S1) | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z |
Sonos One (S13) | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z |
Sonos Beam (S14) | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z |
Sonos One (S18) | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z |
SYMFONISK Bookshelf (S21) | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z |
Sonos Roam (S27) | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z |
Sonos Play:3 (S3) | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z |
SYMFONISK Bookshelf (S33) | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z |
Sonos One SL (S38) | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z |
Sonos Play:5 (S6) | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z |
Sonos Playbar (S9) | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z |
Sonos Sub (Sub) | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z |