Only when trigger fired twice in a specific time?

Michael02

New member
I don't want to do something until some trigger is fired twice within a specific amount of time. For example, I want to unmute my phone only if screen unlocked is fired twice in 20 minutes. Any suggestions on how to do this?
 

Jacob L

Moderator (Lawsonator)
I don't want to do something until some trigger is fired twice within a specific amount of time. For example, I want to unmute my phone only if screen unlocked is fired twice in 20 minutes. Any suggestions on how to do this?
You could use a constraint of invoked/not invoked
 

RSF

Well-known member
@Jacob L 's suggestion is much more straightforward:
Screenshot 2022-07-28 7.42.35 AM.png

but the MacroDroid Constraint scheme may work exactly as is for this. It seems that MacroDroid will never run that macro, since it doesn't consider the macro "invoked" unless the trigger is fired and its constraint(s) are met. Same is true if the constraint is moved from the trigger down to the macro Constraints.

So, a slight tweak to put the test as an IF statement in the macro body, vs. a constraint:
Screenshot 2022-07-28 8.05.14 AM.png
Still much more compact than the timer scheme earlier...
 

Michael02

New member
@Jacob L 's suggestion is much more straightforward:
View attachment 3105

but the MacroDroid Constraint scheme may work exactly as is for this. It seems that MacroDroid will never run that macro, since it doesn't consider the macro "invoked" unless the trigger is fired and its constraint(s) are met. Same is true if the constraint is moved from the trigger down to the macro Constraints.

So, a slight tweak to put the test as an IF statement in the macro body, vs. a constraint:
View attachment 3106
Still much more compact than the timer scheme earlier...
You're really smart! Thanks for both suggestions!
 
Top