Pages: [1]   Go Down
Author Topic: X10 Commands?  Two questions.  (Read 536 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

* When sending multiple X10 commands, does the X10 library buffer these or should a delay be implemented as not to over run the X10 modem?

* I'm using the following in my application that specifies a house code ("C") and the unit number (1), and then the action (turn ON).  I'm also tracking the state of the module with a flag such that I don't repeat sending X10 command every loop through the program.

   // X10 Code
   // Bathroom Heater Control, House code C, appliance module 1
   // Turn heater ON at 5 AM if it's already OFF
   if((hour() == 5) && (X10_C1 == false)){
      myHouse.write(C, UNIT_1,repeatTimes);              
      myHouse.write(C, ON,repeatTimes);
      X10_C1 = true;  
   Serial.println("Bathroom Heater ON");

I see the following in the X10_blink example and I'm not clear on its usage.  Since it doesn't specify a module number does this send an ALL Lights on command to all house code "A" modules?

  Serial.println("Lights on:");
  // send a "lights on" command 3 times:
  myHouse.write(A, ON,3);



Offline Offline
God Member
Karma: 20
Posts: 779
Inactive - PM
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

does the X10 library buffer these
I don't think the X10 lib buffers commands (however each command is sent on the powerline 3 times anyway.) It looks like your state array is an effective way to prevent multiple sends for timed events though.

X10_blink example and I'm not clear on its usage
I didn't look at the whole example, but you should know that it actually takes 2 commands to do something. The first sets the House and Unit code and the second repeats the House code and sends the command (i.e. ON/OFF, etc.). Once the first command is sent, the Unit code is "remembered" and used for any commands that follow. So you can send the first command and then as many of the second commands as you wish and they will act on the Unit from the first command.  :-?

BTW, if your serious about going further you should consider using the X10 libs from ThomasM . . .
You can send and receive, commands are buffered, and repeats identified. It also handles X10 RF reads.

To answer your second post, personally I think a status table belongs in the application rather than the lib. There are too many options to dictate one.

I also have a blog with several X10 projects here.
« Last Edit: January 18, 2011, 12:05:27 pm by BroHogan » Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Pages: [1]   Go Up
Jump to: