What I am expecting is the light to turn ON and DIM=1, ON again and DIM=2, ON again and DIM=3, etc...What is actually happening is the light turns ON and it DIMs at each cycle of i between 2 to 6. when i=6 the light is very DIM almost off and no difference between i=6 to 20The light never go back to ON between cycles.

I've tried setting the ON command with 3 repeats.I've tried different house codes.

How does the DIM and BRIGHT commands work? is the repeat time = 1 to 100 to generate 1% to 100%?And why doesn't my code work as it should?

See x10 pdf bottom of page 3. http://www.x10pro.com/pro/pdf/technote.pdfBright and Dim are exceptions to this rule and should be transmittedcontinuously (at least twice) with NO gaps betweencodes. See figure 3.

No technical PMs.The last thing you did is where you should start looking.

Dims and brightens an incandescent lamp on an X10 lamp module. Example was built using a PL513 X10 One-Way Interface Module from http://www.smarthome.com as the modem, and a Powerhouse X10 Lamp Module from Smarthome to plug the lamp in.

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:

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.

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.

This makes sense, since a Dimmed light is ON.

Quote

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.

Can you give a LINK to the library you have?

Did you try BRIGHT?

No technical PMs.The last thing you did is where you should start looking.

I assume the light will turn on and DIM to some level(and stay at that level).If you push Reset on the Arduino the light should DIM to a lower level (from the previous level).Each time you push the Reset the light should DIM lower and lower.

To get the light back to full bright you either have to do a number of BRIGHT commands or you have to turn off the light and then turn it back on.

If you want to get some kind of control over the % of brightness write a Function that iterates an "number" of times. This "number" would be determined by experimentation for example it may take 5 iterations of, myHouse.write(HOUSE_P, DIM, 3); delay(500); to go to 50% brightness.

FYIHave you seen this:http://playground.arduino.cc/X10/CM17Ahttp://www.x10.com/automation/ck18a_s_ps32.html

No technical PMs.The last thing you did is where you should start looking.

I understand the code example you indicated very well, no problem there.I can turn on and off any device in my house.

What I don't understand is the Bright and Dim command, I am unable to compute a value that is = to a specific brightnessIf I want to DIM a light exactly 50% I can do trial and error until I get it on one light but then when I apply this value to other lights in my house I get different results.In my previous system I was able to set 30% or 40% or 50%, etc... and no matter to which light it was applied to (as long as it is incandescent or halogen) I always got the same results.I don't understand why if i Dim with 3 repeats 8 times it does not have the same affect as if I Dim with 24 repeats 1 time.But Dim 1 repeat for 3 times = Dim 3 repeat for 1 time.I am not getting any logical results.

I don't think sending the codes to a Firecracker which will relay to another wireless device will resolve my problem.

I am working with a TW523 because this device worked well with my previous system without the need for filters or repeaters...

I don't understand why if I Dim with 3 repeats 8 times it does not have the same affect as if I Dim with 24 repeats 1 time. But Dim 1 repeat for 3 times = Dim 3 repeat for 1 time.

The lack of repeatability is upsetting.It is my understanding that the X10 DIM and BRIGHT commands require 2 repeats, you then issue them a number of times to achieve a certain level (but it looks like your experience shows otherwise).To be consistent you will have to use candle light

FYI, you probably seen this LINK:http://load-8-1.blogspot.ca/2010/06/x10-plc-rf-ir-and-computer-interface.htmlhttp://code.google.com/p/arduino-x10/source/browse/trunk/Libraries/X10ex/X10ex.cpp

No technical PMs.The last thing you did is where you should start looking.

I believe I have it all figured out finely!The reason why I was always getting different results is because for some reason the TW523 remembers the status of a device, so every time I ran my program, it Dimmed or Brightened from the previous value.

I have resolved this by calling a function that fully brightens the light before processing the dim command to a specific value and concluded the value of brightness or Dimness is between 1 to 100 so if I dim 50 times the light will be at 50% of its brightness.

I have also came to conclusion that when calling the DIM or BRIGHT command, using a repeat value of greater than 1 does not work properly and I believe it is because of a bad time delay between the repeats.when I use a loop to dim or brighten with a repeat value of 1 it is now working.

I have not yet applied this to my complete house but I have tested on one light over and over with always the same results.

I like it when a plan comes together!The tw523 has no memory. It is the module itself that remembers the on/off & the dim/bright levels. It's-good to know that the way to use dim/bright should be used with 1 repeat. By the way the older x10 modules do not have the ability to transmit so you cannot read from them. It's probably a good idea to have a spare tw523 on hand.

Good for you for sticking with your project!

PSI made a micro chip controller x10 receiver that has 32 relays (2 house codes) works great! 1-16 are on/off and 17-32 are momentary on.

No technical PMs.The last thing you did is where you should start looking.