HAI Security Keyboardbuffer not updating

Discussions about Mainlobby running on Apple mobile devices.
Clever1
Senior Member
Senior Member
Posts: 220
Joined: Mon Jan 14, 2008 10:31 am
Location: Huntsville, AL.
Contact:

HAI Security Keyboardbuffer not updating

Postby Clever1 » Tue Nov 09, 2010 12:18 pm

I have made the required changes in the Security-Keyboard html file to control the HAI panel; however, the hai_001_keyboardbuffer variable that is part of the arming functions does not get populated unless I leave the Security-Keyboard screen after I have typed in the security code and the come back in and execute the funtion which correctly sets the alram and then clears the keyboard buffer. The server variables hai_001_keyboardbuffer & hai_001_keyboardbuffermasked are getting populated when the number keys are selected, the keyboardmasked in the header of the screen does not update unless I select another number then the "*" appears next to the mode: Something is not right as I would expect the "*" to appear right after I select a number. This tells me the the variables aren't getting updated in real time. Below is the HTML extract:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no" name="viewport" />
<link href="css/styles.css" rel="stylesheet" media="screen" type="text/css" />
<script src="javascript/functions.js" type="text/javascript"></script>
<script src="javascript/iPhone.js" type="text/javascript"></script>
<title>Security-Keypad</title>
<script>
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
</script>
</head>

<body>
<div id="topbar" class="black">
<div id="blueleftbutton"><a href="Security.html">Security</a></div>
<div id="title">Mode:&nbsp;<span id="ml__hai_001_area001_areamode">{{hai_001_area001_areamode}}</span>&nbsp;<b><span id="ml__hai_001_keyboardbuffermasked" class="infotext">{{hai_001_keyboardbuffermasked}}</span></b></div>
</div>

<span id="security_icons">
<img onclick="doCommand('MLHAI|001~Keypress~1');" src="images\LtBlue\b1.png" style="z-index:3;position:absolute;top:60px;left:20px;" />
<img onclick="doCommand('MLHAI|001~Keypress~2');" src="images\LtBlue\b2.png" style="z-index:3;position:absolute;top:60px;left:90px;" />
<img onclick="doCommand('MLHAI|001~Keypress~3');" src="images\LtBlue\b3.png" style="z-index:3;position:absolute;top:60px;left:160px;" />
<img onclick="doCommand('Macro|MLHAI|001~Security~Away~All~{{hai_001_keyboardbuffer}}!MLHAI|001~Keypress~Clear');" src="images\LtBlue\bAway.png" style="z-index:3;position:absolute;top:60px;left:240px;" />

<img onclick="doCommand('MLHAI|001~Keypress~4');" src="images\LtBlue\b4.png" style="z-index:3;position:absolute;top:130px;left:20px;" />
<img onclick="doCommand('MLHAI|001~Keypress~5');" src="images\LtBlue\b5.png" style="z-index:3;position:absolute;top:130px;left:90px;" />
<img onclick="doCommand('MLHAI|001~Keypress~6');" src="images\LtBlue\b6.png" style="z-index:3;position:absolute;top:130px;left:160px;" />
<img onclick="doCommand('Macro|MLHAI|001~Security~Night~All~{{hai_001_keyboardbuffer}}!MLHAI|001~Keypress~Clear');" src="images\LtBlue\bNight.png" style="z-index:3;position:absolute;top:130px;left:240px;" />

<img onclick="doCommand('MLHAI|001~Keypress~7');" src="images\LtBlue\b7.png" style="z-index:3;position:absolute;top:200px;left:20px;" />
<img onclick="doCommand('MLHAI|001~Keypress~8');" src="images\LtBlue\b8.png" style="z-index:3;position:absolute;top:200px;left:90px;" />
<img onclick="doCommand('MLHAI|001~Keypress~9');" src="images\LtBlue\b9.png" style="z-index:3;position:absolute;top:200px;left:160px;" />
<img onclick="doCommand('Macro|MLHAI|001~Security~Day~All~{{hai_001_keyboardbuffer}}!MLHAI|001~Keypress~Clear');" src="images\LtBlue\bDay.png" style="z-index:3;position:absolute;top:200px;left:240px;" />

<img onclick="doCommand('MLHAI|001~Keypress~*');" src="images\LtBlue\bStar.png" style="z-index:3;position:absolute;top:270px;left:20px;" />
<img onclick="doCommand('MLHAI|001~Keypress~0');" src="images\LtBlue\b0.png" style="z-index:3;position:absolute;top:270px;left:90px;" />
<img onclick="doCommand('MLHAI|001~Keypress~#');" src="images\LtBlue\bPound.png" style="z-index:3;position:absolute;top:270px;left:160px;" />
<img onclick="doCommand('Macro|MLHAI|001~Security~Disarm~All~{{hai_001_keyboardbuffer}}!MLHAI|001~Keypress~Clear');" src="images\LtBlue\bOff.png" style="z-index:3;position:absolute;top:270px;left:240px;" />

<img onclick="doCommand('MLHAI|001~Keypress~Clear');" src="images\LtBlue\bClear.png" style="z-index:3;position:absolute;top:340px;left:90px;" />
</span>

<span id="tabbar" style="visibility:visible;">
<img src="images/tabbar.png" style="z-index:100;position:absolute;top:412px;left:0px;" />
</span>

<script language="javascript">
autoupdate = false;
pagevars = getvars();
</script>
</body>
</html>

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: HAI Security Keyboardbuffer not updating

Postby CinemarDave » Tue Nov 09, 2010 12:30 pm

try changing the script at the bottom of the page to

autoupdate = true;
pagevars = getvars();
UpdateVariables();

Clever1
Senior Member
Senior Member
Posts: 220
Joined: Mon Jan 14, 2008 10:31 am
Location: Huntsville, AL.
Contact:

Re: HAI Security Keyboardbuffer not updating

Postby Clever1 » Tue Nov 09, 2010 12:48 pm

That worked as far as updating the "*" on the top of the screen (although it is slow) but in the actual command to arm the system in away mode the vaiable hai_001_keyboardbuffer is still not populating... Which can be seen in the log entries below...

11/9/2010 11:39:21 AM Processing (1) W138.115.207.77 Macro|MLHAI|001~Security~Away~All~!MLHAI|001~Keypress~Clear
11/9/2010 11:39:21 AM Processing (2) W138.115.207.77 MLHAI|001~Security~Away~All~
11/9/2010 11:39:21 AM Processing (2) W138.115.207.77 MLHAI|001~Keypress~Clear
11/9/2010 11:39:29 AM Processing (1) MLYamaha|Status
11/9/2010 11:39:39 AM Processing (1) MLYamaha|Status
11/9/2010 11:39:42 AM Processing (1) W138.115.207.77 MLHAI|001~Keypress~6
11/9/2010 11:39:43 AM Processing (1) W138.115.207.77 MLHAI|001~Keypress~5
11/9/2010 11:39:45 AM Processing (1) W138.115.207.77 MLHAI|001~Keypress~6
11/9/2010 11:39:45 AM Processing (1) W138.115.207.77 MLHAI|001~Keypress~5
11/9/2010 11:39:49 AM Processing (1) MLYamaha|Status
11/9/2010 11:39:49 AM Processing (1) W138.115.207.77 Macro|MLHAI|001~Security~Away~All~!MLHAI|001~Keypress~Clear
11/9/2010 11:39:49 AM Processing (2) W138.115.207.77 MLHAI|001~Security~Away~All~
11/9/2010 11:39:49 AM Processing (2) W138.115.207.77 MLHAI|001~Keypress~Clear
11/9/2010 11:39:58 AM Processing (1) System MLDVDLobby|UpdateStats~MAINLOBBYSERVER~1,500,299,390,976~1,070,797,082,624~429,502,308,352~24~17,895,929,515~60~29
11/9/2010 11:39:59 AM Processing (1) MLYamaha|Status
11/9/2010 11:40:09 AM Processing (1) MLYamaha|Status
11/9/2010 11:40:19 AM Processing (1) MLYamaha|Status

I was looking at the update function and it appears to only updates those variables that are defined by having an ID starting with "ml__" so the variable in the arming command is not geting updates as it doesn't have an ID...

<img onclick="doCommand('Macro|MLHAI|001~Security~Night~All~{{hai_001_keyboardbuffer}}!MLHAI|001~Keypress~Clear');" src="images\LtBlue\bNight.png" style="z-index:3;position:absolute;top:130px;left:240px;" />

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: HAI Security Keyboardbuffer not updating

Postby CinemarDave » Tue Nov 09, 2010 2:19 pm

Modify the command to hold off the translating of the server variable

Change

Macro|MLHAI|001~Security~Disarm~All~{{hai_001_keyboardbuffer}}!

to

Macro|MLHAI|001~Security~Disarm~All~{'+'{hai_001_keyboardbuffer}'+'}!

The default refresh rate is 2.5 seconds. You can control that by setting

updatefreq = <<Some number of milliseconds>>;

in the Javascript in the bottom of the page. Do it before you call UpdateVariables

Clever1
Senior Member
Senior Member
Posts: 220
Joined: Mon Jan 14, 2008 10:31 am
Location: Huntsville, AL.
Contact:

Re: HAI Security Keyboardbuffer not updating

Postby Clever1 » Tue Nov 09, 2010 4:10 pm

That worked... Thank you... I noticed the different way to call the variables in the Climate web page and was getting ready to try the variable called that way since the Climate page was working...

Clever1
Senior Member
Senior Member
Posts: 220
Joined: Mon Jan 14, 2008 10:31 am
Location: Huntsville, AL.
Contact:

Re: HAI Security Keyboardbuffer not updating

Postby Clever1 » Tue Nov 09, 2010 7:17 pm

updateFreq = "200" ;

Setting the updateFreq variable doesn't seem to effect the update time. I have set it to 100 to 2000 to 5000 and the "*" continue to update on the display in the same amount of time as it does without the variable set.

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: HAI Security Keyboardbuffer not updating

Postby CinemarDave » Tue Nov 09, 2010 7:40 pm

updatefreq is a number and not a string. no quotes

updatefreq = 200;


Return to “MainLobby on iPhone, iPod Touch”

Who is online

Users browsing this forum: No registered users and 1 guest