Local variable with unwanted value at macro abort problem

Cimba

New member
Hello,

I want to make sure that when a macro is triggered, it can't be re-executed for at least 5 minutes.

I have therefore taken a local variable as "interlock":

Trigger: radio cell reached

action:
lv lock = true
Display notification
wait 5 minutes
lv lock = false

Condition:
lv lock = false

The problem: it has already happened, that the macro was aborted during the waiting time (e.g. restarting the smartphone) and then the variable lock remains on "true" and the macro is never executed again.

I did not find an option to reset the local variables when restarting the smartphone.

Any ideas to solve this?

Greetigns,
Cimba
 

JA-Translator

Moderator
Any variable will never get reset automatically even when you reboot the device.

You need to add an Action "reset variable" by yourself.

As you mentioned (condition: lv lock = false), your variable still remains as true, so the macro will never be triggered.

It's better to remove the condition.
Instead, add "this macro is never triggered within 5 minutes" in the condition.

Screenshot_20230309_192841.png

or
Add a condition under the trigger.

Screenshot_20230309-193149_MacroDroid.png
 

Dm114

Well-known member
Hello,

I want to make sure that when a macro is triggered, it can't be re-executed for at least 5 minutes.

I have therefore taken a local variable as "interlock":

Trigger: radio cell reached

action:
lv lock = true
Display notification
wait 5 minutes
lv lock = false

Condition:
lv lock = false

The problem: it has already happened, that the macro was aborted during the waiting time (e.g. restarting the smartphone) and then the variable lock remains on "true" and the macro is never executed again.

I did not find an option to reset the local variables when restarting the smartphone.

Any ideas to solve this?

Greetigns,
Cimba
You could use the constraint (either global or at the trigger level) "Macro(s) invoked/Not invoked"
 

Dm114

Well-known member
Any variable will never get reset automatically even when you reboot the device.

You need to add an Action "reset variable" by yourself.

As you mentioned (condition: lv lock = false), your variable still remains as true, so the macro will never be triggered.

It's better to remove the condition.
Instead, add "this macro is never triggered within 5 minutes" in the condition.

View attachment 4795
We replied at the same time 😀
 
Top