Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Multi-x with X-10 unit codes allocated Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Deano
Groupie
Groupie
Avatar

Joined: February 19 2003
Location: United States
Online Status: Offline
Posts: 75
Posted: March 03 2005 at 14:33 | IP Logged Quote Deano

Dave,

After a long absense, I'm back to learning PH. Installed my christmas present (W800RF32A) and reception range is excellent (hope relialibility compared to MR26A is also improved).

With enhansed range I'm beginning to think about using key chain remotes again to do things like open garage doors and set away flags but you really need to use multi-x on thise things if you keep them in you pocket or you get some interesting supprizes when you lean against the wall or bend over.

I'm using House code C and I set a trigger for ANY(Before Buffer) and OFF with the intent of handeling multi-x with a macro call where C1 on + C1 off opens north door and C2 on + C2 off opens south door.

Right now my macro consists only of Message Box "[X10P00] [X10P01] [X10P02] [X10P03]" and I find that I get the expected result as long as I don't define C1 and C2 in the X10 House code section. I guess I can live with that as a fix but I would like to better understand what is going on. (I'm not SQL literate)

1. Is there an echo thing going on with W800RF32A? My W800 is controller 2 and if I configure C1 or C2 to use controller 1 (cm11a) (left over when I was trying to use keychains wiht tm751) I get stuff (wrong stuff) but I didn't think I would get anything.

2. I've read your disertation on buffers somewhere here but it didn't compute. Am I using the right trigger?

3. Is there a better way to output info to the screen other than Message box. I build up quite a stack of them that have to be disposed of individually.

4. Is there someplace on the WEB where I can get SQL tutoring without beginning a new carrer as a database guru?
Back to Top View Deano's Profile Search for other posts by Deano
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: March 04 2005 at 11:19 | IP Logged Quote dhoward

Welcome back Deano!

Concering the multi-x working when you don't define the units in the X10 Housecode section...Yes, this is by design. In order to reduce clutter in the previous X-10 incoming buffer, it's assumed that if you're defining the units, then they are actual units and most likely would not be used for multi-x. However, if you go to the X10 Unitcodes screen, you'll see a field called "Previous Exclude". Uncheck this field and the incoming X-10 will be placed in the buffer even if the unit is defined. No need for SQL on this one .

The W800RF32A does support the echoing of received RF to the Powerline. You'll have to open your pwrhome.ini file and edit it manually. Look for the W800RF32A section. It should look something like:

[W800RF32]
TimeOut=500
UpdateStatus=yes
Echo=
EchoController=0
IgnoreCM17A=no
AllowExtended=yes

