Author |
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 05 2009 at 11:15 | IP Logged
|
|
|
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 |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: December 05 2009 at 17:34 | IP Logged
|
|
|
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 |
|
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 05 2009 at 17:50 | IP Logged
|
|
|
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 |
|
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 05 2009 at 17:53 | IP Logged
|
|
|
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 |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: December 05 2009 at 18:34 | IP Logged
|
|
|
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 |
|
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 05 2009 at 18:45 | IP Logged
|
|
|
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 |
|
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 07 2009 at 08:08 | IP Logged
|
|
|
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 |
|
|
markr Newbie
Joined: December 29 2009 Location: United States
Online Status: Offline Posts: 4
|
Posted: December 29 2009 at 12:22 | IP Logged
|
|
|
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 |
|
|