I’m on the release of 2.5 via OpenHABian and am trying to get a playlist to start on the Sonos. I can get commands to execute, but can’t get a playlist - created in Apple Music and added to the Sonos App - to play. I can’t get a radio station that is added to work either.
rule "Play Plalist"
when Item V_Sonos_Test received command
then
logInfo("Test", "Playlist")
sendCommand(SonosKitchen_PlayURI,""). // this successfully stops whatever playing
sendCommand(SonosKitchen_ClearQueue,ON)
// sendCommand(SonosKitchen_Radio,"Easy 99.1")
sendCommand(SonosKitchen_PlayPlaylist,"Morning Options"). // no change in Sonos app
sendCommand(SonosKitchen_Volume, "8") // this works
sendCommand(SonosKitchen_PlayQueue, ON) // no change in Sonos app
end
I’ve spent some time searching and testing combos but can’t get it to work. Any ideas?
Did you add it in a Sonos playlist having the name “Morning Options” ?
Maybe you rather add it as a Sonos favorite ?
Enable DEBUG logs to see what is reported: log:set DEBUG org.openhab.binding.sonos
2020-01-04 21:06:02.092 [nt.ItemStatePredictedEvent] - SonosKitchen_PlayPlaylist predicted to become Morning Options
2020-01-04 21:06:02.101 [nt.ItemStatePredictedEvent] - SonosKitchen_Volume predicted to become 8
2020-01-04 21:06:02.111 [nt.ItemStatePredictedEvent] - SonosKitchen_PlayQueue predicted to become ON
2020-01-04 21:06:02.127 [vent.ItemStateChangedEvent] - SonosKitchen_PlayPlaylist changed from BBC to Morning Options
==> /var/log/openhab2/openhab.log <==
2020-01-04 21:06:02.163 [DEBUG] [s.internal.handler.ZonePlayerHandler] - Playlist 'Morning Options' not found
If I add the AM playlist to a new Sonos Playlist, and use that, the songs play. It seems there must be some type of identifier for the Apple Music playlists that do not show up in the logs, but I’m not a coder so who knows…
I can do what I want to do, but not how I want to do it. I’d like to be able to modify playlists in Apple Music and have them visible to the Sonos binding, but it appears that the binding can only play Sonos playlists. Thus I need to go into the Sonos app, select the Apple Music playlist and add it to a Sonos playlist. Good enough for now.
Wow… while driving to work today, I thought that I should post my workaround to this problem…and having forgot I was reminded when you replied.
If you have the Amazon Echo Control binding in your ecosystem, you can update the ‘TextCommand’ channel with what would be a spoken word command (e.g. Play disco hits in the kitchen’) and Alexa silently does your bidding.
I then use the Sonos control script to enable other speakers as needed.