Good job on the spotify module @happyleaves! Nice to see it included in 0.43.
Are there any plans to add support for toggling shuffle mode on/off to it? I don’t see any of the services that fits in the media player docs (which is surprising), so perhaps it’s not possible atm?
As you point out, it is possible (along with some other modes) via the Spotify Web API. But Home Assistant doesn’t have any UI controls for such a thing. In the interim it would be implemented as a service, I guess.
I personally don’t have plans in the foreseeable future to add that, but it wouldn’t be hard. My fork of the spotipy lib already supports it.
@chrio please let me know if you have success! It’s right, shuffle is just possible with Kodi atm I think.
Since yesterday there is a feature request whether it’s possible to change that. In case you are interested.
Thanks, I hadn’t seen that, added my vote. I hope more settings such as shuffle and repeat modes will end up in the standard media_player feature sets later on.
As for spotify, I will give it a try to set it via a python script using the .spotify-token-cache + spotipy lib if possible, but I have limited python experience and time, so well see if I can come up with anything useful.
As long as it’s run shortly after you run the spotify service from homeassistant it should work though. A better way would be to build a small python app that uses the library, but that takes a bit more time.
I’ve spent the last hour trying to figure this out
Thank you @chrio, that’s excellent! I’m going to be using it after starting a playlist (and then have a next track command after) so that playlists don’t just start on the same track.
Edit: I had to change it to this to get it to work (between quotes, not a comma and a quote)
my script starts spotify playlist and skips to next but the shell_command does not work.
when I activate it directly in putty it says
osmc@KODI:/home/pi/home-assistant/configuration$ bash spotifyrandom.sh
AQClRZSpyO-jcu0k_Cg6z0rjtLM1gdKctA6bX2LLxGrd9_xoCftGFNoeuGJY76bNDHfbuBkQI-lhAzKPvD3XtxuVulR5PJ3cCgzECZv-Pv4AA7r2p2ndGwHCmDCWPk1zUfo
spotifyrandom.sh: line 6: $'\r': command not found
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>
osmc@KODI:/home/pi/home-assistant/configuration$ bash spotifyrandom.sh
AQClRZSpyO-jcu0k_Cg6z0rjtLM1gdKctA6bX2LLxGrd9_xoCftGFNoeuGJY76bNDHfbuBkQI-lhAzKPvD3XtxuVulR5PJ3cCgzECZv-Pv4AA7r2p2ndGwHCmDCWPk1zUfo
spotifyrandom.sh: line 6: $'\r': command not found
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>
OK my first error was creating a new file in microsoft explorer this is where the
spotifyrandom.sh: line 6: $’\r’: command not found
came from.
Created a new file with sudo nano and now I can start with
bash spotifyrandom.sh in putty
but in the script it is still not running
OK for the completion of what I found out.
I could execute a shell script from my docker file via
Hi all, I would really love to have this shuffle option. Because I automatically start a playlist when I arrive home, and I don’t always want to hear the same songs.
I noticed that there is a service now in HASS. But I have trouble adding the parameters in the frontend, I don’t know ther right syntax and I haven’t been able to find the right one yet. Can somebody help me with that?
Just joined and figured I’d pass along what I’ve learned. I tried the “shuffle_set” feature listed above and it didn’t seem to work so I reverted to trying the shell script. That worked for a while until the structure of the .spotify_token_cache file changed and broke the cut. So after some googling I came up with the follow. Please provide any feedback you have.