Playing sound file on a specific Sonos device

Avatar
  • updated

Can someone tell me how to play a specific sound file in the Music Library of my Sonos system on a specific Sonos. I'm trying to use the ChangeStationByUri(stationName, streamingUrl) function but no success yet. The command is being transferred to the Sonos player when I put the link to the file (\\NAS-....) instead of stationName (and leave streamingURL blank) but my Sonos controller tells me "Unable to locate ...". Also tried putting the audio file in my Sonos favorites and calling the favorite in bOS but no luck so far.

Avatar
Tilen Suhadolnik

ChangeStationByUri only works for streaming uris, for now.

Sonos device in bOS will be improved in the next major version release (bOS 5), which will not happen soon.

Any suggestions about Sonos are welcome.

Avatar
Rait Lotamõis

I'm having an odd issue. I can play radio stations without any problems using the ChangeStationByUri function. However, when I'm trying to play a wav file from the Internet (http://IP/dir/to/file.wav) using the same function - it's not working. The title changes to the filename, and the playback time jumps between 0 - 3 seconds but no playback is happening.


When trying to play the same file using a custom script and setting the "SetAVTransportURI" to play the file URL, everything works as expected.

Avatar
Fredrik Sandblom

What I know the only way with bOS is to play a URL.

I have solved this with Python script and play for example Spotify list or notifications with a http request from bOS.