Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Formula Help Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: August 07 2007 at 16:22 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: August 07 2007 at 17:40 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: August 07 2007 at 17:57 | IP Logged Quote jbbtex

If LEVEL_KITCHEN is a global variable this should work:

if(ph_getinsteonlevelrt("KITCHEN")={LEVEL_KITCHEN},1,2)
Back to Top View jbbtex's Profile Search for other posts by jbbtex
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: August 08 2007 at 08:44 | IP Logged Quote BeachBum

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 View BeachBum's Profile Search for other posts by BeachBum
 

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