Announcement

Collapse
No announcement yet.

How to retrieve the Device Code for a Device in HSTouch

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to retrieve the Device Code for a Device in HSTouch

    Does anyone know how to access the device code from within HSTouch. I want to run a script upon press of a button and I want to use the Device Code of the device that was previously selected. I don't want to hard code the device code, I want to access it programmatically.

    Any help would be appreciated.

    --Bill

    #2
    check the help file for something like
    lastx10

    that would return the last Device that was executed.

    --Dan
    Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

    Comment


      #3
      Thanks, however that's not exactly what I'm looking for. I just want to be able to pass in the DeviceCode from the device that I've selected from the device list.

      Comment


        #4
        The only way I can envision accomplishing this is via scripting within HST.
        IE. on the first button press, store the device code associated with that button in a virtual device string (or a variable), then on the second button press, read this device/variable and perform the required action.
        Real courage is not securing your Wi-Fi network.

        Comment


          #5
          How would I store the device code associated with that button? How do you access the device code from within the HS Touch designer? I don't see any variable that holds the code, only the name.

          Comment


            #6
            can you post a snapshot of your screen you are working with?

            I'm kinda having a hard time trying to get where you are trying to get the device code from.

            --Dan
            Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

            Comment


              #7
              Sure...see the attached document.
              Attached Files

              Comment


                #8
                I've tried something here with the device selector list (ticking the box to not control the device) and I am not sure you can do it. I passed the device selector to a script (actions when selected) and all I would get was the selection on the last page (on/off/dim value) and the script never had the device passed to it at any point (well it does pass the first device when you load up the selector that is highlighted but nothing else if you change the device)

                Comment


                  #9
                  I think I get what you mean. Off the top of my head, I would say that you probably need to use a HSTouch device increment function. I am sorry I can not think of what it is called. But there is a function that you can typically use to scroll objects. You can also use that to make "things" larger/smaller.

                  So, do that to your TEXT object that has the overall value in it. Then you will need to add a submit button. That button will execute the script, passing in the value from the TEXT field.

                  I'd also play with colors, so that ANY toggle of 0.5+ or - sets the text color to RED. Then the submit would change it back to white.

                  Kind of an indication that you have changed things but not submitted it.

                  Maybe also add a cancel button which resets the value of the text and color??

                  --Dan
                  Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

                  Comment


                    #10
                    So when you press the submit button and call the script, how do I pass in the Homseer DeviceCode for the device I want to update? Keep in mind, I'm not hard coding the device code, it want it to be generic based on the device I and adjusting.

                    Comment


                      #11
                      Crud...Bill, sorry, that's what you were ORIGINALLY asking...I apologize!

                      Will think about it some...

                      I think the best way is to just define your OWN list menu. Then, when you select something, have it populate a hidden (or displayed) text box.

                      Then you can include that as part of the variables being passed into the script.

                      --Dan
                      Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

                      Comment

                      Working...
                      X