Announcement

Collapse
No announcement yet.

Control external application via command line

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

    Control external application via command line

    I have my Danfoss thermostats working on my VeraLite and want to control that from hs. I have worked out the command line for it and it works perfect. Now, the command line contains two variables, the Vera device number and the temperature. Instead of me write a command line for every combination of the two: how can I build this with hs variables coming from the value of a hs device (I have one hs device created to correspond to a VeraDevice) ?

    The command line looks like this:
    Wget --delete-after "http://192.168.1.30:3480/data_request?id=lu_action&output_format=json&serviceId=urn:u pnp-org:serviceId:TemperatureSetpoint1_Heat&DeviceNum=7&action=S etCurrentSetpoint&NewCurrentSetpoint=21"

    Best,

    Mav

    #2
    It would look something like this (this is untested but will give you an idea)

    Code:
    Sub Main(ByVal Parms As Object)
    
    Dim SetPoint As Integer = hs.devicevalue("A12") 'this is the device with your setpoint
    Dim LaunchStr As String = ""
    
    LaunchStr = "--delete-after ""http://192.168.1.30:3480/data_request?id=lu_action&output_format=json&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat&DeviceNum=7&action=S etCurrentSetpoint&NewCurrentSetpoint=" & SetPoint & """
    
    hs.launch("C:\wget.exe", LaunchStr, "")
    
    End Sub
    You could also look at sending the URL command directly from something like hs.geturl/hs.urlaction which eliminates using wget.

    Comment


      #3
      Thanks! Works perfect!

      /Mav

      Comment

      Working...
      X