Hi Kevin,

Thanks for the reply.

For some reason, lately, I haven't been getting updates from the
misterhouse-users@lists.sourceforge.net list. Although I do get
it through hotmail.com so maybe that's the issue.

As for the X10 Dim / Insteon problem...

Below is some sample basic code from http://www.madreporite.com/insteon/x10.html

to show how to dim an X10 light from an Insteon controller.

Also below that is some "RRK" log prints that I instrumented in
mh/lib/Insteon/Message.pm to show that when a Dim cmd
(such as -70) is ignored (or incorrectly sent) by the routine.

Perhaps changes could be made in the Insteon code to do something
like the basic code suggests for X10 Dim commands?

=================

mh/lib/Insteon/Message.pm:

sub generate_commands

        my $cmd=$p_state;
        &::print_log("RRK PLM:cmd=$cmd");
        $cmd=~ s/\:.*$//;
        $cmd=lc($cmd);
        my $msg;

        my $id=lc($p_setby->{id_by_state}{$cmd});
        &::print_log("RRK PLM:id=$id");

        my $hc = lc(substr($p_setby->{x10_id},1,1));
        my $uc = lc(substr($p_setby->{x10_id},2,1));
        &::print_log("RRK PLM:p_setby=$p_setby->{x10_id}");

======= here I sent a Dim by -70 cmd to an X10 lamp module ========

05/26/13 10:21:23 RRK PLM:cmd=-70
05/26/13 10:21:23 RRK PLM:id=
05/26/13 10:21:23 RRK PLM:p_setby=XB2
05/26/13 10:21:23 [Insteon_PLM] x10 sending code: B2 as insteon msg RRK1: 0000
05/26/13 10:21:23 [Insteon_PLM] DEBUG2: Sending 0000 incurred delay of 0.00 seconds; starting hop-count: ?
05/26/13 10:21:23 [Insteon_PLM] DEBUG3: Sending  PLM raw data: 02630000
05/26/13 10:21:23 [Insteon_PLM] DEBUG4:
         PLM Command: (0263) x10_send
         X10 Message: 0000
          X10 House Code: (0) M
           X10 Unit Code: (0) D

05/26/13 10:21:23 [Insteon_PLM] DEBUG3: Received PLM raw data: 0263000006
05/26/13 10:21:23 [Insteon_PLM] DEBUG4:
         PLM Command: (0263) x10_send
         X10 Message: 0000
          X10 House Code: (0) M
           X10 Unit Code: (0) D
        PLM Response: (06) ACK

05/26/13 10:21:23 [Insteon_PLM] DEBUG3: Received PLM acknowledge: 0000

========== basic Dim X10 cmd code =========

To send an X10 Bright command:

Dim data(3) as Byte
Dim Level as integer ' the amount to brighten (on a scale 0-100)
Dim i as Short

data(0) = 2   ' start first message: send X10 address only
data(1) = 99  ' 0x063 = Send X10
data(2) = PLM_X10_House(house + 1) + PLM_X10_Device(device)  ' X10 address (house + device)
data(3) = 0   ' flag = this is the address
SerialPLM.Write(data, 0, 4)
For i = 1 To Int(Level * 0.22)
     Wait(500)
     ' brighten repeatedly to get to Level. 22 levels = 100%
     ' just send house + command (faster to not repeat address)
     data(0) = 2   ' start second message: send X10 house + command
     data(1) = 99  ' 0x063 = Send X10
     data(2) = PLM_X10_House(house + 1) + 5   ' X10 address (house + command)
     data(3) = 128 ' flag = this is house + address
     SerialPLM.Write(data, 0, 4)
Next i

To send an X10 Dim command:

Dim data(3) as Byte
Dim Level as integer ' the amount to brighten (on a scale 0-100)
Dim i as Short

data(0) = 2   ' start first message: send X10 address only
data(1) = 99  ' 0x063 = Send X10
data(2) = PLM_X10_House(house + 1) + PLM_X10_Device(device)  ' X10 address (house + device)
data(3) = 0   ' flag = this is the address
SerialPLM.Write(data, 0, 4)
For i = 1 To Int(Level * 0.22)
     Wait(500)
     ' brighten repeatedly to get to Level. 22 levels = 100%
     ' just send house + command (faster to not repeat address)
     data(0) = 2   ' start second message: send X10 house + command
     data(1) = 99  ' 0x063 = Send X10
     data(2) = PLM_X10_House(house + 1) + 4   ' X10 address (house + command)
     data(3) = 128 ' flag = this is house + address
     SerialPLM.Write(data, 0, 4)
Next i


Date: Wed, 29 May 2013 00:37:44 +0000
From: krkeegan@gmail.com
To: n1gp@hotmail.com
CC: misterhouse-users@lists.sourceforge.net
Subject: Re: [mh] Clues on how to dim an X10 light using Insteon Controller

Richard,

Sorry, I don't completely follow what you are describing and I don't use X10.

I gather some version of dimming for X10 devices isn't working.  A few quick questions:
- Does X10 support dimming to a specified level e.g. 20%?  Does that currently work?
- Does X10 support relative dimming such as -20%? Does that currently work?

It looks like the dimming you are describing requires a "start_dim" command to be sent and then a "stop_dim" command to be sent at some point thereafter?  I think this is something the code could support, at least something like dim for X seconds.  The user could then elect the number of seconds to dim which should overcome the various issues with different brands.

Kevin

------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with
________________________________________________________ To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365