Announcement

Collapse
No announcement yet.

Changing Button labels

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

    Changing Button labels

    I have a button which is used to control a device ("Switch") and i want to make alternate presses of the button turn the device on and off.

    Also, i would like the label in the button to say "Switch On" if the device is currently off as pressing the button will turn the device on. conversely, the button label should be "Switch Off" if the device is on as a button push will turn it off.

    Has anyone found a neat way to get an HS Touch button to do this? it is partly a labelling issue, and then secondarily an action issue. I know i can solve the flip/flop action by executing an event with a script; i wonder if there is a neater way with the clever function in the Designer. I also wonder how to get the button label to change.

    simon

    #2
    I believe I read where a user place 2 buttons on top of one another and hid one when on and vice versa when click again.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Clever approach - I'll try that. Now to find a neat way to disable a button from another button push!

      simon

      Comment


        #4
        That's not a problem

        Action when pressed, hide element, name of button
        Action when pressed, show element, name of button

        Comment


          #5
          Seems very neat thank you. just laying out screens right now.

          one niggly problem with a device action which seems to operate a different device but that's not for this thread!

          the hide/unhide buttons results in a really neat user interface behaviour. most impressive. every time i use HS Designer i am more delighted with the comprehensive nature of what it offers.

          Comment


            #6
            Minor problem with this solution.

            when i start the HSTouch client (in this case on my iphone), the buttons are not able to sync themselves to the current status of the device.

            I really want it to come up with Switch On if it is currently off.

            it actually comes up with the same button whatever the status of the device, and sorts itself out after it has been used (when one button gets hidden and the other unhidden).

            Back to the drawing board!

            Comment


              #7
              I am having the same problem
              There should be an "when objekt is created" ..do anything and a function to check the value of an element

              this "when objekt is created" should be available on all objekts (buttons, listbox, screen, text...)

              example:
              when element is created
              if value button = "off" show element1
              else
              show element2

              Comment


                #8
                Did you set the status tracking on the buttons?
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment


                  #9
                  If i do that, i just get the status On or Off rather than the name of the device as well

                  Comment


                    #10
                    thats the reason why i am missing this function

                    If we would have this function then we could use the status tracking.

                    The same problem with the listbox control, on the 2nd 3rd 4th page of the list control i need a "back button" - but not on the first page. How to check if i am on the first page?

                    Comment


                      #11
                      What we really need is a way to trigger and event when a client starts. This way we could run an event to set the buttons to the correct status using the HSTouch actions.
                      I know of one workaround at the moment that may work but it's convoluted. I wrote a log monitor plugin. You could trigger an event when a particular client connects that could run an HSTouch action to "simulate a button press"
                      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                      Comment


                        #12
                        Rupp, perhaps you can help to solve my problem with the back button.

                        just now i hide the backbutton, when the selector of the listbox is pressed then i show the button. When the back button is pressed i hide the button again.
                        My problem is that the listbox has several pages and when the third page is displayed then i cannot go back to the first page - any idea or workaround?

                        Comment


                          #13
                          OK - the best solution I have found so far:

                          Use the $SCRIPT= functionality in the Text property of the button. Note the syntax of the expression is fussy: $SCRIPT= has to be in uppercase and no spaces between terms are acceptable in the expression.

                          Thus far I have the Text property

                          [$SCRIPT=&"Switch (now "+hs.devicestring("XX")+")"]

                          This results in a button labelled

                          Switch (now On)

                          for example.

                          It is ALMOST what i want! I really want it to say (when it is on)

                          Switch Off

                          which is the action the button will perform. To do that means being able to process in the expression the device status or string and convert it to something else. The perfect function for that would be IIF but it doesn't seem to be supported.

                          Anyone think of a really neat way in an expression which "SCRIPT= can evaluate which will let me display On when the status is Off and vice versa?

                          Simon

                          Comment


                            #14
                            Changing Buttons - Best Answer

                            With thanks to Paul H for this:

                            Leave the Text property of the button as a convenient label. It isn't going to be used....

                            Set the Status/Device Associations StatusTrackingNormal property to the Homeseer device you want the button to track in some way.

                            then go into a non intuitive place, the Status/Colo(u)rs property just above it and you will see a chance to MatchStatus to On, Off, Dim, Unknown with some AltText.

                            what you put in the AltText field will be used instead of the Status string.

                            So for example if you set AltText to Turn Switch Off and the Status string to On, when the device status is On, the button will show Turn Switch Off.

                            Works like a dream.

                            Comment


                              #15
                              I tried this and cannot seem to get it to work. After one press, the process runs out of sync and the light and button will both start to be 'ON' or 'OFF' at the same time. The only way I have found this to work if you do the same, but rather than match status (on or off etc.) match the value (0 or 100) this then works fine, with the downside that when you click and hold the button, it will show either the number 0 or 100. As soon as you let go of the button this number will disappear and the correct label will be present. Does anyone have similar issues or have been able to use the 'match status' correctly without side effects??

                              Harry

                              Comment

                              Working...
                              X