From: Timothy S. <spaulding@ICanBrew.com> - 2004-09-22 02:05:43
|
Hi All, =20 I have timer objects that control how long a light will stay on after motion has been detected in a room. Lately, the light would work properly after mH starts (and sometimes a reload), but not anymore after the timer expires and turns off the light. =20 Well, I played some tonight with it and found that the timer object is still active (I count on it being inactive to trip the light object). Since it is still active (even after it has expired), I decided to check the minutes remaining. You'll never guess how minutes were remaining: -18146.0 (give or take a few minutes). =20 I am on version 2.92 and I notice that the inactive sub for the timer object has changed from 2.90 to 2.92. =20 my code: # Laundry_Room_Motion $Laundry_Room_Motion_Timer =3D new Timer; =20 if (state_now $Laundry_Room_Motion eq 'motion' and (dark $Laundry_Room_Motion or active $Laundry_Room_Motion_Timer)) { speak "rooms=3Doffice motion spotted in the laundry room"; if (inactive $Laundry_Room_Motion_Timer) { speak "rooms=3Doffice timer is inactive"; set $Laundry_Room_Lights 'ON'; } else { speak "rooms=3Doffice timer active: minuts remaining are: " . $Laundry_Room_Motion_Timer->minutes_remaining; } set $Laundry_Room_Motion_Timer 3*60; } =20 if (expired $Laundry_Room_Motion_Timer) { set $Laundry_Room_Lights 'OFF'; speak "rooms=3Doffice timer has expired"; } =20 Any thoughts on how to fix this? I was waiting to go to 2.95 after it came out--maybe this weekend. |