-
Notifications
You must be signed in to change notification settings - Fork 130
Items Motion_Tracker
ggodart edited this page Jan 5, 2021
·
1 revision
See original
This tracks an X10_Sensor
and provides information on the last time motion was seen by the sensor.
Defined in items.mht
as
#
X10MS, C10, room1_sensor, Sensors
And in code as
my $room1_tracker = new Motion_Tracker(room1_sensor, 2*60);
print_log "Last motion was " . $room1_tracker->age();
Method | Description |
---|---|
TIESCALAR |
Part of tie mechanism to track last_motion variable |
FETCH |
Part of tie mechanism to track last_motion variable |
STORE |
Part of tie mechanism to track last_motion variable |
set |
Set the state of this tracker. Valid states input states are 'motion', 'on', 'occupied' or 'vacant'. All other states are ignored. Output states are 'occupied' or 'vacant'. |
expire_timeout |
Get/set the expire timeout. This controls how long after the last motion is seen until when the tracker will be set to 'vacant'. Will not take effect until next motion is detected (fix?). |
age |
Return number of seconds since last motion was detected |
last_motion |
Get/set the last motion time. Call with one argument to set last_motion, call with no arguments to return last_motion time. If last_motion was more than expire_timeout seconds ago, then the state will be set to 'vacant'. Otherwise, a timer will be started to set the state to 'vacant' after expire_timeout seconds have elapsed. |
print_state |
Return vacant/occupied state and time since last motion as a string |
John Dillenburg [email protected]
None