You'll want to set the "Echo" parameter to the housecodes you wish to echo commands for. For example, if you want to echo commands for housecodes B, D, F, and G, then set the echo parameter to: Echo=BDFG. You'll also need to set the "EchoController" parameter to the controller number that you wish to have the commands echoed on. For instance, if you have a CM11A as X-10 controller 1 and the W800RF32A as X-10 controller 2, then set this parameter to 1 so the commands will be sent out on the CM11A. The only other parameter you may want to set is the "UpdateStatus" parameter. Since RF codes are not actual X-10 powerline codes (unless of course you echo them or you're using a transceiver which automatically echoes them), they don't directly update status within the PowerHome database. For instance, if you have a motion sensor defined on D1, an incoming X-10 RF command from the D1 motion sensor will not update the status within PowerHome. You would have to do this manually through a trigger. If you set the "UpdateStatus" parameter to "yes", then the incoming RF commands will automatically update the status for you.

No other way to really display info other than using MessageBox. You could launch the PowerHome Status window and watch the eventlog scroll by in real time and post User messages though. You could even setup a PSP page that auto refreshed every few seconds to pull User messages from the eventlog as well.

As far as an online SQL tutorial...I did a quick Google and the one at: http://www.1keydata.com/sql/sql.html looked fairly decent.

And last...the trigger you really should be using is the ANY (After Buffer). You can get away with the Before Buffer sometimes because by the time you execute the macro, the buffer will be updated, but it's safer to use the "After Buffer" trigger.

I also see you using the "Global" incoming X-10 queue with the [X10P00] type variables. This could cause problems if say a motion sensor went off right in the middle of your multi-x sequence. For example, if you're using multi-x on housecode C and your motion sensors are on housecode D, you could get a multi-x sequence of: C1 ON, D3 ON, C2 OFF which would throw off your multi-x checking. You would be better off using the ph_multix function and limiting yourself to checking the actual housecode that multi-x is using.

Below, Im copying and pasting a skeleton for multi-x on Housecode C. You'll see the two triggers for C Any ON and C Any OFF as well as the macro that they call. Every possible combination for a keychain remote on Housecode C is handled for with a User Message being sent to the Eventlog. From here, you could easily expand this to however you like:

insert into triggers values ('C ANY ON','C ANY ON','MULTIX C',8,'C',100,2,'1',1,1,0);
insert into triggers values ('C ANY OFF','C ANY OFF','MULTIX C',8,'C',100,3,'1',1,1,0);
insert into macroheader values ('MULTIX C','MULTIX C',0,0,1);
insert into macrodetail values ('MULTIX C',1,27,'',NULL,'ph_multix("C",1,2)',0);
insert into macrodetail values ('MULTIX C',2,27,'',NULL,'"END"',0);
insert into macrodetail values ('MULTIX C',3,26,'',NULL,'C0102C0102',0);
insert into macrodetail values ('MULTIX C',4,36,'',NULL,'"Multi-X C1ON-C1ON received."',0);
insert into macrodetail values ('MULTIX C',5,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',6,26,'',NULL,'C0102C0103',0);
insert into macrodetail values ('MULTIX C',7,36,'',NULL,'"Multi-X C1OFF-C1ON received."',0);
insert into macrodetail values ('MULTIX C',8,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',9,26,'',NULL,'C0102C0202',0);
insert into macrodetail values ('MULTIX C',10,36,'',NULL,'"Multi-X C2ON-C1ON received."',0);
insert into macrodetail values ('MULTIX C',11,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',12,26,'',NULL,'C0102C0203',0);
insert into macrodetail values ('MULTIX C',13,36,'',NULL,'"Multi-X C2OFF-C1ON received."',0);
insert into macrodetail values ('MULTIX C',14,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',15,26,'',NULL,'C0103C0102',0);
insert into macrodetail values ('MULTIX C',16,36,'',NULL,'"Multi-X C1ON-C1OFF received."',0);
insert into macrodetail values ('MULTIX C',17,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',18,26,'',NULL,'C0103C0103',0);
insert into macrodetail values ('MULTIX C',19,36,'',NULL,'"Multi-X C1OFF-C1OFF received."',0);
insert into macrodetail values ('MULTIX C',20,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',21,26,'',NULL,'C0103C0202',0);
insert into macrodetail values ('MULTIX C',22,36,'',NULL,'"Multi-X C2ON-C1OFF received."',0);
insert into macrodetail values ('MULTIX C',23,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',24,26,'',NULL,'C0103C0203',0);
insert into macrodetail values ('MULTIX C',25,36,'',NULL,'"Multi-X C2OFF-C1OFF received."',0);
insert into macrodetail values ('MULTIX C',26,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',27,26,'',NULL,'C0202C0102',0);
insert into macrodetail values ('MULTIX C',28,36,'',NULL,'"Multi-X C1ON-C2ON received."',0);
insert into macrodetail values ('MULTIX C',29,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',30,26,'',NULL,'C0202C0103',0);
insert into macrodetail values ('MULTIX C',31,36,'',NULL,'"Multi-X C1OFF-C2ON received."',0);
insert into macrodetail values ('MULTIX C',32,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',33,26,'',NULL,'C0202C0202',0);
insert into macrodetail values ('MULTIX C',34,36,'',NULL,'"Multi-X C2ON-C2ON received."',0);
insert into macrodetail values ('MULTIX C',35,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',36,26,'',NULL,'C0202C0203',0);
insert into macrodetail values ('MULTIX C',37,36,'',NULL,'"Multi-X C2OFF-C2ON received."',0);
insert into macrodetail values ('MULTIX C',38,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',39,26,'',NULL,'C0203C0102',0);
insert into macrodetail values ('MULTIX C',40,36,'',NULL,'"Multi-X C1ON-C2OFF received."',0);
insert into macrodetail values ('MULTIX C',41,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',42,26,'',NULL,'C0203C0103',0);
insert into macrodetail values ('MULTIX C',43,36,'',NULL,'"Multi-X C1OFF-C2OFF received."',0);
insert into macrodetail values ('MULTIX C',44,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',45,26,'',NULL,'C0203C0202',0);
insert into macrodetail values ('MULTIX C',46,36,'',NULL,'"Multi-X C2ON-C2OFF received."',0);
insert into macrodetail values ('MULTIX C',47,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',48,26,'',NULL,'C0203C0203',0);
insert into macrodetail values ('MULTIX C',49,36,'',NULL,'"Multi-X C2OFF-C2OFF received."',0);
insert into macrodetail values ('MULTIX C',50,27,'',NULL,'"CLEAR"',0);
insert into macrodetail values ('MULTIX C',51,26,'',NULL,'CLEAR',0);
insert into macrodetail values ('MULTIX C',52,13,'C',0,'',0);
insert into macrodetail values ('MULTIX C',53,26,'',NULL,'END',0);

HTH,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
Deano
Groupie
Groupie
Avatar

Joined: February 19 2003
Location: United States
Online Status: Offline
Posts: 75
Posted: March 05 2005 at 10:36 | IP Logged Quote Deano

Dave,

Thanks again for the prompt reply and you patience with my dump questions.

I had a little trouble pasting the macro. After I went back to the post where you told me how to do it, my first couple of attempts resulted in attempts to launch some web page
Next problem was the macroheader instruction apparently didn't have the correct number of parameters but after manuallly creating the macro header, I was able to paste the remainder of the macro. Now if I could just figure out how to select and cut

Some clever stuff here - makes me a little more dangereous but I do have one question. I understand how the fisrt statement works but the second is mysterious. Is GO TO LABEL a case structure with a built in else?

I lied: Question 2 Timming? If I push the buttons too fast it dosent work and I assume that is due to the 500ms delay in powerhome.ini for W800RF32 (I recall that was there for some good reason but I don't remember what it was) but it also dosen't work if I wait too long between button pushes. This is a good thing (I can't believe I said that - must be because Martha is out of the Slammer ) but what controls this delay?

Best Regards,

Dean
Back to Top View Deano's Profile Search for other posts by Deano
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: March 05 2005 at 19:36 | IP Logged Quote dhoward

Dean,

Nahh...the Goto Label command evaluates a formula and then goes the result of the formula. However...if the result of the formula is a label that does not exist, then execution continues to the next statement. So what you see in line 10 is an attempt to go to a label identified by a multi-x sequence. In the sample, Ive declared every possibility (unless of course you count something like a palm pad sending sequences on housecode C and then you could have up to 256 possibilities). However, if the first statement should evaluate to a label that we didnt declare, we don't just want execution to continue to the next statement. So line 20 handles exceptions and jumps to the END.

Concerning pushing the buttons to slow. Yep, there is a parameter that controls that. It's in the Explorer under Setup->Controllers->X-10 and is called "Previous X-10 Incoming Timeout (sec)". The default value is 3 seconds. If your button presses come more than 3 seconds apart then the multi-x wont work. Everytime an incoming X-10 command is received (assuming it isnt excluded), the current time is compared to the previous commands time. If the difference is greater than the Incoming X-10 Timeout, then the previous commands multi-x value is set to "00000". This will essentially cause any multi-x comparison to fail.

Concerning buttons too fast. When a keychain or palmpad (or motion detector) sends an RF X-10 command, it doesnt send just one, but rather repeats the command for a specified amount of time. In my testing, this is usually about a half second (500 ms). However, different devices send for a slightly different amount of time. You can fine tune this value yourself. Try setting the value to 250 ms, saving the ini file, and then reinitializing PowerHome. Open the PowerHome status and try pressing some buttons. If you get a single event registered, you're OK. If you get two (or more) events registered, then you'll need to increase the value. Just be sure you save and reinitialize in between changes.

Sorry you had problems on the import . That's one of the bad things about PowerHome is that any imports and exports are very version specific. I created that using the latest alpha that Im working on and it may have a different number of fields (that or you're not using the latest beta ).

And no question is dumb. If you need any more help, just let me know.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
guerrand
Senior Member
Senior Member
Avatar

Joined: December 18 2005
Location: United States
Online Status: Offline
Posts: 106
Posted: February 06 2007 at 23:31 | IP Logged Quote guerrand

Hey Dave, does this need to be edited in any way to work with the current version. I keep getting

Direct SQL Error
Invalid SQL Code -207
SQLSTATE = 21S01 [Sybase][ODBC Driver][Adaptive Server Anywhere]Insert value list does not match column list: Wrong number of values for INSERT

when it gets to the line

insert into macrodetail values ('MULTIX K',1,27,'',NULL,'ph_multix("K",1,2)',0);

or any line after that. I'd enter them manually but am unsure about what each is supposed to be. (just starting with multix) For example. What does the 27 stand for?
I've been looking around for more info but haven't been able to find anything that directly answers my question.

__________________
VuMe
Back to Top View guerrand's Profile Search for other posts by guerrand Visit guerrand's Homepage
 
guerrand
Senior Member
Senior Member
Avatar

Joined: December 18 2005
Location: United States
Online Status: Offline
Posts: 106
Posted: February 07 2007 at 01:53 | IP Logged Quote guerrand

Never mind, I figured it out.

__________________
VuMe
Back to Top View guerrand's Profile Search for other posts by guerrand Visit guerrand's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum