Where are you putting this code? It cannot be between the <% and %> entries.
Announcement
Collapse
No announcement yet.
How to Setup a Basic .ASP Page to Access HS?
Collapse
X
-
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
-
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
-
Originally posted by jon00 View PostThe 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.
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
-
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
-
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
Comment