Author |
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: August 07 2007 at 16:22 | IP Logged
|
|
|
Any thoughts why I can’t get this to work??
IF (PH_GETINSTEONLEVELRT("KITCHEN") = PH_GETGLOBAL_S("LEVEL_KITCHEN"), 1, 2)
LEVEL_KITCHEN is = to o (zero). KITCHEN is an Insteon device which is in the off state. If I break it apart the separate commands run fine as a formula and both return 0.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: August 07 2007 at 17:40 | IP Logged
|
|
|
Beachbum,
ph_getinsteonlevelrt() returns a double (numeric) value and you're comparing that to ph_getglobal_s which returns a string. Change it to ph_getglobal_n and it should work.
HTH,
Dave.
|
Back to Top |
|
|
jbbtex Senior Member
Joined: February 15 2007 Location: United States
Online Status: Offline Posts: 181
|
Posted: August 07 2007 at 17:57 | IP Logged
|
|
|
If LEVEL_KITCHEN is a global variable this should work:
if(ph_getinsteonlevelrt("KITCHEN")={LEVEL_KITCHEN},1,2)
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: August 08 2007 at 08:44 | IP Logged
|
|
|
Dave, jbbtex..
Thks, I thought it might be a mix of values that was the problem. Both methods worked fine.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|