Announcement

Collapse
No announcement yet.

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

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

  • jon00
    replied
    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.

    Leave a comment:


  • BobSpen
    replied
    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.......

    Leave a comment:


  • jon00
    replied
    Difficult to advise without seeing what you have done. Send me a PM with your full code.

    Leave a comment:


  • BobSpen
    replied
    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?

    Leave a comment:


  • BobSpen
    replied
    jon00,
    Thanks, that was easy!

    Leave a comment:


  • jon00
    replied
    Just use window.location.href = '/yourpage.asp';

    That will reload the page rather than refreshing the page.

    Leave a comment:


  • BobSpen
    replied
    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.

    Leave a comment:


  • BobSpen
    replied
    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.

    Leave a comment:


  • BobSpen
    replied
    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".

    Leave a comment:


  • jon00
    replied
    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.

    Leave a comment:


  • BobSpen
    replied
    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>

    Leave a comment:


  • BobSpen
    replied
    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.

    Leave a comment:


  • BobSpen
    replied
    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>

    Leave a comment:


  • jon00
    replied
    Where are you putting this code? It cannot be between the <% and %> entries.

    Leave a comment:


  • BobSpen
    replied
    jon00,
    I will respond to the "delay" issue after I have had a chance to flow chart and try to understand what you are suggesting.

    RE: the image display; I have no clue where those quote marks came from. I don't use MS Word. I only use NotePad and I don't see the 'angled" quote marks anywhere else in the code. I changed the line to what you posted(copy/paste) and it now looks correct, BUT still does not display the image. I did copy/paste the original line to an existing .htm page and it displays fine???????

    Leave a comment:

Working...
X