From: Bruce W. <br...@mi...> - 2002-06-25 23:43:32
|
> That sounds good. I did not know if there was a more generic way without > having to have those statements for each light I have. Anyone have any > ideas on how to get the dim to work? > > - James > > $couch_lamp->set(ON) if $couch_lamp->state_now() eq ON; > $couch_lamp->set(OFF) if $couch_lamp->state_now() eq OFF; > > or more cryptic but equality valid > > set $counch_lamp $state if $state=state_now $couch_lamp; > > Alan Attached is some relevant code from mh/code/bruce/x10_mr26.pl. I'm not sure if dim works (I don't relay because busy motion detectors would overload the powerline with X10 traffic). You could adjust this code to relay just specific codes, or use the example Alan posted. Bruce ---- $Remote = new X10_MR26; #$Remote -> tie_event('print_log "MR26 key: $state"'); # Enable this code if you want the MA26 to relay # incoming RF X10 data to the power line. # You may want to limit this to not relay busy motion detectors $Transmitter = new X10_Item; if ($state = state_now $Remote and $state =~ /^X/) { print_log "Relaying X10 data from the MR26: $state"; set $Transmitter $state; } |