Author |
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 09 2009 at 07:15 | IP Logged
|
|
|
Good morning all...
In my quest to waste time and learn, I have a question about formulas. Is it possible to stack commands (ph_ commands) from within a formulas, macro, trigger, and so on. I have buttons in my CC that reflect the status of a device. To do this I had to write 2 triggers based on the same action. One changes the button image and the other changes the button text. The triggers are based on the same condidtion so why couldn't I have one trigger that says:
[IF CONDITION]([STATUS OF DEVICE],[PH_STATEMENT 1 TRUE]&[PH_STATEMENT2 TRUE],[PH_STATEMENT 1 FALSE]&[PH_STATEMENT2 FALSE])
(I hope that makes sense to someone)
I know in other languages you can do something like that but can you in PH2?
__________________ 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 09 2009 at 07:32 | IP Logged
|
|
|
Sure!
if( boolean, truevalue, falsevalue )
Check the Help for more on if().
|
Back to Top |
|
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 09 2009 at 07:47 | IP Logged
|
|
|
Thanks Tony but that part I knew... I want to know how to call multiple ph_commands from within the truevalue and falsevalue portions of the statement...
if( boolean, ph_command_1 ph_command_2 ph_command_3 , ph_command_1 ph_command_2 ph_command_3 )
__________________ 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 09 2009 at 08:18 | IP Logged
|
|
|
You can issued multiple commands. ph_xxx + ph_xxx + ph_yyy.
__________________ Lee G
|
Back to Top |
|
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 09 2009 at 08:23 | IP Logged
|
|
|
grif091 wrote:
You can issued multiple commands. ph_xxx + ph_xxx + ph_yyy. |
|
|
ah ok... I tried , ; & but dummy me never tried +. Thanks, I'll try it when I get home... Thanks
__________________ 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 09 2009 at 08:35 | IP Logged
|
|
|
Sometimes, particularly when stacking commands imbedded in other commands, I have found it necessary to bracket the stack with () (ph_xxx + ph_yyy) as some combinations seem to give the parser more problems than others. No hard and fast rule that I know of. Just a technique I found necessary at times when an otherwise valid looking sequence keeps coming up with a "!" result.
__________________ Lee G
|
Back to Top |
|
|
k2zs Senior Member
Joined: October 22 2009 Location: United States
Online Status: Offline Posts: 113
|
Posted: December 09 2009 at 16:38 | IP Logged
|
|
|
Thanks Lee
__________________ 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 11 2009 at 20:59 | IP Logged
|
|
|
Wow, Thanks Lee... now I got it. One trigger for each button; no hands... lol
case(ph_getinsteonstat ("DINING_RM_TABLE") when 2 then (ph_setccobjtext("HOME","ST1N_1","On") + ph_setccobjgraphic("HOME","GB1N_1","C:\Program Files\powerhome\web\graphics\buttons\b10green_50.gif","C:\Pr ogram Files\powerhome\web\graphics\buttons\b10gray_50.gif")) else (ph_setccobjtext("HOME","ST1N_1","Off") + ph_setccobjgraphic("HOME","GB1N_1","C:\Program Files\powerhome\web\graphics\buttons\b10gray_50.gif","C:\Pro gram Files\powerhome\web\graphics\buttons\b10gray_50.gif")))
Edited by k2zs - December 11 2009 at 21:00
__________________ Scott, K2ZS
Home Automation Ideas
|
Back to Top |
|
|