We have moved at community.getvera.com

Author Topic: How to play stored Playlists?  (Read 5090 times)

Offline json

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
How to play stored Playlists?
« on: January 27, 2013, 07:35:03 am »
Hi All,

New to the forum and new to Vera Light!
Have just installed the Sonos plugin and wonder if its possible to create a scene and play a stored Sonos Playlist?


Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: How to play stored Playlists?
« Reply #1 on: January 28, 2013, 05:18:15 am »
Use action PlayURI as described in the following post: http://forum.micasaverde.com/index.php/topic,8505.msg93140.html#msg93140

Offline json

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: How to play stored Playlists?
« Reply #2 on: January 28, 2013, 02:46:40 pm »
Great!!
Thanks a lot!!

Offline BARThompson

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: How to play stored Playlists?
« Reply #3 on: February 08, 2013, 05:39:33 pm »
How would you set volume on the player when doing this?

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: How to play stored Playlists?
« Reply #4 on: February 09, 2013, 01:01:33 am »
How would you set volume on the player when doing this?
Use the volume parameter of PlayURI action.

Offline Jukka

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Re: How to play stored Playlists?
« Reply #5 on: February 22, 2013, 01:36:37 pm »
Hello

First thanks for the great plugin

I am using my Sonos and Sonos plugin as an alarm clock. In the morning it plays my ?alarm playlist?. I am using  command ?PlayUri URItoPlay SQ:AlarmList?

But now I would like to play that list in random order. I have tried to use command SetPlayMode NewPlayMode Shuffle but that is not working. Play starts always from the first track. And if I check what my Sonos is playing from Sonos "management program" I can see that shuffle mode is off.

Is it somehow possible to activate shuffle mode?

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: How to play stored Playlists?
« Reply #6 on: February 22, 2013, 03:39:33 pm »
Hello

First thanks for the great plugin

I am using my Sonos and Sonos plugin as an alarm clock. In the morning it plays my ?alarm playlist?. I am using  command ?PlayUri URItoPlay SQ:AlarmList?

But now I would like to play that list in random order. I have tried to use command SetPlayMode NewPlayMode Shuffle but that is not working. Play starts always from the first track. And if I check what my Sonos is playing from Sonos "management program" I can see that shuffle mode is off.

Is it somehow possible to activate shuffle mode?

I seems that shuffle is not available (button greyed in the Sonos control application) when a Sonos playlist is played by the plugin, meaning without queuing the files.
So until we enhance the plugin to manage the internal Sonos queue, this will not be possible.

Offline Jukka

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Re: How to play stored Playlists?
« Reply #7 on: February 23, 2013, 07:47:46 am »
Hello lolodomo

Thanks for the information.

I managed to get it almost working doing like this:
  RemoveAllTracksfromQueue
  AddURIToQueue  EnqueuedURI: file:///jffs/settings/savedqueues.rsq#2
                           (where #2 is the number of my saved "alarm playlist")
                            EnqueueAsNext: 1
                            All other field=0
  SetPlayMode       NewPlayMode: Shuffle
  Play (random track from my "Alarm Play list" starts to play)
.. and after some time
  Stop

Is it possible to save that queue which is removed from step 1 and restore it back when Play is stoped in the end of scene? I have not managed to do that, SavePlaybackContext and RestorePlaybackContex din't do that. This is not so important to me but I would like to know if it is possible.

Only problem that I have now is if Sonos was playing radio stream previously and stopped then when scene starts the "alarm playlist" is loaded to Sonos-player but play starts from previous radio stream not from "Alarm Play list". Is it possible to overcome this problem?

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: How to play stored Playlists?
« Reply #8 on: February 23, 2013, 08:12:10 am »
Hello lolodomo

Thanks for the information.

I managed to get it almost working doing like this:
  RemoveAllTracksfromQueue
  AddURIToQueue  EnqueuedURI: file:///jffs/settings/savedqueues.rsq#2
                           (where #2 is the number of my saved "alarm playlist")
                            EnqueueAsNext: 1
                            All other field=0
  SetPlayMode       NewPlayMode: Shuffle
  Play (random track from my "Alarm Play list" starts to play)
.. and after some time
  Stop

Fine, you have discovered how to manage the internal Sonos queue. 8)
I think we have to add a new parameter to PlayURI to be able to add to the queue, like you did manually if this is requested by the user.

Quote
Is it possible to save that queue which is removed from step 1 and restore it back when Play is stoped in the end of scene? I have not managed to do that, SavePlaybackContext and RestorePlaybackContex din't do that. This is not so important to me but I would like to know if it is possible.

Probably. I confirm that it is not yet handled by SavePlaybackContext and RestorePlaybackContex. I know how to get the content of the internal queue; I don't know yet exactly how to restore this internal queue. Probably like you did, but adding each item individually including metadata...

Quote
Only problem that I have now is if Sonos was playing radio stream previously and stopped then when scene starts the "alarm playlist" is loaded to Sonos-player but play starts from previous radio stream not from "Alarm Play list". Is it possible to overcome this problem?

Rather than calling Play, you have to call PlayURI with parameter "Q:". It should work perfectly. ;)

One time again, full management of the internal queue is not yet implemented in the plugin, but it is in the TODO list. I will take a look.
« Last Edit: February 23, 2013, 08:14:44 am by lolodomo »

Offline Jukka

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Re: How to play stored Playlists?
« Reply #9 on: February 23, 2013, 09:23:06 am »
Thanks a lot, now it is working, PlayURI with parameter ?Q:? did the trick. Now I can wake up next Monday with random music... ;D

Quote
Probably. I confirm that it is not yet handled by SavePlaybackContext and RestorePlaybackContex. I know how to get the content of the internal queue; I don't know yet exactly how to restore this internal queue. Probably like you did, but adding each item individually including metadata...

For me it is enough if tracks in queue can be saved and restored as ?play list? because I use mainly play list. So there are no need to save individual tracks only what playlist was active before alarm. I think that it is lot easier to save/restore playlist than individual tracks

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: How to play stored Playlists?
« Reply #10 on: February 23, 2013, 10:14:24 am »
Quote
Probably. I confirm that it is not yet handled by SavePlaybackContext and RestorePlaybackContex. I know how to get the content of the internal queue; I don't know yet exactly how to restore this internal queue. Probably like you did, but adding each item individually including metadata...

For me it is enough if tracks in queue can be saved and restored as ?play list? because I use mainly play list. So there are no need to save individual tracks only what playlist was active before alarm. I think that it is lot easier to save/restore playlist than individual tracks

The queue is a list of individual items, even if it was created from a playlist.