| Author |  | 
      
        | jeffw_00 Super User
 
  
 
 Joined: June 30 2007
 Online Status: Offline
 Posts: 935
 | 
          So I have a formula...
           | Posted: January 31 2010 at 18:47 | IP Logged |   |  
           | 
 |  
 ph_setvar_a(1,9,ph_getinsteonlevelrt("BATHROOM1LIGHT"))
 
 the function fetches the level from the device.
 
 I test [LOCAL9] in the next line, so I know that this formula works (i.e., it gets the correct status, whether the light is on (255) or off (0))
 
 But when I execute this command, I see no activity in the PH Event log, even though i have -all- checkboxes checked in Setup->Logs.
 
 ???
 
 thanks
 /j
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | BeachBum Super User
 
  
  
 Joined: April 11 2007
 Location: United States
 Online Status: Offline
 Posts: 1880
 | 
          I think that’s normal as I send these all the time and don’t see them either but I know the command is working.
           | Posted: January 31 2010 at 23:44 | IP Logged |   |  
           | 
 |  
 __________________
 Pete - X10 Oldie
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jeffw_00 Super User
 
  
 
 Joined: June 30 2007
 Online Status: Offline
 Posts: 935
 | 
          It would be nice, then, if there -was- a way to log them...
           | Posted: February 01 2010 at 09:32 | IP Logged |   |  
           | 
 |  Right now I'm using one as a PLM 'health check'
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | BeachBum Super User
 
  
  
 Joined: April 11 2007
 Location: United States
 Online Status: Offline
 Posts: 1880
 | 
          I tried the “health check” thing but when I had a failure due to lost communications, PH then froze in an endless loop of error recovery. The end result was I never got control to intervene. Would be interesting if your method works.
           | Posted: February 01 2010 at 10:00 | IP Logged |   |  
           | 
 |  
 __________________
 Pete - X10 Oldie
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jeffw_00 Super User
 
  
 
 Joined: June 30 2007
 Online Status: Offline
 Posts: 935
 | 
          SO the problem I have is the the PLM hangs up, and then next time PH tries to access it, PH hangs up.
           | Posted: February 01 2010 at 10:33 | IP Logged |   |  
           | 
 |  
 Every 15 minutes, PH runs ph_getinsteonlevelrt and then writes a timestamp to a text file.
 
 I have a perl script running on the machine that checks the text file every 15 minutes for the timestamp (it's actually a little more sophisticated to avoid boundary conditions).
 If PH misses a timestamp, the perl script reboots the PC.
 
 It -appears- that when the machine reboots, PH successfully 'catches up' from wherever it hung.
 
 This has worked very well for me as I have tried different unsuccessful attempts at getting my PLM to work reliably.  I'm going to order a serial one today
 
 /j
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | BeachBum Super User
 
  
  
 Joined: April 11 2007
 Location: United States
 Online Status: Offline
 Posts: 1880
 | 
          Now that is cool. But I’m trying to find a way to trigger a macro that would be on top of the execution queue and ReInit PH from within itself. I have also found this problem to correct itself by waiting but the execution queue stacks way up.
           | Posted: February 01 2010 at 10:40 | IP Logged |   |  
           | 
 |  
 __________________
 Pete - X10 Oldie
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          I checked the code and indeed, Insteon status requests originating from PowerHome are not logged.  In addition to status request (cmd1 = 25), the peek and poke commands (40 thru 45) are also not logged.  I originally did this so that standard PowerHome processing (the continuous polling and database peek/poke) would not overrun the log since PowerHome does so much of this during its normal operations.  I can see though that it would be nice to log these commands if they originate from the user rather than from PH background processing.  I'll look into and see if I can differentiate easy enough.
           | Posted: February 01 2010 at 14:31 | IP Logged |   |  
           | 
 |  
 Concerning getting a command to the top of the execution queue ahead of other commands...this can be done fairly easily.  The Boolean field of a trigger is executed ahead of the execution queue.  All you need to do is put your ph_macro or ph_reinit command in the boolean field of a trigger.  A handy trigger to use is a Windows Message trigger.  Its then relatively simple for an external program to send an appropriate windows message to PowerHome that will fire the trigger, execute the boolean field, and get the boolean field ahead of anything that may be in the execution queue.
 
 Also, Ive been working on new code in PowerHome so that when a logoff or shutdown is being processed, PowerHome will exit cleanly and not prevent the logoff or shutdown.  This should make reboots without using the shutdown -f parameter alot easier.
 
 Dave.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | BeachBum Super User
 
  
  
 Joined: April 11 2007
 Location: United States
 Online Status: Offline
 Posts: 1880
 | 
          Again, thanks Dave…
           | Posted: February 01 2010 at 14:52 | IP Logged |   |  
           | 
 |    
 __________________
 Pete - X10 Oldie
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jeffw_00 Super User
 
  
 
 Joined: June 30 2007
 Online Status: Offline
 Posts: 935
 | 
          It sounds like dave is saying that the boolean field is directly executed before a trigger is put in the execution queue - Is there some way to do that with macros?
           | Posted: February 01 2010 at 15:35 | IP Logged |   |  
           | 
 |  
 How does one generate a "windows message" trigger from an external program (is that the 'helper' program (i forget the name) I use to execute commands from a Dos box (well, actually an Icon calling a .BAT script).
 
 Finally - I would welcome clean shutdown from PH.  Right now I have an icon that calls "process.exe" which explicitly kills PH by name.  it's dirty, but it's better than -f.
 
 thanks!
 /j
 | 
       
        | Back to Top |     | 
       
       
        |  |