Door_Item.pm

Door_Item

SYNOPSIS

Example initialization: These are to be placed in a *.mht file in your user code directory.

First, define your actual door object (these are just examples):

  RF,          E1,     rf_front_door
  STARGATEDIN, 7,      sg_patio_door

Then, define the Door_Item and attach the real object:

  # Object 'front_door' attached to existing object 'rf_front_door'
  DOOR, rf_front_door, front_door

Using from your user code:

  # Attaching to a Light_Item (automatically turns light on)
  $auto_entry_light->add($front_door);

Input states:

  on/open/alert*: door opened
  off/closed/normal*: door closed
  ("*" is a wildcard here; values of "alertmin", "alertmax",
  and "alertbattlowmin" will all indicate "door opened", for example)

Output states:

  open: door opened
  closed: door closed
  check: Inactivity timeout has occurred -- batteries may be dead?

Optional Door-Open Alarm: If you want to be alerted when the door is left open too long, you can set an alarm (time is in seconds; an optional repeat_time can force repeat actions):

  $front_door->set_alarm(300, "speak('front door left open');",120);

Optional Inactivity Alarm:

If you want to be alerted when the door hasn't been opened for a period of time (i.e. the batteries in the transmitter may be dead) then do this (time is in hours):

  $front_door->set_inactivity_alarm(
     48,                                              # hours
     "speak('front door battery may be dead');"       # command
  );

DESCRIPTION

An abstract object that represents a door that you can add to a Light_Item. You typically associate a real door item (i.e. an RF door sensor or a digital input or the like) to this object. It will also indicate the state of the door on the web-based floorplan.pl.

When attached to a Light_Item, it will cause the light to be turned on whenever the door is opened. Typically you attach several objects to the same Light_Item. See Light_Item.pm for various ways to control when the light turns on and for how long.

INHERITS

Base_Item

METHODS

set_alarm($time,$action,$repeat_time)

If an alarm is set, the specified action is executed if the door was left open for the specified amount of time

set_inactivity_alarm($time,$action)

If an inactivity alarm is set, the specified action is executed if no notification of the door being opened has occured for X hours

INI PARAMETERS

NONE

AUTHOR

Jason Sharpee - jason@sharpee.com

Kirk Bauer - kirk@kaybee.org

Special Thanks to: Bruce Winter - MH

SEE ALSO

NONE

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

 Door_Item.pm