Announcement

Collapse
No announcement yet.

Get Playlist/Station?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Get Playlist/Station?

    Dirk-

    I have created virtual devices to store the current Track, Artist and Album names which I use for HSTouch screens and other purposes.

    I have noticed that when I stop playing a library playlist or Slacker/Pandora radio station, the name of the playlist/station that was just playing is populated into the Track/Title. So it appears that the name of the currently playing playlist/station is available to the plug-in.

    I would like to populate another HS device with the name of the currently playing playlist/station. Is there, or can there be, a way to extract this name via script? Or at least to have the plugin directly populate a device?

    Thanks,

    Mark
    Mark

    #2
    Originally posted by Mark S. View Post
    Dirk-

    I have created virtual devices to store the current Track, Artist and Album names which I use for HSTouch screens and other purposes.

    I have noticed that when I stop playing a library playlist or Slacker/Pandora radio station, the name of the playlist/station that was just playing is populated into the Track/Title. So it appears that the name of the currently playing playlist/station is available to the plug-in.

    I would like to populate another HS device with the name of the currently playing playlist/station. Is there, or can there be, a way to extract this name via script? Or at least to have the plugin directly populate a device?

    Thanks,

    Mark
    Hi Mark, not sure I understand why you have virtual devices or need for scripts. In HST, did you use the "MUSIC" selection to set buttons, text, images?

    Maybe some screenshots of more detail on what you are doing and what it is you would like to do.

    Dirk

    Comment


      #3
      Yes, I do use the built-in HSTouch stuff, but I still need the HS devices because I pass the names on to other non-HSTouch hardware. The only way I know to populate a HS device is to call up the MusicAPI in a script and set a devicestring with the track, artist or album.

      I also use those HS devices to save a short history of what has played, so I can see the trackname or artist of a song that just finished since I can't always get to a touchscreen while it was playing.

      But regardless, I want to display the name of the current playlist/station. I don't think that is currently available in HSTouch. Is it? If not, can I get it somehow? Apparently, the plugin has the playlist/station name somewhere because it populates Track after a stop.
      Mark

      Comment


        #4
        Originally posted by Mark S. View Post
        But regardless, I want to display the name of the current playlist/station. I don't think that is currently available in HSTouch. Is it? If not, can I get it somehow? Apparently, the plugin has the playlist/station name somewhere because it populates Track after a stop.
        Neither of them are stored by the PI and there is nothing on the MusicAPI to pass it along. Not sure why you think the PI has the playlist/station name, the PI is just a pass-along wrapper over the Sonos Player. It updates its info when Sonos sends an event. So unless Sonos wipes out the track name after a stop, the name would still be there from the last event Sonos had sent. Wrt to playlists and playlistnames, Sonos actually has a queue and you can populate that queue with the content of one or more playlists. So the Playlist name, when Sonos is playing something, is never available to the PI, it is being told it is playing from the queue. The radiostations is slightly different, it is available but not consistent, depending on whether it is a premium channel like Rhapsody, Pandora, or internet stations. The name is not stored by the PI.

        Dirk

        Comment


          #5
          OK, thanks Dirk. But as I said, the playlist name does appear in Track upon stop. I don't understand how it gets there, but maybe Sonos sends it for some reason, and then only upon a stop. Odd. I just hoped there was a way to put that to use.
          Mark

          Comment


            #6
            Originally posted by Mark S. View Post
            OK, thanks Dirk. But as I said, the playlist name does appear in Track upon stop. I don't understand how it gets there, but maybe Sonos sends it for some reason, and then only upon a stop. Odd. I just hoped there was a way to put that to use.
            Strange indeed, never seen that before. Any chance to turn the PI's debug flag on, and capture the very end when you hit Stop. It must be a cut/paste from the debug log that HS keeps on disk (you need to turn it on) because the web log suppresses half the XML tags and makes it somewhat useless for this trace.

            Dirk

            Comment


              #7
              Thanks, Dirk. I am curious, so I did the debug log, starting from choosing a Slacker station to the point where I hit stop.

              I also attached before and after screen shots, which show that the Playlist name winds up in the song Title (which is simply a text element in HSTouch using Status Tracking... Music... "Sonos Zone" Current Track's Title).
              Attached Files
              Mark

              Comment


                #8
                Originally posted by Mark S. View Post
                Thanks, Dirk. I am curious, so I did the debug log, starting from choosing a Slacker station to the point where I hit stop.

                I also attached before and after screen shots, which show that the Playlist name winds up in the song Title (which is simply a text element in HSTouch using Status Tracking... Music... "Sonos Zone" Current Track's Title).
                This is actually a radiostation, not a playlist, correct? The trace shows that Sonos, when the stop is issued is not clearing the radiostation name, which they may fix actually over time. The way the PI works, it unpacks all information received from any type of event. When it comes to radiostations, the PI sticks the radiostation name in the track property but when further in the unpacking the real track name is available, it gets overwritten. In this case, because the radio station was stopped their is no real track info available and briefly the name in this case shows up.

                Dirk

                Comment


                  #9
                  Yes, it is a Slacker radio station in the above example.

                  So I'm guessing that Sonos actually makes the current station/playlist available in the same way that track and artist are - since it is in the Sonos Controller interface, I can only assume they make it available to developers for 3rd party apps.

                  But apparently the HS Music API does not have a provision for the playlist property. That's a shame - I've asked HS Tech why they don't include the currently playing playlist in the API. The answer was basically that they have decided that I don't need it.

                  But as you can see from my screenshots, I'm trying to populate a Now Playing: text field with the current playlist/station.

                  Thanks again.
                  Mark

                  Comment


                    #10
                    Awesome

                    How did you program the individual buttons to play a certan genre? I have 14 sonos units integrated with Homeseer and would love the option to select a Genre and have it play in that room.

                    Comment

                    Working...
                    X