Ok, if what you want is for the laundry light to only be on when $Dark is set and there is motion in the room then that is exactly what LOMP is for and I think you are almost there.

So after applying the patch I sent earlier which fixes the problem of the light coming on when the state of $Dark changes I think all you need is to expire the presence monitor.  Assuming your sample is all the LOMP stuff you are using right now you don't have adjoining presence objects for $pm_Laundry_Room to pass to.  Once presence is detected with your motion detector it will never go away.

So all you should need to add is this which says drop the occupancy after 5 minutes of no motion :
$pm_Laundry_Room->occupancy_expire(5*60);


Now I haven't had the time to figure out how the occupancy_expire and delay_off will interact.  If it takes 5 minutes for the occupancy to expire will it then wait another 5 minutes for the delay off to expire before it shuts off the light?

my $lr_only_when_dark = new Light_Restriction_Item();

$lr_only_when_dark->attach_scalar(\$Dark);

 

$li_Laundry_Room_Lights->add($mi_Laundry_Room_Motion, $pm_Laundry_Room, $lr_only_when_dark);

$li_Laundry_Room_Lights->delay_off(5*60);




On Tue, Sep 28, 2010 at 12:15 PM, Timothy Spaulding <spaulding@icanbrew.com> wrote:

I guess I am still not saying it correctly.

 

I do not want the light on all the time when it is $Dark.  I only want the light to come on when I trip the motion detector during this time ($Dark).  However, right now, the light is coming on when $Dark is being set to 1 (which I think is being set when it is sunset_twilight).  Since this is a laundry room and the door remains closed, there is no motion in the room most of the time.  I do not want the light to come on as soon as the $Dark variable is set to 1, but only when there is motion and it has a value of 1.

 

In thinking about my environment more, I may have come up with an idea to chase that may solve it.

 

From: Chris Engel [mailto:chrisengel@gmail.com]
Sent: Tuesday, September 28, 2010 12:24 PM


To: The main list for the MisterHouse home automation program
Subject: Re: [mh] Coding of Events Question

 

 

On Tue, Sep 28, 2010 at 11:03 AM, Timothy Spaulding <spaulding@icanbrew.com> wrote:

I don’t know about turning off the light as I never wait that long for when the $Dark variable will be set to 0 by the code a t sunrise*.

 

What I was intending to say is that the light in the laundry room will come on as soon as the $Dark variable is set to 1 by it being sunset_twilight, even though there is no occupant (attached presence monitor) to the light item.

 

 


So you want the light to be on the entire time the $Dark variable is set regardless of motion/doors/ or presence ?  Not certain how to do that at the moment with the LOMP stuff may be just easier to write code to turn the light on/off without using LOMP.



--
   Chris


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365





--
   Chris