Announcement

Collapse
No announcement yet.

Pandora Thumbs Up/Thumbs Down

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

    Pandora Thumbs Up/Thumbs Down

    So I had a request last night from the wife to have the ability to rate songs in Pandora from the HSTouch panels for squeezebox. There may be another way of doing this, but this was the only way I figured out how to do it, and figured I would share with others that may be looking for the same thing.

    I built this script, and then have 2 events that are triggered by the "buttons" in HSTouch. It also has things in it to control the display on my Russound panels to give feedback that the button was pressed (just in case we want to do it from the Russound Keypad vs HSTouch screen). You can remove this stuff.

    This is the main component to do the rating:

    hs.PluginFunction("SqueezeBox", playerInstance, "PlayerSendCLICommand", Args)

    and here is the data for "Args":

    Args(0) = "pandora rate 0" (0 is thumbs down, 1 is thumbs up)
    Args(1) = False



    Code:
    Dim playerInstance As String
    Dim Args(1) As Object
    Dim Kitchen_Keypad as integer
    Dim Bathroom_Keypad as integer
    DIM Title as string
    Dim Thumbs_Up as string
    Dim Thumbs_Down as String
    
    Sub Down(Parms As Object)
    Try
    Kitchen_Keypad = hs.DeviceValue(525)
    Bathroom_Keypad = hs.DeviceValue(564)
    Args(0) = "pandora rate 0"
    Args(1) = False
    playerInstance = "Player_b827ebb275f9"
    Title = (hs.DeviceString(622))
    Thumbs_Up = "Thumbs Up"
    Thumbs_Down = "Thumbs Down"
    If (Kitchen_Keypad = 100) then
    hs.PluginFunction("SqueezeBox", playerInstance, "PlayerSendCLICommand", Args)
    hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,2,Thumbs_Down,"Left",0})
    hs.waitSecs(2)
    hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,2,Title,"Left",0})
    	ElseIf (Bathroom_Keypad = 100) then 
    		hs.PluginFunction("SqueezeBox", playerInstance, "PlayerSendCLICommand", Args)
    		hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,5,Thumbs_Down,"Left",0})
    		hs.waitSecs(2)
    		hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,5,Title,"Left",0})
    	Else
    	hs.writelog("SqueezeBox Scripts", "All Keypads Off, Do Nothing")
    End If
    Catch ex As Exception
    hs.WriteLog("SqueezeBox Scripts", "Exception " & ex.ToString)
    End Try
    End Sub
    
    Sub Up(Parms As Object)
    Try
    Kitchen_Keypad = hs.DeviceValue(525)
    Bathroom_Keypad = hs.DeviceValue(564)
    Args(0) = "pandora rate 1"
    Args(1) = False
    playerInstance = "Player_b827ebb275f9"
    Title = (hs.DeviceString(622))
    Thumbs_Up = "Thumbs Up"
    Thumbs_Down = "Thumbs Down"
    If (Kitchen_Keypad = 100) then
    hs.PluginFunction("SqueezeBox", playerInstance, "PlayerSendCLICommand", Args)
    hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,2,Thumbs_Up,"Left",0})
    hs.waitSecs(2)
    hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,2,Title,"Left",0})
    	ElseIf (Bathroom_Keypad = 100) then 
    		hs.PluginFunction("SqueezeBox", playerInstance, "PlayerSendCLICommand", Args)
    		hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,5,Thumbs_Up,"Left",0})
    		hs.waitSecs(2)
    		hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,5,Title,"Left",0})
    	Else
    	hs.writelog("SqueezeBox Scripts", "All Keypads Off, Do Nothing")
    End If
    Catch ex As Exception
    hs.WriteLog("SqueezeBox Scripts", "Exception " & ex.ToString)
    End Try
    End Sub

    #2
    cool thanks!!
    HS3 Pro on Windows 8 64bit
    53 Z-wave nodes(46 devices, 7 remotes), 15 DS10a's, 10 ms16a's, 9 Oregon Sensors, W800, RFXCOMtrx433, Way2Call, 3 HSTouch Clients, 2xRussound CAS44, Global Cache GC100-12,10 Rollertrol blinds(+ zwave) ,3 Squeezebox Radios and 1 Squeezebox Boom,DMX Arduino via ethernet,Rain8Net,3x Echo Dot's


    Check out my electronics blog here:
    https://www.facebook.com/RaptorsIrrationalInventions

    Comment


      #3
      Or you could use "Alexa, thumbs up". The hassle is she stops the hot song to talk to you.

      Comment


        #4
        Originally posted by mikaluch View Post
        Or you could use "Alexa, thumbs up". The hassle is she stops the hot song to talk to you.


        This only works if you are playing the music thru her. I use squeezebox to pump the audio thru the house. Alexa is just my light slave.

        Comment

        Working...
        X