From: David N. <dno...@ya...> - 2009-03-17 07:47:45
|
Would you post your updated script? David ----- Original Message ----- From: "Pete C" <ha...@th...> To: <mis...@li...> Sent: Friday, March 13, 2009 7:06 PM Subject: Re: [mh] Newbie Help > Marc MERLIN wrote: >> On Thu, Mar 12, 2009 at 08:33:40PM -0400, Pete C wrote: >> >>> now to code some perl .. never having done so, I looked over the >>> examples and I figure I'd try a basic motion on / timer off on my >>> laundry room light .. I came up with .. >>> >> >> I would first start by making sure that your script is actually being >> run. >> Just put a print in there outside of the ifs, and see if you get that. >> >> I'm assuming of course you probably configured mh to parse the directory >> your code is in. >> >> >>> #------- Laundry Room Light (motion on, timer off) ------ >>> >>> $laundry_rm_light = new X10_Item('M1'); >>> $laundry_rm_md = new X10_Sensor('M9'); >>> $laundry_rm_timer = new Timer(); >>> >>> if (state_now $laundry_rm_md eq ON) { >>> if (state_now $laundry_rm_light eq OFF) { >>> set $laundry_rm_light ON; >>> print "laundry room lights on"; >>> } set $laundry_rm_timer 240; >>> } >>> >>> if (expired $laundry_rm_timer) { >>> set $laundry_rm_light OFF; >>> print "laundry room lights off"; >>> } >>> >>> which I put in /localcode/laundry_rm.pl, restarted MH and tested with a >>> RF remote to no avail .. >>> >>> pretty sure it's something basic I'm overlooking .. >>> >>> TIA >>> >>> Pete C >>> > yes, putting the 'print' in there works .. I also made a change from > 'laundry_rm_md eq ON' to 'laundry_rm_md eq MOTION' and now the light > comes on and goes off after the timer expires .. but then I get a > constant flood of 'laundry room lights off' in the logs .. docs say > 'expired' a one pass event .. why am I getting flooded with offs ? > > Pete C > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > ________________________________________________________ > To unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 > |