Hi all, I am trying to set up an alarm for a Google smart speaker to play a random song from a playlist. It is working but every time it plays the same song (same order) from a playlist. How do I make it shuffle the songs so that its a random one each time? Here is my yaml:
Unfortunately that doesnt work with Plex as a source. From my research it seems like Plex serves songs one at a time and not as a playlist, so Home Assistant only sees it as 1 song, nothing to shuffle. Although I dont know why Home assistant cant implement a function where it randomly skips random number of times to emulate shuffle. (I suppose this can be scripted).
I did manage to figure it out though. You have to create a “Smart” playlist in Plex that will shuffle the songs for you every time you use it.
here is how you do it.
on Plex go to Music, then from “All” change to Advanced Filters
Then you add your criteria to create a playlist. Note you can add as many filter categories as you want via the “+” button. Then instead of “By Title” you change it to “Randomly”
Thats it. Now can use it in scripts and Plex will always serve it in random order (not just for Home Assistant, for anywhere you play that playlist, even Plex itself).