Announcement

Collapse
No announcement yet.

url action with parameter

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

  • url action with parameter

    Trying to adjust my volume via tuneblade's API... this string works from curl:

    Code:
    curl -X PUT -H "Content-Type: application/json" -d "{\"Status\": \"Connect\", \"Volume\": 5}" http://touchpanel:8081/Master
    I want to use dimmer to set the parameter field so I was thinking this but think I have a formatting issue:
    Code:
    Sub Main(Parm As Object)
    
       Dim ParmArray() As String 
        dim result as String
        dim website as String = "http://touchpanel:8081/Master"
        dim request as String = "PUT"
        dim information as String = "{""Status"" : ""Connect"",""Volume"" : ParmArray()}"
        dim header as String = "Content-Type: application/json"
        
        result = hs.URLAction(website, request, information, header)
    
    End Sub
    THanks in advance.

  • #2
    Are you asking how to set the parameters you put in the script into the data?

    You can try

    dim information as String = "{""Status"" : ""Connect"",""Volume"" : " & Parm.ToString & "}"

    If you are passing in a simple string...
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Also I'm trying to use TuneBlade, can anyone help me?
      Last edited by anderson; August 10th, 2016, 07:54 AM.

      Comment


      • #4
        Originally posted by anderson View Post
        Also I'm trying to use TuneBlade, can anyone help me?
        I just released a TuneBlade plugin to provide HS3 devices for each connected speaker for volume and connection control in case you're interested!

        Comment

        Working...
        X