[download] Secure garage door opener


Senior Member
File Name: Secure garage door opener
File Submitter: etc6849
File Submitted: 15 May 2011
File Updated: 15 May 2011
File Category: Premise
Author: etc6849
Contact: post in forum
Version: RC1

This is a garagedooropener home object I've developed that includes a plug-in for the automation browser, offering full two-way status of all garage states! In the automation browser, the current state of the door is shown both under home and at the garagedooropener's control panel. This module is meant to be a secure means (however, no warrany or liability is expressed or implied; use at your own risk) to open your garage door via a keypad. You can also add a onchange script at the home level to automate things such as disarming the system if the home is vacant prior to the garage door opening.

The object requires a code to open/close the door (if you don't want to use a code, set the UserCode under User1 to "" MaxCodeLength to 0). It supports as many users as you want and records the following to track users:
1. who operated the door last
2. the time each user last operated the door
3. each user's access count (e.g. number of opens/closes)
4. and the action they last performed (e.g. open or close).

Support will be included for minibrowser at a future date, for now only automation browser support is included. I have a working version of miniBrowser for this plug-in. However, this new version will also include support for many more home objects (up to 18 objects now and counting) and I want to get most of them done before posting it.

Software Instructions
1. You'll need to paste the two gif images called "Open.gif" and "Close.gif" into ..Premise\SYS\web\Plugins\Images.
2. Then go to Modules, right click import and browser to the xdo file.
3. Right click under Home and navigate to "GarageDoorOpener" to install.
4. Bind the home object with some device object with a state property modeled as discussed under "Hardware Instructions."
5. By default one user is automatically created when the "GarageDoorOpener" is constructed under any Home object. However, you can change the number of users by increasing or decreasing "NumberOfUsers" property found under the home object of type "GarageDoorOpener." You would then navigate to the automatically generated children (e.g. users) under the door opener, changing their name and setting their usercode as you see fit.
6. To use the plug-in navigate to the lock using internet explorer, type the code, then click the lock or unlock buttons. Each time the lock and unlock buttons are clicked, all input codes are cleared (e.g. properties "keypadBuffer" and "InputCode").
7. If two-way feedback status is unreliable from your lock (or not offered at all), then set the property "ForceValue" to true. This will cause a state change to always be forced by the unlock and lock methods.

Hardware Instructions
For control of a typical garage door opener, you'll need some sort of relay that can be timed closed for ~1 second (this emulated you pressing the garage door button in real life). I used an Elk-M1G with a Elk-M1XOVR. I ran cat 5e from a relay on the M1XOVR to the hardwired touchpad that was installed on the garage wall.

By default, the home object assumes the device object it is bound to will take care of closing the contacts for ~1 second. If you need the home object to handle contact closure timing, enable "HandlesCloseTime." You can edit sys://Schema/Modules/GarageDoorOpener/Classes/GarageDoorOpener/OnChangeOpenClose if your door needs more than 1 second (this is doubtful though).

How to use the lock object in a ScriptMacro
Assuming you have created a home object called home.garagedooropener... (can be named whatever you want)

To close the door in a script:
home.GarageDoorOpener.Close "1234"

Note, if you don't want to use a code, you can always setup a user with a code = "" and set MaxCodeLength = 0. Then you could call unlock like this:
home.GarageDoorOpener.Close "1234"

An alternative method to close the door looks like this:
home.GarageDoorOpener.InputCode = "1234"
home.GarageDoorOpener.DoorClose = true

Important Notes
The opening garage door state is timed using a property called TimeToOpen. It's default is 12 seconds, if your door takes longer, set it as you need. Once this timeout elapses, the module assumes the garage door is open. This is an assumption as most garage door installs do not include a full open sensor, only a open/close sensor at the bottom of the door. If your install does, you'll want to modify sys://Schema/Modules/GarageDoorOpener/Classes/GarageDoorOpener/OnChangeDoorState.

Most garage doors allow for the door to be paused if you press the opener button while the door is moving. This driver could do the same thing (which is NOT what we want). When you tell the home object of type GarageDoorOpener to close, you want it to close and never pause! Since the garage door Open and Close methods do nothing when the door is in the Opening or Closing state, this is taken care of intrinsically. However, you MUST time your garage door and add some padding to the TimeToOpen property to ensure that the door remains in the Opening state long enough to prevent an inadvertent pause (e.g. someone giving a Close command). The Closing state is handled by setting the DoorState to Closing on a valid call to the Close method. The door sensor will always tell us when the door is actually closed, so it is responsible for finally setting the DoorState to Close.

Stuff is installed to these directories


Click here to download this file