Can you secure a Control Page

Posted on
Mon Feb 13, 2012 12:46 am
southernvalley offline
Posts: 4
Joined: Feb 13, 2012

Can you secure a Control Page

We are using an iPad (Indigo Touch) to display both Security and Home Automation. It will be fixed to the wall. Is there any way to lock a Control Page? The display will be always active and show both Security and Lights. The idea would be to lock the Control Page if there is no activity for 5 minutes and then prompt the user for a password/passcode to gain access to the Control Page.

Any ideas?

Thanks,

David

Posted on
Mon Feb 13, 2012 9:52 am
jay (support) offline
Site Admin
User avatar
Posts: 18255
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Can you secure a Control Page

No built-in way. You might be able to hack the IWS template such that it would lock - but that's just a guess. You'd then use the web pages in Safari rather than Indigo Touch (IT doesn't render control pages using HTML nor execute javascript).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Feb 14, 2012 2:31 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Can you secure a Control Page

Why not just use the iPads built in lock/pass?

For simple "Keeping the Honest Honest" type of security I was thinking of the following:

Create a keypad control page where each keypad button when pressed would append that button's number to an indigo variable. When the "Enter" button is pressed, then that variable would be compared to a stored or hard-coded variable that is the "password". If it passed the test then whatever action you're looking to happen could be triggered. The keypad control page would also contain a "clear" button to empty the Indigo variable and a display area to report status and to show the numbers as entered, basically displaying the variable.

Sounds simple enough in my mind, but I haven't actually tried it yet...

Terry
Last edited by roussell on Tue Feb 14, 2012 7:55 pm, edited 1 time in total.

Posted on
Tue Feb 14, 2012 7:50 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Can you secure a Control Page

This won't get you all the way there, but it will give you a keypad that can can act based on correct/incorrect entries. I don't believe that there is a way to force a overlaying control page from the server's side... at any rate, here's this if you can use it...

Create three variables: Keypad, Keypress, Password
Put the numerical password you want to try in the variable 'Password'

Create a control panel with buttons labeled 0-9, plus a 'Clear' and 'Enter' button. Each button should change the variable 'Keypress' to it's labeled value. 'Clear' and 'Enter' buttons change the 'Keypress' variable to 'C' and 'E' respectively.

Add a "Display Variable" control to the top of the control page above the numbers and set it to display the value of the 'Keypad' variable. Here's an example:

Screen Shot 2012-02-14 at 7.37.46 PM.png
Screen Shot 2012-02-14 at 7.37.46 PM.png (72.41 KiB) Viewed 2112 times


Create a trigger that will fire on the 'Keypress' variable change.. Add the following python code to the Actions tab:
Code: Select all
import time
keyPressVar = indigo.variables[298613556]
keyPadVar = indigo.variables[1364787289]
keyPadPass = indigo.variables[1966950299]
if keyPressVar.value == "C":
   indigo.variable.updateValue(keyPadVar, '')
elif keyPressVar.value =="E":
   if keyPadVar.value == keyPadPass.value:
      indigo.variable.updateValue(keyPadVar, 'Accepted')
      time.sleep(2)
      indigo.variable.updateValue(keyPadVar, '')
   elif keyPadVar.value != keyPadPass.value:
      indigo.variable.updateValue(keyPadVar, 'Denied !!')
      time.sleep(2)
      indigo.variable.updateValue(keyPadVar, '')
else:
   keyPadVar.value += keyPressVar.value
   indigo.variable.updateValue(keyPadVar, keyPadVar.value)


That should be it, the code is pretty easy to follow, just add what you want to happen in the "Accepted" 'if' clause.
The code isn't optimized, but it gives you a direction - I hacked it out while watching 'The Walking Dead' on AMC so it's far from high quality, but it works...

Hope this helps,

Terry

Posted on
Thu Feb 16, 2012 11:49 am
southernvalley offline
Posts: 4
Joined: Feb 13, 2012

Re: Can you secure a Control Page

This is fantastic, thank you. One last question, I hope.

Based on a successful login I would like to go to a specific control page. The name of the control page is "Shoffner House". Could you please show me how I would code this? Sorry I'm not a coder, but cn fumble my way around. You code and directions were excellent.

Lastly, I notice it cannot accept two numbers of the same, 22 or 11 or 77. Did I do something wrong?

And, do you know how I can hide the "back" button on the iPad? Your keypad entry page works great, however it does not stop someone, continually hitting the "back" button and then getting access to all control pages.

Thanks again,

John

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests