| Author |  | 
      
        | fasttimes Groupie
 
  
 
 Joined: March 12 2006
 Online Status: Offline
 Posts: 63
 | 
          I managed to get my buttons on CC to change color according to state, yet when I use the web page version of CC I have to hit the refresh button in order to see the color change on the web page.
           | Posted: April 26 2006 at 03:11 | IP Logged |   |  
           | 
 |  
 
 I even added a ph_wcrefresh() at the end of my formula, but that didnt work.
 
 Any suggestions on how to make the postback reflect the current state?
 
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          The only way for the web based Control Center to see the button changes is for it to refresh.  You can do this by setting the "type" parameter.
           | Posted: April 26 2006 at 23:19 | IP Logged |   |  
           | 
 |  
 The default "type=1" tells PowerHome to serve the Control Center in a frame and redirect requests to the hidden frame.  A "type=2" redirects requests to a pop-under window.  What you want to use is "type=3" which tells PowerHome to redirect requests to the main browser window.  This will cause a "refresh" and you should see the color changes.
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | fasttimes Groupie
 
  
 
 Joined: March 12 2006
 Online Status: Offline
 Posts: 63
 | 
          Dave,
           | Posted: May 01 2006 at 21:36 | IP Logged |   |  
           | 
 |  
 
 How do I do this?  From which page?
 
 Thanks,
 
 -M
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          The CC page link itself.
           | Posted: May 01 2006 at 22:49 | IP Logged |   |  
           | 
 |  
 I think this applies still.
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          I am trying to have the buttons (which change color and text) on my remote display (webserver):
           | Posted: June 16 2006 at 22:42 | IP Logged |   |  
           | 
 |  
 1) refresh to always show the current state.
 2) stay synchronous with the server computer.
 
 I have read this link (and embedded link), and have my
 Setup:Web: Control Center URL set to " /ph-cgi/controlcenter?TYPE=3".
 
 This helps with SOME of the button refreshes, but NOT every time (it is not random, I can duplicate this).
 
 What other things should I do to make both the remote and server system stay 100% current and 100% synchronous?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          OK, I have figured #1 out.
           | Posted: June 16 2006 at 23:01 | IP Logged |   |  
           | 
 |  
 For the remote computers buttons to stay updated, the Formula in the button macro has to be set to Immediate, NOT Post.
 
 Any ideas on #2?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Smarty,
           | Posted: June 19 2006 at 16:22 | IP Logged |   |  
           | 
 |  
 #2 will not be directly possible.  This is because the PowerHome client cannot tell a remote web browser that a change has occurred because the HTTP protocol is stateless.  What this means is that when the browser connects to the PowerHome webserver and requests a page (the control center for instance) the webserver gathers the data, formats it, sends it back to the browser, and closes the connection.  No permanent link exists between the too.  This is standard HTTP protocol.  After the CC has been sent to the browser, a change may occur within PowerHome that changes the CC appearance.  The remote browser will have no way of knowing this unless it again requests the Control Center page.
 
 There are two ways to try to overcome this.  The first would be to have some client side scripting that refreshes the browser Control Center every so often.  This is usually not a very good idea because it can create a lot of network traffic if no changes have taken place.
 
 The second way would be to create some kind of JAVA applet (or activex control) that keeps a persistent connection to the server so that the remote client can be notified.  This would be a cleaner solution, but not something that I would be able to work on for awhile.
 
 One thing that is currently planned is a remote Control Center client.  This would be a program (instead of a web browser) that would run on a remote machine that would connect to the PowerHome server and maintain a persistent connection and thus keep the CC synchronized between client and server.
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | onhiatus Senior Member
 
  
  
 Joined: May 12 2004
 Location: United States
 Online Status: Offline
 Posts: 279
 | 
          I solved this somewhat by loading a small "data" psp page that refreshes itself every five seconds. Scripting in my web page then uses the data to update the main page. The first element in the data page is a version, so the script bails out if there's been no change.
           | Posted: June 19 2006 at 18:13 | IP Logged |   |  
           | 
 |  
 This does result in some unnecesary network traffic, but the page is relatively small.
 
 My remote page lags a little, but generally only about 5-10 seconds.
 
 Note this also gets rid of having your web page reload every x seconds - there's no rerendering because the main page only loads the first time.
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | smarty Super User
 
  
  
 Joined: May 21 2006
 Location: United States
 Online Status: Offline
 Posts: 729
 | 
          Onhiatus,
           | Posted: July 14 2006 at 22:04 | IP Logged |   |  
           | 
 |  
 Any chance you could post the contents of that "data" PSP page you mentioned?  I am trying to learn as much as I can about PSP "active content" and how to maximize the usefulness of PH while using a remote display.
 
 __________________
 Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          I am also interested in this technique!
           | Posted: July 22 2006 at 11:43 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  |