Author |
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 17 2005 at 16:40 | IP Logged
|
|
|
A person on CocoonTech was getting rid of ALL of his HA hardware, and I bought one of his RCS TX10-B X-10 bidirectional thermostats and wall display units.
I found out that using the ph_x10 command for sending preset dim info needs the house and unit codes defined to work (even though it seems that the manual says it does not). Maybe I have this wrong somehow?
This will be a fun weekend project! Everything is done through preset dim values, so, there will be lots of logic involved to fold this in to my system.
I have the system on my desk for testing, and all is well so far. Now to come up with some code!
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 19 2005 at 08:12 | IP Logged
|
|
|
Here is what I have so far...
Code:
insert into macroheader values ('TSTAT','TSTAT FUNCTIONS',0,0,1);
insert into macrodetail values ('TSTAT',1,36,'',NULL,'"TStat: [TEMP4] " + "[TEMP3]"',0);
insert into macrodetail values ('TSTAT',2,27,'',NULL,'if( "{TSTAT FUNC}" = "SPCHG", "SP CHG", " ")',0);
insert into macrodetail values ('TSTAT',3,27,'',NULL,'if( "{TSTAT FUNC}" = "TCHG", "TEMP CHG", " ")',0);
insert into macrodetail values ('TSTAT',4,16,'',NULL,'if( [TEMP4] = 6 and [TEMP3] = 2, 1, 3)',0);
insert into macrodetail values ('TSTAT',5,10,'TSTAT MODE',NULL,'"Heat"',0);
insert into macrodetail values ('TSTAT',6,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',7,16,'',NULL,'if( [TEMP4] = 6 and [TEMP3] = 1, 1, 3)',0);
insert into macrodetail values ('TSTAT',8,10,'TSTAT MODE',NULL,'"Off"',0);
insert into macrodetail values ('TSTAT',9,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',10,16,'',NULL,'if( [TEMP4] = 6 and [TEMP3] = 3, 1, 3)',0);
insert into macrodetail values ('TSTAT',11,10,'TSTAT MODE',NULL,'"Cool"',0);
insert into macrodetail values ('TSTAT',12,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',13,27,'',NULL,'if( [TEMP4] = 6 and [TEMP3] = 9, " ", "CHK SP CHG")',0);
insert into macrodetail values ('TSTAT',14,10,'TSTAT FUNC',NULL,'"TCHG"',0);
insert into macrodetail values ('TSTAT',15,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',16,17,'',NULL,'"TEMP CHG"',0);
insert into macrodetail values ('TSTAT',17,10,'TSTAT FUNC',NULL,'" "',0);
insert into macrodetail values ('TSTAT',18,16,'',NULL,'if( [TEMP4] = 15, 1, 3)',0);
insert into macrodetail values ('TSTAT',19,10,'TSTAT TEMP',NULL,'68 + [TEMP3] - 1',0);
insert into macrodetail values ('TSTAT',20,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',21,16,'',NULL,'if( [TEMP4] = 14, 1, 2)',0);
insert into macrodetail values ('TSTAT',22,10,'TSTAT TEMP',NULL,'36 + [TEMP3] - 1',0);
insert into macrodetail values ('TSTAT',23,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',24,26,'',NULL,'"CHK SP CHG"',0);
insert into macrodetail values ('TSTAT',25,27,'',NULL,'if( [TEMP4] = 6 and [TEMP3] = 10, " ", "OUT")',0);
insert into macrodetail values ('TSTAT',26,10,'TSTAT FUNC',NULL,'"SPCHG"',0);
insert into macrodetail values ('TSTAT',27,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',28,26,'',NULL,'"SP CHG"',0);
insert into macrodetail values ('TSTAT',29,10,'TSTAT FUNC',NULL,'" "',0);
insert into macrodetail values ('TSTAT',30,16,'',NULL,'if( [TEMP4] = 15, 1, 3)',0);
insert into macrodetail values ('TSTAT',31,10,'TSTAT SP',NULL,'68 + [TEMP3] - 1',0);
insert into macrodetail values ('TSTAT',32,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',33,16,'',NULL,'if( [TEMP4] = 14, 1, 2)',0);
insert into macrodetail values ('TSTAT',34,10,'TSTAT SP',NULL,'36 + [TEMP3] - 1',0);
insert into macrodetail values ('TSTAT',35,27,'',NULL,'"OUT"',0);
insert into macrodetail values ('TSTAT',36,26,'',NULL,'"OUT"',0); |
|
|
There seems to be a problem with my Goto Label's. TSTAT FUNC is being modified when it should not.
Anyone see anything I don't?
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 19 2005 at 20:35 | IP Logged
|
|
|
OK, I found the problem. Label lines do not get quotes...
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 19 2005 at 21:56 | IP Logged
|
|
|
Heh, That is exactly what I was going to tell you . Labels themselves don't use quotes (it's not a formula so it's not evaluated so it's always a string). You'll need them in the Goto Label since it is a formula.
You should not need to define the units in order to send the preset dim commands. I had one of these very units at my old house and never defined the units. As an example, the formula below is what I would send to set the current setpoint to 72 degrees (I had set my unit to use housecode C):
ph_x10(1,"C",3,0) + ph_x10(1,"PRESET DIM",305,0)
Another possibility that I just thought of is using the ph_x10btn function. You could define a logical X10 type that supports preset dim commands (be sure and NOT check that it supports extended commands) and then you should be able to use:
ph_x10btn("C",3,100,13)
This might make your code a little easier. In order to use the ph_x10btn function though, you WOULD have to define the units (all 16 for a single housecode if memory serves).
You'll have fun with this for sure. I was going to post some of the routines that I had come up with but guess I didnt save a copy. Sending commands to the thermostat was rather easy, but getting data from if was a little tricky. It would send you a preset dim command in response to a request. What I had setup was a macro that would periodically request mode, setpoint, and current temp. I would set a global variable for the current request, send the request preset dim command, and then a trigger would fire on the incoming preset dim X-10. Based upon the value in the global, I would know what the incoming preset dim data was for.
Have fun,
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 20 2005 at 08:27 | IP Logged
|
|
|
Quote:
You should not need to define the units in order to send the preset dim commands. |
|
|
Maybe test this on the current build? It would not work until I defined all 16.
For anyone interested, that code chunk simply watches for temp and setpoint changes and updates the respective GV's. In my tstat web page, I send the setpoint change command and increment/decrement the SP GV.
This is the code for my down button:
Code:
<img src="/touch/dn.png" border="0" onclick="sk('ph_rtne( ph_x10( 1, \'M\', 4, 0) + ph_x10( 1, \'PRESET DIM\', 310, 0) + ph_setglobal_a( \'TSTAT SP\', ph_getglobal_n ( \'TSTAT SP\' ) - 1))')"> |
|
|
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 20 2005 at 10:48 | IP Logged
|
|
|
I'll try to confirm the behavior on the current beta. When you say it doesnt work, does the unit not respond and the log shows the command being sent or is there no record of the command in the log.
Also, you are using a CM11A right? It shouldnt make a difference, but I'll verify the proper controllers code.
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 20 2005 at 10:52 | IP Logged
|
|
|
No record of command in log.
Using CM11A, yes.
Thanks!
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 22 2005 at 20:47 | IP Logged
|
|
|
Updated "down" button code for "new" functions...
Code:
<img src="/touch/dn.png" border="0" onclick="sk('ph_rtne( ph_x10( 1, \'M\', 4, 0) + ph_x10( 1, \'PRESET DIM\', 310, 0) + ph_addtoglobal( \'TSTAT SP\', -1))')">
<img src="/touch/up.png" border="0" onclick="sk('ph_rtne( ph_x10( 1, \'M\', 4, 0) + ph_x10( 1, \'PRESET DIM\', 309, 0) + ph_addtoglobal( \'TSTAT SP\', 1))')"> |
|
|
|
Back to Top |
|
|
|
|