Trying to understand X10 DIM

Hi Larry,

In your first example, every 20 seconds the light dimmed a little more for up to 8 cycles after which its luminosity was like a small candle. Every other cycle didn't make a difference.
Doing this also gave the same results:

void loop() {
    Serial.println("DIM");
    for(int i=1; i<4; i++){
    myHouse.write(HOUSE_P, DIM, 1);         // send the DIM command 3 times every 20 seconds
    }
    delay(20000);          
     
  }

These examples leads me to thing every time a DIM command is repeated, it DIMs some more and in this case it took 8 cycle of 3 repeats to completely dim the light so 24 times, I tried to do:

myHouse.write(HOUSE_P, DIM, 24);

but unexpectedly it took this 3 cycles to DIM the light as low as previous.
I have done a lot of different tests and I am unable to get to a conclusion of how exactly it works.

Something else I have observed, once the light is dimmed to any level the ON command has no affect, I had to make a small script and issue an Off then On before I can do some more DIM testing.

In your second code example this is an old version of X10 library that does not support reading from the device, although I didn't get to this yet the example code does not work because I have the newer version of the library.

I understand X10 is not reliable and would be tempted to just go a different route using wireless but I have about 20 light switches, lamp modules, appliance modules, 3 way switches around the house that was all working well for the past 8 years. It was controlled by an old system http://www.secant.ca/En/Company/ connected to a TW523 (the same module I am testing with) since the keypad of my old system went down with a $200 cost to replace I figured i would just replace this big system that is enclosed in a 12" X 18" box with a tiny Arduino.

Perhaps if I find the way to read from the TW523, if I could read the DIM level of a lamp I could repeat the DIM command until the DIM level is a the right setting but I am starting to wonder if there is a DIM level... There must be as on my old system I was able to select x% and I always got the same % value.