| Author |  | 
      
        | Dean Senior Member
 
  
  
 Joined: August 21 2003
 Location: United States
 Online Status: Offline
 Posts: 109
 | 
          When using the ph_extendmacrowait command, is this an additive function, meaning if the macro is already in a wait state, whatever time is passed in the extendmacrowait command is added to that time?  Or, if a macro is waiting whatever value is passed in the extendmacrowait command becomes the new wait time?
           | Posted: January 05 2005 at 21:25 | IP Logged |   |  
           | 
 |  
 For example, a motion sensor triggers a macro to turn on a light.  The macro turns on the light, waits for 180 seconds and then turns the light off.  If the motion sensor triggers again within that 180 seconds, a check is made to see if the macro is waiting.  In this example, it is waiting, so does the time in the extendmacrowait command (say 180 seconds) get added to the currently waiting time (which could push the wait time past the initial 180 seconds) or does it become the new wait time?
 
 Thanks,
 
 -Dean
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          From the docs...
           | Posted: January 05 2005 at 22:10 | IP Logged |   |  
           | 
 |  
 ph_extendmacrowait PowerHome formula function
 
 Description
 Extends the amount of wait time for a macro which is currently in a wait state.
 
 Syntax
 ph_extendmacrowait ( s, n, n )
 
 Argument Description
 s  String representing the ID of the waiting macro.
 n  Double representing the number of seconds to extend the wait. Fractions of a second can be represented in decimal format.
 n  Integer representing the method of extending the wait.
 
 A 0 will extend the macros wait time from the time this function is executed. Any other value will extend the wait from the time the macro is currently set to expire.
 
 
 I would take that as a 0 will make it expire n seconds after this executes.
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          I just ran a test to check, and my take was correct.
           | Posted: January 05 2005 at 22:18 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  |