DOORBIRD.pm

DOORBIRD

DESCRIPTION

Module for interfacing with the Doorbird line of IP Doorbells. Monitors events sent by the doorbell such as doorbell button push, motion, built in door relay trigger.

CONFIGURATION

At minimum, you must define the Interface and one of the following objects DOORBIRD_Bell, DOORBIRD_Motion, or DOORBIRD_Relay. This allows for the display of these objects as separate items in the MH interface and allows users to interact directly with these objects using the basic Generic_Item functions such as tie_event.

The DOORBIRD_Bell and DOORBIRD_Motion objects are for tracking the state of the doorbell bell button and the doorbell built in motion detector and are not for controlling the doorbell from MH.

The DOORBIRD_Relay object is for tracking the state of the built-in "door relay" in the doorbell and to control the door relay and the doorbell IR light. The relay is a standard dry contact relay that could be used for any purpose.

Misterhouse receives the states of each object from the doorbell by configuring the doorbell to send an HTTP get to MH when an action is realized, this method allows MH to track the states even when they have been triggered by the android app. The configuration of the doorbell happens when MH is started, so the doorbell must be On and accessible by MH when MH is started.

Interface Configuration

mh.private.ini configuration:

In order to allow for multiple doorbells, instance names are used. the following are prefixed with the instance name (DOORBIRD).

The IP of the misterhouse server: DOORBIRD_mh_ip=192.168.1.10

The port of the misterhouse server web: DOORBIRD_mh_port=8080

The IP of the doorbell: DOORBIRD_doorbell_ip=192.168.1.50

The username for the doorbell: DOORBIRD_user=doorbirduser

The password for the doorbell: DOORBIRD_password=doorbirdpass

Defining the Interface Object

In addition to the above configuration, you must also define the interface object. The object can be defined in the user code.

In user code:

   $DOORBIRD = new DOORBIRD('DOORBIRD');

Wherein the format for the definition is:

   $DOORBIRD = new DOORBIRD(INSTANCE);

Bell Object

        $DOORBIRD_Bell = new DOORBIRD_Bell('DOORBIRD', 1);

Wherein the format for the definition is: $DOORBIRD_Bell = new DOORBIRD_Bell(INSTANCE, ENABLECONFIG);

States: ON OFF

Motion Object

        $DOORBIRD_Motion = new DOORBIRD_Motion('DOORBIRD', 1);

Wherein the format for the definition is: $DOORBIRD_Motion = new DOORBIRD_Motion(INSTANCE, ENABLECONFIG);

States: ON OFF

Relay Object

        $DOORBIRD_Relay = new DOORBIRD_Relay('DOORBIRD', 1);

Wherein the format for the definition is: $DOORBIRD_Relay = new DOORBIRD_Relay(INSTANCE, ENABLECONFIG);

States: ON OFF

Control States: TOGGLE (to trigger the relay) LIGHT_ON (to enable the IR light on the door bell)

NOTES

An example mh.private.ini:

        DOORBIRD_mh_ip=192.168.1.10
        DOORBIRD_mh_port=8080
        DOORBIRD_doorbell_ip=192.168.1.50
        DOORBIRD_user=doorbirduser
        DOORBIRD_password=doorbirdpass

An example user code:

        #noloop=start
        use DOORBIRD;
        $DOORBIRD = new DOORBIRD('DOORBIRD');
        $DOORBIRD_Bell = new DOORBIRD_Bell('DOORBIRD', 1);
        $DOORBIRD_Motion = new DOORBIRD_Motion('DOORBIRD', 1);
        $DOORBIRD_Relay = new DOORBIRD_Relay('DOORBIRD', 1);
        #noloop=stop

        if ($state = state_changed $DOORBIRD_Motion) {
         run_voice_cmd 'start cam 8' if ($state eq 'on');
         run_voice_cmd 'stop cam 8' if ($state eq 'off');
        }

INHERITS

Generic_Item

METHODS

register()

Used to associate child objects with the interface.

DOORBIRD_Bell

SYNOPSIS

User code:

    $DOORBIRD_Bell = new DOORBIRD_Bell('DOORBIRD', 1);

     Wherein the format for the definition is:
    $DOORBIRD_Bell = new DOORBIRD_Bell(INSTANCE, ENABLECONFIG);

See new() for a more detailed description of the arguments.

DESCRIPTION

 Tracks doorbell button pushes in MH. 

INHERITS

Generic_Item

METHODS

new($doorbell, $config )

Instantiates a new object.

$doorbell = The DOORBIRD of the doorbell that this zone is found on

$config = If you want this module to configure the DOORBIRD doorbell to post updates to MH, then this value should be a 1, else 0. If you disable auto configure (0), you must manually configure the doorbell using the API with the MH URL you want the doorbell to post to.

DOORBIRD_Motion

SYNOPSIS

User code:

    $DOORBIRD_Motion = new DOORBIRD_Motion('DOORBIRD', 1);

    Wherein the format for the definition is:
    $DOORBIRD_Motion = new DOORBIRD_Motion(INSTANCE, ENABLECONFIG);

    States:
    ON
    OFF

See new() for a more detailed description of the arguments.

DESCRIPTION

Tracks doorbell motion in MH.

INHERITS

Generic_Item

METHODS

new( $doorbell, $config )

Instantiates a new object.

$doorbell = The DOORBIRD doorbell that this motion sensor is found on

$config = If you want this module to configure the DOORBIRD doorbell to post updates to MH, then this value should be a 1, else 0. If you disable auto configure (0), you must manually configure the doorbell using the API with the MH URL you want the doorbell to post to.

DOORBIRD_Relay

SYNOPSIS

User code:

   $DOORBIRD_Relay = new DOORBIRD_Relay('DOORBIRD', 1);

   Wherein the format for the definition is:
   $DOORBIRD_Relay = new DOORBIRD_Relay(INSTANCE, ENABLECONFIG);

States: ON OFF

  Control States:
  TOGGLE (to trigger the relay)
  LIGHT_ON  (to enable the IR light on the door bell)

See new() for a more detailed description of the arguments.

DESCRIPTION

Tracks/controls doorbell relay in MH.

INHERITS

Generic_Item

METHODS

new( $doorbell, $config )

Instantiates a new object.

$doorbell = The DOORBIRD doorbell that this door relay is found on

$config = If you want this module to configure the DOORBIRD doorbell to post updates to MH, then this value should be a 1, else 0. If you disable auto configure (0), you must manually configure the doorbell using the API with the MH URL you want the doorbell to post to.

INI PARAMETERS

NOTES

AUTHOR

Wayne Gatlin <wayne@razorcla.ws>

SEE ALSO

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.

 DOORBIRD.pm