Sonos play next function

Hi I’ve got the Sonos binding working nicely but have one thing I am stuck on -

In the morning I have Sonos as an alarm and it plays a shuffled playlist.

I’ve managed to get VLC player setup to record the local news each morning and create an MP3 file. (if some is interested in how to do this let me know)

I want to play this file after a few songs.

Ideally I’d like to add this file to the playlist so that a song ends then I get the news then the playlist continues. At the moment it’s a bit abrupt using rules and cron.

Is there a way to either edit a playlist in the background or do a play next command?

Thanks

Yes please.
Write a tutorial and place it in the Tutorials & Examples category
Thanks

1 Like

I’m also interested in reading how you’ve got this setup.

Hi I’ll do a proper write up when I have some time but for now…

On windows I’ve got a .bat file with the following command:

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" http://direct.franceinfo.fr/live/franceinfo-midfi.mp3 --sout "#duplicate{dst=std{access=file,mux=raw,dst=c:\openhab2\radio\news_franceinfo.mp3}" --stop-time 180 vlc://quit

You just need the feed address and a place to store it. stop time is in seconds.

In Sonos I’ve added the openhab2/radio folder to the media library scan. Then added the file as a favourite so that you can call it from the Sonos binding.

Then in windows I’ve used task scheduler to run the .bat file at 6h30 as a hidden task.

I’m sure this will work on Linux too.