Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Reset a macro wait timer? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
lizaoreo
Groupie
Groupie


Joined: February 11 2013
Location: United States
Online Status: Offline
Posts: 75
Posted: August 26 2013 at 14:23 | IP Logged Quote lizaoreo

Okay, I got my camera set up on the back porch and triggers for motion configured in Blue Iris. I made a macro in PH to turn the back porch light on for 10 minutes (IE, someone pulled up or opened the door) and setup Blue Iris to run the macro when it detects motion. After 10 minutes, it turns off the light.

The problem I discovered this week (like 2 days after I set it up) is that when someone is unloading the car or just doing something outside that takes longer than 10 minutes, they trigger the macro (Yay), but they trigger it several times, so then the light comes on, then starts turning off randomly as the 10 minute timers run out.

Is there a way I can do a smart timer so that every time the macro triggers after the initial time it just resets the timer rather than making new ones?
Back to Top View lizaoreo's Profile Search for other posts by lizaoreo
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: August 26 2013 at 15:28 | IP Logged Quote dhoward

The way I handle this is to usually do a Jump or Goto Label as the first line of a macro. Something like:

Code:

10 Goto Label if(ph_ismacrowaiting("YOURMACROID") = 0,"CONTINUE","")
20 Formula Immediate ph_extendmacrowait("YOURMACROID",10 * 60,0)
30 End Macro
40 Label CONTINUE
50 ...


The above was from memory so may need to be checked for accuracy.

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
lizaoreo
Groupie
Groupie


Joined: February 11 2013
Location: United States
Online Status: Offline
Posts: 75
Posted: August 26 2013 at 15:34 | IP Logged Quote lizaoreo

Aha, there are more formulas for macro commands, that was kind of my first path of thought, but I couldn't find the right formula commands.

Thanks Dave
Back to Top View lizaoreo's Profile Search for other posts by lizaoreo
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum