Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: ph_setccobjbcolor and conditions Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
veropierre
Groupie
Groupie
Avatar

Joined: May 06 2009
Location: United States
Online Status: Offline
Posts: 47
Posted: June 06 2009 at 09:51 | IP Logged Quote veropierre

I'm trying to have color coded temperature display like red when the temperature is over 80, white when it's 40 below.

I created a trigger when the global variable changes with the following raw formula:

ph_setccobjbcolor("WEATHER","TEMP",if({CURTEMP} >70 then rgb(0,0,255), rgb(0,255,0)))

But I get an error...

any idea what wrong and if I can even use if and a global variable in a trigger? I can always use a macro but I'm lazy today...

Edit: wrote the macro and it looks very cool but if I can an answer for the trigger, it would be great.

Thank you

Edited by veropierre - June 06 2009 at 10:12


__________________
37 Insteon Switches + 14 Lamp Modules + 7 ControLinc + 2 RemoteLinc + 3 Insteon Thermostats + 8 Zones Sprinklers + several X10 + Power Home 2.1.4 = Happy Camper
Back to Top View veropierre's Profile Search for other posts by veropierre Visit veropierre's Homepage
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: June 06 2009 at 10:12 | IP Logged Quote grif091

There is no "then" in an if statement

if({CURTEMP} >70 then rgb(0,0,255), rgb(0,255,0))

if({CURTEMP} >70 , rgb(0,0,255), rgb(0,255,0))

EDIT: I wrote a Global Variable trigger that uses an if to check the value of CURTEMP. Works fine.

Edited by grif091 - June 06 2009 at 10:59


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
veropierre
Groupie
Groupie
Avatar

Joined: May 06 2009
Location: United States
Online Status: Offline
Posts: 47
Posted: June 06 2009 at 14:49 | IP Logged Quote veropierre

DUH... thanks grif091... that's the problem when you're too lazy and try to recycle formulas...

__________________
37 Insteon Switches + 14 Lamp Modules + 7 ControLinc + 2 RemoteLinc + 3 Insteon Thermostats + 8 Zones Sprinklers + several X10 + Power Home 2.1.4 = Happy Camper
Back to Top View veropierre's Profile Search for other posts by veropierre Visit veropierre'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