Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: How do you reference variables? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: December 05 2009 at 11:15 | IP Logged Quote k2zs

I would like to change a graffic in CC based on device status. I was going to use a device stauts change trigger to switch the CC graffic on. I have had issues understanding how functions are written. I did figure out how to create a "Toggle" global text box but can't figure out how to form this statement:

ph_setccobjgraphic ("5TEST","OBJ_1","C:\Program Files\powerhome\web\graphics\buttons\b5red_260.gif","C:\Prog ram Files\powerhome\web\graphics\buttons\b5red_260.gif",1)

Any help would be great....

Thanks

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: December 05 2009 at 17:34 | IP Logged Quote TonyNo

That statement is for changing the up/down state images.

If it's a graphic, this should work...

ph_setccobjgraphic("5TEST","OBJ_1","path\new image"," ", 0)

Where "path\new image" is what you want to change it to. Note the space in the second image file position.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: December 05 2009 at 17:50 | IP Logged Quote k2zs

Here is what I get:

Syntax Error in Formula: ph_setccobjgraphic(~"5TEST~",~"OBJ_1~",~"C:\Program Files\powerhome\web\graphics\buttons\b5red_260.gif~",~" ~",0)

Pretty much what I started with, pasted in your code and added the file info.

Edited by k2zs - December 05 2009 at 17:51


__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: December 05 2009 at 17:53 | IP Logged Quote k2zs

k2zs wrote:
Here is what I get:

Syntax Error in Formula: ph_setccobjgraphic(~"5TEST~",~"OBJ_1~",~"C:\Program Files\powerhome\web\graphics\buttons\b5red_260.gif~",~" ~",0)

Pretty much what I started with, pasted in your code and added the file info.


Whit the ~ preceding every " I would think it's an error in how I am refering to the string.

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: December 05 2009 at 18:34 | IP Logged Quote grif091

It is not the ~" indicating a syntax problem. The ~ has to do with getting the quote into the message text, see the example below. The syntax error is the 0x19 value, not the quotes around the string. This does not solve your problem, just don't focus on the quotes.

Syntax Error in Formula: ph_insteongroup(~"G2X4OUTPUT1PLM~",0x19,0)

__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: December 05 2009 at 18:45 | IP Logged Quote k2zs

That was it! I dropped the 0 and made it :

ph_setccobjgraphic("5TEST","OBJ_1","C:\Program Files\powerhome\web\graphics\buttons\b5red_260.gif"," ",)

and it worked, Thanks... you guys are great! I develop web apps with PHP and ColdFusion. I know what I want to do I just have to learn the ins and outs of PH.

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: December 07 2009 at 08:08 | IP Logged Quote k2zs

Thanks to all for your help. I was able to create a single button CC page where buttons and text change based on status. Button commands also toggle based on status. Now I need to figure out how to push that to the web center pages so you don't need to do a refresh to see the changes.



__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
markr
Newbie
Newbie


Joined: December 29 2009
Location: United States
Online Status: Offline
Posts: 4
Posted: December 29 2009 at 12:22 | IP Logged Quote markr

I started playing with the trial version of Powerhome two days ago. Trying to setup a control center with buttons that changed depending on the status of the lamps seemed like any easy place to start learning, but I'm having some problems. As you have gotten it working would you explain a few things?
1)Are you using a trigger to call a macro that changes the button, or is there some other way to see the lamp status change?
2)If the LampLinc status changes due to commands from another controller besides the control center, will the button in CC still be updated?
3)Are there any programming reference guides or manuals that explain the concepts involved?

THanks for any help.
Back to Top View markr's Profile Search for other posts by markr
 

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