Announcement

Collapse
No announcement yet.

HSTouch Slider with Run a HomeSeer script with values from elements(s)

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

    HSTouch Slider with Run a HomeSeer script with values from elements(s)

    I try to pass a Slider value into a script. But it didn't work.Can anyone help ?
    I save following a simple script to script directory.
    And then create a slider in HSTouch Designer. In the slider action , I select " Run a HomeSeer script with values from elements(s)" , script I select my sample script , scriptprocedure I select main
    script parameter 1 , I select this Slider element.

    code in sample script.vb
    Sub main(ByVal Parms As Object)
    hs.writelog("Test", "This is parameter 1: " & Parms(0).ToString)
    End Sub

    But when I run the action , it keep prompt out a error on the log.
    The slider's value that pass as parameter , that is byte array or a string ?

    Thanks

    #2
    That script should work - what error do you get?

    Comment


      #3
      Originally posted by mrhappy View Post
      That script should work - what error do you get?
      Whatever the slider's position , it already show 0 , the value never change.

      Thanks
      Kevin Lo

      Comment


        #4
        Actually - double check the name of your sub, vb.net is unforgiving with this and main is not the same as Main. Check in HSTouch whether you are calling Main or main.

        Comment


          #5
          Originally posted by mrhappy View Post
          Actually - double check the name of your sub, vb.net is unforgiving with this and main is not the same as Main. Check in HSTouch whether you are calling Main or main.
          Problem solve.
          I change a little bit in the script.

          Sub rgb1(Parms As Object)
          Dim pParms As Short = CInt(Parms(0))
          hs.writelog("Test", "This is parameter 1: " & pParms)
          End Sub

          It can show the Slider value now.
          But when I swipe the slider say from 0 to 50, it come out near 10 line in the log.
          I suppose is when i release the finger , it just send the value one time. Not send out continually.

          Here is what showing in the log. I slide from 0 to 119 , within 2 secs , it send out 17 times....

          12/11/2013 22:48:15 - Test - This is parameter 1: 0
          12/11/2013 22:48:15 - Test - This is parameter 1: 82
          12/11/2013 22:48:15 - Test - This is parameter 1: 98
          12/11/2013 22:48:15 - Test - This is parameter 1: 108
          12/11/2013 22:48:15 - Test - This is parameter 1: 117
          12/11/2013 22:48:15 - Test - This is parameter 1: 120
          12/11/2013 22:48:15 - Test - This is parameter 1: 121
          12/11/2013 22:48:15 - Test - This is parameter 1: 121
          12/11/2013 22:48:15 - Test - This is parameter 1: 121
          12/11/2013 22:48:15 - Test - This is parameter 1: 119
          12/11/2013 22:48:15 - Test - This is parameter 1: 119
          12/11/2013 22:48:15 - Test - This is parameter 1: 119
          12/11/2013 22:48:15 - Test - This is parameter 1: 119
          12/11/2013 22:48:16 - Test - This is parameter 1: 119
          12/11/2013 22:48:16 - Test - This is parameter 1: 119
          12/11/2013 22:48:16 - Test - This is parameter 1: 119
          12/11/2013 22:48:16 - Test - This is parameter 1: 119

          Comment


            #6
            Normally the TrackRealtime element property should sort this out but I think that is only when it is status tracked to a device rather than when you run a script from the element. IMHO you should be setting devices rather than running a script from a slider, this is because you could change things outside of HSTouch and the slider would not be in sync with what the device actually was.

            Are you still looking for testers? Even though I am looking at moving from HS I might be able to write a HS2 plugin if you did want.

            Comment


              #7
              Originally posted by mrhappy View Post
              Normally the TrackRealtime element property should sort this out but I think that is only when it is status tracked to a device rather than when you run a script from the element. IMHO you should be setting devices rather than running a script from a slider, this is because you could change things outside of HSTouch and the slider would not be in sync with what the device actually was.

              Are you still looking for testers? Even though I am looking at moving from HS I might be able to write a HS2 plugin if you did want.
              If you can write a plugin , that will be great. Do you have XM10 ?


              As you seen my post on the Wireless RGB LED controller , I already write the VB script for control , now i am work on control it by HSTouch slider.
              I am not familiar with develop the HS2 plugin , what can I do is only write it in VB script. And I also looking for a Color Picker for control the RGB value. But I still stack on it. I write a aspx , create a button and link to VB script for send out the command to RGB controller. And I find a javascript color picker (jscolor), but it seems cannot pass the JS value into ASP commandargument

              Thanks
              Kevin Lo

              Comment


                #8
                Originally posted by Kevin Lo View Post
                If you can write a plugin , that will be great. Do you have XM10 ?


                As you seen my post on the Wireless RGB LED controller , I already write the VB script for control , now i am work on control it by HSTouch slider.
                I am not familiar with develop the HS2 plugin , what can I do is only write it in VB script. And I also looking for a Color Picker for control the RGB value. But I still stack on it. I write a aspx , create a button and link to VB script for send out the command to RGB controller. And I find a javascript color picker (jscolor), but it seems cannot pass the JS value into ASP commandargument

                Thanks
                Kevin Lo
                I do have a Marmitek XM10 - although I have never actually used it I am sure it would work.

                HSTouch will be painful to deal with control just via HSTouch alone, you are better getting the devices correctly represented in HS itself and then once you do this you will end up with something better to control in HSTouch.

                If you were interested drop me an email through the board - I can see what I can create, can't make any cast iron promises but have written similar stuff before.

                Comment

                Working...
                X