Announcement

Collapse
No announcement yet.

How to Setup a Basic .ASP Page to Access HS?

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

    #31
    Where are you putting this code? It cannot be between the <% and %> entries.
    Jon

    Comment


      #32
      jon00,
      No, it is in the HTML section. Everything above and below work fine. The alt="ok" was just a placeholder:

      Excerpt:

      <label for="current" style="color:black; border-style: none; line-height:45px; vertical-align:top; font-size:20px;">Now: </label>
      <input id="current" value="<%=currenttempgreat %>" style="color:black; border-style: none; width: 50px; font-size:40px;" ></input>
      </////img alt="ok" src=”/Images/253.gif” id="activeSymbolgreat" style="width:50px; background-color:aqua;">
      <img alt="ok" src="/Images/253.gif" id="activeSymbolgreat" style="width:50px; background-color:aqua;">
      <br></br>
      <label for="setCoolgreat" style='color:darkblue; font-weight: bold;'>Cool To</label>

      Comment


        #33
        AND, I am NOT getting a "file not found" error in the HS Log so at least HS is not having trouble serving it up.

        Comment


          #34
          jon00,
          I made it real simple--just a 1 line HTML page, opened in the same directory as my new thermostat .asp---it still will not load the image/NO log errors:

          <!DOCTYPE html>
          <head></head>
          <body>
          <html>

          <img alt="ok" src="/Images/253.gif" id="activeSymbolgreat" style="width:50px; background-color:aqua;">

          </html>

          Comment


            #35
            Perhaps the gif image is corrupt. Try it with a Homeseer supplied gif i.e.

            <img title="ok" src="/images/spinner.gif" id="activeSymbolgreat" style="width:50px; background-color:aqua;">

            Works here.
            Jon

            Comment


              #36
              Well, the "spinner works here also! The 253.gif is a HS supplied GIF and open fine in all browsers(IE, Chrome, Edge) but does not work on my .asp page. Stranger things have happened so I'll just move on using the 'spinner".

              Comment


                #37
                Originally posted by jon00 View Post
                The form reads the device values to update the setpoints, right? At the moment, you are using CAPI to control these setpoint devices which in turn updates their device values with the changes. This is causing your issue and why you need to add a delay. Therefore, if you set the device values before the CAPI routine executes (both to the new setpoint values), you don't have to wait for CAPI to update the device values. As you have already changed the device value in code, the page can be refreshed immediately and the new device values read.
                RE: above
                I now understand your comment above. Currently, after waiting the 1 second delay I re-read (hs.devicevalueEx with VBScript on the page) ALL the then-current values from HS and that is what is displayed on my page. This way I don't have to trust that the runscriptfunc executed properly or at least I can see if it did not.

                Comment


                  #38
                  jon00,
                  I have decided I need to add a "refresh" button on my Themostat(s) page so that if the page is left up for an extended period, a refresh will reload all the "Selects" with current values from the actual thermostats(in case they have changed since the page was loaded). On the button I use location.reload(true or false) which, with true or false, occasionally brings up a IE warning window saying "the user must refresh and send the data to the server". Is there anyway to get rid of this warning, it's annoying?
                  Thanks for you help.

                  Comment


                    #39
                    Just use window.location.href = '/yourpage.asp';

                    That will reload the page rather than refreshing the page.

                    Jon

                    Comment


                      #40
                      jon00,
                      Thanks, that was easy!

                      Comment


                        #41
                        One more question:
                        I now have one form with all 6 "selects" for setting the thermostat set points. When I change just one set point and post the form, the subsequent VB script at the top of the page will read all the "selects" and then run 6 scripts in HS to effect the CAPI settings, which you might recall from a previous post takes about 1 second, before I read all the device values to confirm the CAPI did it's job! I am exploring ways to limit the scripts run in HS to only the "selects" that change. I thought about using each of the "selects" onChange property to set a java variable but it does not persist after the "post". Is there a simple way to make this happen?

                        Comment


                          #42
                          Difficult to advise without seeing what you have done. Send me a PM with your full code.
                          Jon

                          Comment


                            #43
                            Originally posted by jon00 View Post
                            Difficult to advise without seeing what you have done. Send me a PM with your full code.
                            Sent a couple of days ago. Did you get PM? I sent again.......

                            Comment


                              #44
                              Originally posted by BobSpen View Post

                              Sent a couple of days ago. Did you get PM? I sent again.......
                              You actually sent me a visitor message rather than a PM which I responded to.
                              Jon

                              Comment

                              Working...
                              X