Skip to content
Lieven Hollevoet edited this page Sep 22, 2014 · 1 revision

Description

An abstract object that represents a door that you can add to a . 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 , it will cause the light to be turned on whenever the door is opened. Typically you attach several objects to the same . See //Light_Item.pm// for various ways to control when the light turns on and for how long.

Usage

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): code format="perl" RF, E1, rf_front_door STARGATEDIN, 7, sg_patio_door code Then, define the Door_Item and attach the real object: code format="perl"

  1. Object 'front_door' attached to existing object 'rf_front_door'
DOOR, rf_front_door, front_door Using from your user code:
  1. Attaching to a Light_Item (automatically turns light on)
$auto_entry_light->add($front_door); code Input states: ///: door opened ///: door closed

Output states:

door opened
door closed
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): code format="perl" $front_door->set_alarm(300, "speak('front door left open');"); code 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): code format="perl" $front_door->set_inactivity_alarm( 48, # hours "speak('front door battery may be dead');" # command ); code

Clone this wiki locally