| Author | 
         | 
         
      
        
         
         GadgetGuy Super User 
          
  
  Joined: June 01 2008 Location: United States
 Online Status: Offline Posts: 942
          | 
        
         
          
           | Posted: December 16 2008 at 09:09 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I utilized the new Wizard to set up my Control Center 
 buttons and then tuned the results to better fit my 
 needs.
 
 The one thing I would like, but couldn't discover a 
 means to create was to have some of the critical on/off 
 buttons actually reflect the state of the controlled 
 device.
 
 That is if a device is "on" is it possible to reflect 
 that in the button appearance by appropriate entries in 
 the CtrlPanel configuration table?
  __________________ Ken B - Live every day like it's your last.  Eventually, you'll get it right!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         TonyNo Moderator Group 
          
  
  Joined: December 05 2001 Location: United States
 Online Status: Offline Posts: 2889
          | 
        
         
          
           | Posted: December 16 2008 at 13:29 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Not automatically as of now. You could set up some triggers to update CC objects.
         | 
       
       
        | Back to Top | 
         
          
          
         | 
       
       
       
        |   | 
      
        
         
         GadgetGuy Super User 
          
  
  Joined: June 01 2008 Location: United States
 Online Status: Offline Posts: 942
          | 
        
         
          
           | Posted: December 16 2008 at 15:43 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Humm!  Interesting and doable idea.  Thanks for your (as 
 always) awesome insight!   
  __________________ Ken B - Live every day like it's your last.  Eventually, you'll get it right!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         nadler Super User 
          
 
  Joined: February 25 2006 Location: United States
 Online Status: Offline Posts: 354
          | 
        
         
          
           | Posted: December 18 2008 at 22:04 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
As in everything PH you can do this in a number of 
 different ways and probably everyone on this board does 
 what you would like to do, but each person does it 
 differently.
 
 You could keep the status of each device in a global 
 variable.  PH2 and above added the action global 
 variable, static global variable and global variable 
 button types.  You would create a box on a CC screen of 
 one of those global variable types and point it to a 
 particular global variable from the drop down menu.  
 Every time the global variable changes the CC screen 
 automatically changes the contents of that box.  I use 
 it to let me know if my speakers are on or off in each 
 room.  I place and On or Off in the global variable for 
 that particular set of speakers and then their status is 
 reflected as either On or Off in the box.  The advantage 
 to a global variable box or button is that you can use 
 the same box or button on multiple CC screens and point 
 them to the same global variable and all the screens 
 change at same time the global variable changes.
 
 If you want to change the color of the box or button to 
 reflect the on or off status you can make an action text 
 box or button and use a raw formula for each button.  In 
 the example below I use one button to toggle an Insteon 
 light on or off depending on its present state.  If it 
 is on the button turns green.  If it is off the button 
 turns yellow.  The disadvantage here is that the formula 
 for each button for each different device is different 
 and while it accurately reflects the status of the 
 insteon device when pressed, if the light switch is 
 pressed the screen doesn't change and the screen is no 
 longer accurate.  For that you couple this approach with 
 a trigger for the PLM which fires a macro which changes 
 the status of all buttons on all screens.  Depending on 
 the number of insteon devices you and how many CC 
 screens you have, that macro gets very long   
 
 Here is the raw formula to toggle an insteon light's 
 status and to change the color of the button or box 
 controlling that light:
 The name of the light is MASTERBEDROOM.
 The name of the button on the CC Tab is W1
 
Code: 
   
    
    
      
       if (ph_getinsteonstat( 
 "MASTERBEDROOM")=1,ph_insteon("MASTERBEDROOM",18,0)+ 
 ph_setccobjbcolor("CC_TAB_NAME","W1",65280),ph_insteon("
 MASTERBEDROOM",20,0)+ph_setccobjbcolor("CC_TAB_NAME","W1
 ",65535))+ ph_wcrefresh()
  | 
       
       | 
    
    | 
 
 
 
 When the button is pressed if the MASTERBEDROOM light is 
 on it turns it off and paints the box yellow.  If the 
 MASTERBEDROOM light is off the button press turns it on 
 and paints the box green.
 
 I use the ph_wcrefresh() command to refresh this 
 particular CC screen because I use it on my iTouch and 
 it refreshes the current page in the Web center thus 
 accurately reflecting the color of the button.
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         GadgetGuy Super User 
          
  
  Joined: June 01 2008 Location: United States
 Online Status: Offline Posts: 942
          | 
        
         
          
           | Posted: December 18 2008 at 22:48 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
nadler - very nice response and good tutorial!
 
 It sure helps when there is an example (now if we could 
 just convince Dave and the Manual writers how useful 
 even a single actual example is vs a generic function 
 description. . . if nothing else it helps show where 
 quotes are needed, or not!).
 
 I leave for Mexico tomorrow, but look forward to 
 utilizing your clear and thoughtful response as soon as 
 I return.
 
 As they say in Spain, "Cool Beans!"    
  __________________ Ken B - Live every day like it's your last.  Eventually, you'll get it right!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |