From: Steven L. <st...@le...> - 2004-01-22 02:32:02
|
Howdy James, I sent the code changes in and I'm guessing that your items.mht does not have the "preset" flag set. Example: X10SL, L3, quentin_bath_light, Upstairs|Quentins_Bedroom(20;20), ,preset # SL-2380W However, this brings up a good point that the X10_Switchlinc should always be preset. I'm going to suggest one more line of code to change. ######################################################## package X10_Switchlinc; @X10_Switchlinc::ISA = ('X10_Item'); @preset_dim_levels = qw(M N O P C D A B E F G H K L I J); sub new { my $self = &X10_Item::new(@_); my $id = $self->{x10_id}; $self->{type} = 'preset'; # ADD THIS LINE HERE !!!!!!!!!!! $self-> add ('XOGNGMGPGMG', 'clear'); $self-> add ('XOGPGNGMGMG', 'setramprate'); $self-> add ('XPGNGMGOGMG', 'setonlevel'); $self-> add ('XMGNGOGPG', 'addscenemembership'); $self-> add ('XOGPGMGNG', 'deletescenemembership'); $self-> add ('XNGOGPGMG', 'setsceneramprate'); $self-> add ('XMGNGPGOGPG', 'disablex10transmit'); $self-> add ('XOGMGNGPGPG', 'enablex10transmit'); # 0% is MPRESET_DIM1 $self-> add( $id . $preset_dim_levels[0] . 'PRESET_DIM1', "0%" ); # 100% is JPRESET_DIM2 $self-> add( $id . $preset_dim_levels[15] . 'PRESET_DIM2', "100%" ); # 30 levels, 1% to 99% for (my $percent=1; $percent<=99; $percent++) { my $index = int(($percent - 1) * 30 / 99) + 1; my $state2 = $id . ( ($index < 16 ) ? $preset_dim_levels[$index] . 'PRESET_DIM1' : $preset_dim_levels[$index - 16] . 'PRESET_DIM2'); $self-> add( $state2, $percent . "%" ); } return $self; } ######################################################## Thanks, -Steven -----Original Message----- From: mis...@li... [mailto:mis...@li...]On Behalf Of James Armstrong Sent: Wednesday, January 21, 2004 12:52 PM To: mis...@li... Subject: [misterhouse-users] Latest snapshot / 2 way x10 lighting problem I downloaded and installed a daily build of Misterhouse about a week ago. I have a problem I can't figure out that worked before that. It seems there is a problem with SwitchLinc 2way dimmers in this code. I have a light in the bathroom that I have coming on with motion during that evening at 100% and it is working ok. After 8pm I have it coming on at 40% (direct percent, not 100% then -60). When it detects motion I get full brightness then it dims within a few seconds until it is completely off. I started playing with occupancy detection and automatic lighting in the livingroom. It was just turning on the light when motion was detected. I changed it lastnight to use the ->set_on_state('40%') if after a certain time and it is now doing the same thing were the light comes on then dims until off. -James ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ________________________________________________________ To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 |