Triggers mixed up

aus-wanderer

New member
Hi, I have this macro but I don't understand why it doesn't work.

Either it runs the action part never or twice depending on the positions of the triggers. I suspect it's a bug but if not can someone explain why?
 

Attachments

  • battery_trigger.png
    battery_trigger.png
    79.8 KB · Views: 14
  • battery_trigger.macro
    2 KB · Views: 5

Dm114

Well-known member
Hi, I have this macro but I don't understand why it doesn't work.

Either it runs the action part never or twice depending on the positions of the triggers. I suspect it's a bug but if not can someone explain why?
The inconvenience with the thresholds (<=20%) is that such triggers only fire once when decreasing for the 1st time lower than 21%, i.e from 21% to 20% but not from 20% to 19%, and so on...

It probably would be more interesting for you to keep the 2nd trigger and manage the critical levels inside the macro:
A: current_level={battery_int}
A: IF current_level<previous_level AND current_level<21
A: Speak Text
A: END IF
A: previous_level=current_level
 

aus-wanderer

New member
The inconvenience with the thresholds (<=20%) is that such triggers only fire once when decreasing for the 1st time lower than 21%, i.e from 21% to 20% but not from 20% to 19%, and so on...
I don't have problems with consistent firing triggers repeatedly. The problem is that this macro as it is NEVER runs the if clause even it should.

If I just swap the two triggers the if clause runs ALWAYS twice when it should run only once.

When I delete or disable the unused trigger only then the if clause runs ALWAYS exactly once, as it should.

That's what I don't understand. I still think it's a bug where the two triggers get somehow merged.

An unused trigger no matter where placed shouldn't destroy or clone another trigger.
 

mapriex

Active member
you might created a double activation in a short time.

does this help?
 

Attachments

  • Screenshot_20240204-235327.png
    Screenshot_20240204-235327.png
    168.3 KB · Views: 9

Dm114

Well-known member
No it's really a bug I just tested and I get the problem too.
Amazing... Which one of the triggers would be faulty? To me "Battery level - Any change" works fine.

According to "Battery level<=20%", as I explained previously, it only fires once when level decreases from 21% to 20% if the macro is ready to run at this exact time. So it could not fire for some reasons. But if it fires twice it's really amazing.
 

mapriex

Active member
additional to the problem, i come up with this strange behaviour:Snag_18db89cb.png

both actions invoked and this twice in a really short time, far below 1 second.
also the if condition claims the questioning of a triggered fired action to the "Battery battery trigger" and not the default "Battery Level" trigger.
so the if condition doesn't allow the popup message.

as you said its depending which trigger is first or not first in the trigger row. its strange that the second trigger did use the same trigger as the first trigger in the log, even though it should the other one. logical it should be: battery level triggered and then battery battery trigger. or battery battery trigger and then battery level trigger.

i guess its with the timings of accessing the RAM. if you watch closer accessing happens really fast (red marked) so it couldnt rename the variable of macrodroid and got calculated with the wrong trigger-point that used just right before, but its only a guessing.


thank you for the cool video, helped me a lot to understand the problem closer.
 

Dm114

Well-known member
additional to the problem, i come up with this strange behaviour:View attachment 8508

both actions invoked and this twice in a really short time, far below 1 second.
also the if condition claims the questioning of a triggered fired action to the "Battery battery trigger" and not the default "Battery Level" trigger.
so the if condition doesn't allow the popup message.

as you said its depending which trigger is first or not first in the trigger row. its strange that the second trigger did use the same trigger as the first trigger in the log, even though it should the other one. logical it should be: battery level triggered and then battery battery trigger. or battery battery trigger and then battery level trigger.

i guess its with the timings of accessing the RAM. if you watch closer accessing happens really fast (red marked) so it couldnt rename the variable of macrodroid and got calculated with the wrong trigger-point that used just right before, but its only a guessing.


thank you for the cool video, helped me a lot to understand the problem closer.
You're right: firing twice with the same trigger in a couple of milliseconds doesn't seem to be normal behavior.

Guess Endercraft already reported to @MacroDroidDev
 

Endercraft

Moderator (& bug finder :D)
Guess Endercraft already reported to @MacroDroidDev
I reported to @Josué García, he should see it soon.

additional to the problem, i come up with this strange behaviour:View attachment 8508

both actions invoked and this twice in a really short time, far below 1 second.
also the if condition claims the questioning of a triggered fired action to the "Battery battery trigger" and not the default "Battery Level" trigger.
so the if condition doesn't allow the popup message.

as you said its depending which trigger is first or not first in the trigger row. its strange that the second trigger did use the same trigger as the first trigger in the log, even though it should the other one. logical it should be: battery level triggered and then battery battery trigger. or battery battery trigger and then battery level trigger.

i guess its with the timings of accessing the RAM. if you watch closer accessing happens really fast (red marked) so it couldnt rename the variable of macrodroid and got calculated with the wrong trigger-point that used just right before, but its only a guessing.


thank you for the cool video, helped me a lot to understand the problem closer.
I'll guess in the first image it's the presence of both triggers that make this happen and the same reason for the second image (I really can't be sure though).
 
Top