Sonos - Playing all tracks/Playing folder from CIFS share

I was wondering if anyone got this working properly in Sonos?

I can play all my songs through Sonos by using the Plex integration and calling media_player.play_media with x-sonosapi-radio:SHUFFLE_ALL%7c%3aPMS%2f...%2fMusic%23c90q?sid=212&flags=72&sn=1.
But I won’t be able to see the playlist, skip multiple tracks or go back which I would like.

So next up, playing all tracks in the media library. I sniffed the following from the controller app:

POST /MediaRenderer/AVTransport/Control HTTP/1.1
CONNECTION: close
ACCEPT-ENCODING: gzip
HOST: 192.168.1.1:1400
USER-AGENT: Linux UPnP/1.0 Sonos/35.3-39102 (ACR_:OnePlus:OnePlus3:ONEPLUS A3003)
CONTENT-LENGTH: 1115
CONTENT-TYPE: text/xml; charset="utf-8"
X-SONOS-TARGET-UDN: uuid:RINCON_0000
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:AddURIToQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><EnqueuedURI>x-rincon-playlist:RINCON_0000#A:TRACKS</EnqueuedURI><EnqueuedURIMetaData>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;A:TRACKS&quot; parentID=&quot;A:&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;Tracks&lt;/dc:title&gt;&lt;upnp:class&gt;object.container.playlistContainer&lt;/upnp:class&gt;&lt;desc id=&quot;cdudn&quot; nameSpace=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;RINCON_AssociatedZPUDN&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</EnqueuedURIMetaData><DesiredFirstTrackNumberEnqueued>0</DesiredFirstTrackNumberEnqueued><EnqueueAsNext>0</EnqueueAsNext></u:AddURIToQueue></s:Body></s:Envelope>

Which looks easy enough but trying to play x-rincon-playlist:RINCON_0000#A:TRACKS as PLAYLIST or as MUSIC won’t work with media_player.play_media. I probably need the EnqueuedURIMetaData too but I have no idea how to attach them to media_content_id.

Another packet I was able to catch is the CIFS folder play all command:

POST /MediaRenderer/AVTransport/Control HTTP/1.1
CONNECTION: close
ACCEPT-ENCODING: gzip
HOST: 192.168.1.1:1400
USER-AGENT: Linux UPnP/1.0 Sonos/35.3-39102 (ACR_:OnePlus:OnePlus3:ONEPLUS A3003)
CONTENT-LENGTH: 1187
CONTENT-TYPE: text/xml; charset="utf-8"
X-SONOS-TARGET-UDN: uuid:RINCON_0000
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:AddURIToQueue xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><EnqueuedURI>x-rincon-playlist:RINCON_0000#S://mysmbhost/media/music</EnqueuedURI><EnqueuedURIMetaData>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;S://mysmbhost/media/music&quot; parentID=&quot;S:&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;//mysmbhost/media/music&lt;/dc:title&gt;&lt;upnp:class&gt;object.container&lt;/upnp:class&gt;&lt;desc id=&quot;cdudn&quot; nameSpace=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;RINCON_AssociatedZPUDN&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</EnqueuedURIMetaData><DesiredFirstTrackNumberEnqueued>0</DesiredFirstTrackNumberEnqueued><EnqueueAsNext>0</EnqueueAsNext></u:AddURIToQueue></s:Body></s:Envelope>

Obviously setting x-rincon-playlist:RINCON_0000#S://mysmbhost/media/music as media_content_id won’t work either or I wouldn’t be here.

Does anyody know how to get this working via media_player.play_media or do I have to resort to POSTing the HTTP commands manually?