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

Description

An abstract object that represents a motion detector that you can add to a . You typically associate a real motion detector (i.e. a hard-wired one or an X10 Hawkeye) to this object. It will also indicate the state of the motion detector on floorplan.pl if given proper coordinates.

When attached to a , it will cause the light to be turned on whenever motion is detected. Typically you attach several objects to the same . See 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 motion detector: code format="perl" X10MS, B7, x10_motion_master_bedroom, Sensors, MS13 code Then define the Motion_Item and attach to the real object: code format="perl" MOTION, x10_motion_master_bedroom, motion_master_bedroom code Using from your user code: code format="perl"

  1. Attaching to a Light_Item (automatically turns light on)
$auto_master_bedroom_light->add($motion_master_bedroom); code Input states: /: motion detected /: motion no longer detected

Output states:

motion detected
motion timer expired
inactivity timer has expired -- batteries may be dead?

Optional Inactivity Alarm: If you want to be alerted when motion hasn't been detected 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" $motion_master_bedroom->set_inactivity_alarm( 48, # hours "speak('master bed motion detector battery may be dead');" # command ); code The default is to log a message in the print log after 24 hours.

Clone this wiki locally