| Author | 
         | 
         
      
        
         
         raven77 Groupie 
          
  
  Joined: January 02 2007 Location: United States
 Online Status: Offline Posts: 44
          | 
        
         
          
           | Posted: February 04 2009 at 21:01 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I am trying to figure out a way to get my new remote to control lights via Powerhome.  Its a Philips TSU9400.  I know I can use the Insteon IR unit, but I was hoping to do it over wifi(it does RF using 802.11g).  The remote can get info from the web and does have a 2-way interface but it does not have a web browser (no HTML).  I can get weather to display and update on the screen via javascript code I got on their website but I am not much of a programmer.  Other people are using socket connections to control different lighting systems but I saw no mention of Powerhome anywhere.
 Here is the code for getting the weather if that helps...
 
 var pgCurrent = page("PSP_CURRENT");
 var pgForecast = page("PSP_FORECAST");
 var pgParameters = page("PSP_PARAMETERS");
 
 var partnerID = pgParameters.widget("PSL_PARTNERID").label;
 var licenseKey = pgParameters.widget("PSL_LICENSEKEY").label;
 var localZip = pgParameters.widget("PSL_ZIPCODE").label;
 
 System.setGlobal("PSG_WEATHERCOM_DATA","");
 var xmlData = "";
 var inXML = false;
 
 var socket = new TCPSocket(false);
 socket.onConnect = function() {
   socket.write( "GET /weather/local/" + localZip + "?cc=*&dayf=5&link=xoap&prod=xoap&par=" + partnerID + "&key=" + licenseKey + " HTTP/1.0\r\n");
   socket.write("HOST:xoap.weather.com \r\n");
   socket.write("\r\n");
   socket.write("\r\n");
 };
 socket.onData = function() {
   xmlData += socket.read();
 };
 socket.onClose = function() {
   var xmlStartIndex = xmlData.indexOf("<weather");
   weather = xmlData.substring(xmlStartIndex);
   System.setGlobal("PSG_WEATHERCOM_DATA",weather);
   widget("PSB_LOADED", "PSP_LOADING").executeActions();
 };
 socket.connect("xoap.weather.com", 80, 3000);
 
 Any else using a Philips remote or have any idea's?
 Thanks for any input!!!
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         raven77m Newbie 
          
 
  Joined: December 31 2006
 Online Status: Offline Posts: 24
          | 
        
         
          
           | Posted: February 12 2009 at 16:17 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Nodody?
    
 I got a little further. I have the following "script" tied to a button and according to the philips forums it SHOULD work, but it don't!
 
 var socket = new TCPSocket(true);
 socket.connect('192.168.1.2', 88, 3000);
 socket.write("GET /ph-cgi/evalformula?formula=ph_insteon('LROOMLIGHTS', ion, int(255)) HTTP/1.0\r\n\r\n");
 socket.close();
 
 It works when I enter it in a browser.  I hope someone has an idea, this is getting frustrating!
 Thanks for any advice!
 
 Maybe this will help, When I push my button I get this in the event log...
 
 From: 192.168.1.5
 GET /ph-cgi/evalformula?formula=ph_insteon('LROOMLIGHTS', ion, int(255)); HTTP/1.0
 
 
 
 Edit:  WOW I just realized I am logged in under a different name, I wonder how I did that!
 
  Edited by raven77m - February 12 2009 at 18:00
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         JaredM Newbie 
          
 
  Joined: November 04 2007
 Online Status: Offline Posts: 36
          | 
        
         
          
           | Posted: February 12 2009 at 23:15 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
My guess is the spaces in the url need to be encoded. Try replacing each space with %20. Or, in this specific instance it's safe to remove the spaces entirely.
 
 The = might need encoding as well. It's %3D. I think the parens and single quote are fine.
 
 It works when you enter it in your browser b/c under the covers it's url-encoding for you.
 
 
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         raven77 Groupie 
          
  
  Joined: January 02 2007 Location: United States
 Online Status: Offline Posts: 44
          | 
        
         
          
           | Posted: February 13 2009 at 11:07 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
 
JaredM wrote: 
   
    
    
      
       My guess is the spaces in the url need to be encoded. Try replacing each space with %20. Or, in this specific instance it's safe to remove the spaces entirely.
 
 The = might need encoding as well. It's %3D. I think the parens and single quote are fine.
 
 It works when you enter it in your browser b/c under the covers it's url-encoding for you.
 
  | 
       
       | 
    
    | 
 
  
 Still no luck!  I am so close, but I just can't get it!
 Thanks for the advice though, I am willing to try anything at this point!
    
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |