Announcement

Collapse
No announcement yet.

Hiding an element tied into state of device

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

    Hiding an element tied into state of device

    Probably a stupid question, but how do you make an element visible or invisible, depending on a state of a device?

    Thanks
    Don

    #2
    I just tried this. I added element to screen. Removed Image Normal / Image Pressed. Set status tracking of the device using status image. Set the ON status image to the image your want displayed. Leave Off status image blank.
    Larry

    Comment


      #3
      While in the Scripting webinar, it sounds like you can simulate an OnShowHSTPage() to set controls hidden/visible when the page is first displayed.

      I'll need to create a proof of concept, but it should work like this:

      Create a small, hidden button
      In the text element add a [$SCRIPT=...] to perform your show/hide logic, separating multiple lines with the ':' delimiter
      When the 'IF' is satisfied, then call into the HST plug-in to simulate a button press
      Create N number small, hidden buttons whose actions show or hide whatever controls you want

      Comment


        #4
        Yeah, that was a great webinar. I never realized that you could cram so much code in one text line. I'll try to see if I can do an if then else statement in one line.

        Thanks

        Originally posted by BootsC5 View Post
        While in the Scripting webinar, it sounds like you can simulate an OnShowHSTPage() to set controls hidden/visible when the page is first displayed.

        I'll need to create a proof of concept, but it should work like this:

        Create a small, hidden button
        In the text element add a [$SCRIPT=...] to perform your show/hide logic, separating multiple lines with the ':' delimiter
        When the 'IF' is satisfied, then call into the HST plug-in to simulate a button press
        Create N number small, hidden buttons whose actions show or hide whatever controls you want
        Don

        Comment


          #5
          I am sorry I missed that webinar. Cool concept. Please post an example.
          Larry

          Comment


            #6
            Well its not going as well as I would like, but I have something.

            The idea of moving all the scripting into HST I could not get to work. I could not get the HSTServer plugin into the inlined script to save my life (this is required to then "push" a button in the HST client who does the actual work), so I went with a solution that someone else has probably thought of (script the control to call an event that then "presses" a HST button which then does the actual work)

            I created a text control, added the script to call the manual event (screen shot 1). The manual event then called two manual with condition events, each in turn called back to the HST client to set the control to the desired state (screenshot 2).

            I do not recommend doing this for the main screen as the HST client will call the manual event every second, even if the event is throttled (higher HS CPU usage).

            To answer the OP's question, the manual with condition events would need to press/release a button whose button actions would be to show/hide the other control (see 3rd screen shot on what to select for that)
            Attached Files

            Comment


              #7
              Thanks for posting your detailed example. It was helpful.

              Originally posted by BootsC5 View Post
              I could not get the HSTServer plugin into the inlined script to save my life (this is required to then "push" a button in the HST client who does the actual work)
              I had a feeling that this would be the case. IMO, it is a good ideal to keep all scripting on the HS side. Having scripts running on HST and HS would add one more layer to troubleshooting issues. Then again, I am relatively new to HST.
              Last edited by lpcalcaterra; February 2, 2010, 09:46 PM.
              Larry

              Comment


                #8
                I wanted to keep them closest to who used it. In my above example updating HST elements may require you to also update HS events.

                Comment


                  #9
                  That's really a good point. Hopefully HSTouch will have more scripting features in the future, like making elements visible...

                  Originally posted by lpcalcaterra View Post
                  I had a felling that this would be the case. IMO, it is a good ideal to keep all scripting on the HS side. Having scripts running on HST and HS would add one more layer to troubleshooting issues. Then again, I am relatively new to HST.
                  Don

                  Comment


                    #10
                    This is an interesting discussion. One of the reasons I would like to have buttons (or objects) that are hidden by default is a MENU.

                    • On my main screen I would like to have a button that says menu.
                    • When pressed it will 'unhide' 5 buttons below
                    • When pressed again it will hide these 5 buttons again
                    • When any of these 5 buttons are pressed, they should be hidden again, before doing what they're supposed to do.

                    Has anyone created something like this? (and how? )

                    Bye
                    DJ

                    Comment


                      #11
                      sub menu

                      Hopefully we will learn more about the scripting inside of an elements text property in this Thursday Webinar! But until we get some further clarification I will stick with the "known" solutions.

                      Originally posted by DJF3 View Post

                      On my main screen I would like to have a button that says menu.
                      • When pressed it will 'unhide' 5 buttons below
                      • When any of these 5 buttons are pressed, they should be hidden again, before doing what they're supposed to do.
                      DJ, I think I follow you. Two of your ideas can be handled quickly. Your MENU button would have 5 actions unhiding each of the other buttons.
                      The newly visible buttons actions would include 5 Hide elements actions & an action for the buttons intended purpuse.

                      Originally posted by DJF3 View Post
                      When pressed again it will hide these 5 buttons again
                      Toggling the sub menu item is a bit more difficult. If there where HS event actions that could (un)hide elements that would help. If this was the case, the Menu button could run a HS script that would toggle a virtual device on and off. ON would unhide the buttons, Off hide them. Kinda think of it, the Menu button would not need the unhiding actions mentioned above & the "sub menu" buttons would only need to turn off the virtual device to hide the remaining buttons. Now that would be simple.
                      Last edited by lpcalcaterra; February 3, 2010, 01:22 PM.
                      Larry

                      Comment


                        #12
                        Perhaps a stupid question, but how do you find out when the webinars are being held. I read your comment that there is one on Thursday. Would like to attend this but have no knowledge on how to access or find out when they run. Sorry for this being posted as part of this thread

                        Comment


                          #13
                          Checkout the Webinar and HOWTO forum: http://board.homeseer.com/forumdisplay.php?f=1009

                          Comment


                            #14
                            Originally posted by vossenh View Post
                            Perhaps a stupid question, but how do you find out when the webinars are being held. I read your comment that there is one on Thursday. Would like to attend this but have no knowledge on how to access or find out when they run. Sorry for this being posted as part of this thread
                            If you subscribe to our newsletter, you'll get a notice.

                            Mark
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #15
                              Larry,

                              Thanks for the tip... One of the main challenges is the menu that should be 'hidden' by default. (i.e. every time you open that page)

                              Hmm.. Having a virtual device that 'decides' if the menu is hidden or not could actually solve this problem.. It could be turned off say 5 minutes after it was turned on, so when the screen loads the menu would not be visible

                              Another suggestion that I received was to have a popup menu (screen?) but I have to test this.

                              Thanks
                              DJ

                              Comment

                              Working...
                              X