(resolved) Automatic Detection Issue with Flashlight Settings

Winny57

Member
Hello MacroDroid community,

I'm experiencing an issue with system modifications monitoring. While controlling changes in flashlight settings (0 and 1) through the parameter {setting_secure=flashlight_enabled}, the detection doesn't trigger automatically despite the correct modification. However, if I manually refresh the status, it works. Is there a solution or workaround available to address this issue?

Thanks in advance for your assistance!

Bonjour à la communauté MacroDroid,

Je fais face à un problème avec la surveillance des modifications système. En contrôlant les modifications des paramètres du flash (0 et 1) via le paramètre {setting_secure=flashlight_enabled}, la détection ne se déclenche pas automatiquement malgré la modification correcte. Cependant, si j'actualise manuellement l'état, cela fonctionne. Y a-t-il une solution ou un contournement possible pour résoudre ce problème?

Merci d'avance pour votre aide!
Screenshot_20240124-002221.png
 

mapriex

Active member
hi,
first change macrodroid in english please, and then show the log, when you thinking it must change.

maybe if you reupload your macro, i can see what you exactly want and if it supposed to be.
 

Winny57

Member
hi,
first change macrodroid in english please, and then show the log, when you thinking it must change.

maybe if you reupload your macro, i can see what you exactly want and if it supposed to be.
Using the {setting_secure=flashlight_enabled} parameter to monitor flash changes (0 and 1), automatic detection does not activate, even though the modification is correct.

In short, I would like to receive a notification when the flash turns on.

En utilisant le paramètre {setting_secure=flashlight_enabled} pour surveiller les modifications du flash (0 et 1), la détection ne s'active pas automatiquement, même si la modification est correcte.

En résumé, je souhaite recevoir une notification dès que le flash s'allume.
 

Attachments

  • Screenshot_20240124-012256.png
    Screenshot_20240124-012256.png
    176.5 KB · Views: 13
  • Screenshot_20240124-012219.png
    Screenshot_20240124-012219.png
    182.1 KB · Views: 13

mapriex

Active member
Using the {setting_secure=flashlight_enabled} parameter to monitor flash changes (0 and 1), automatic detection does not activate, even though the modification is correct.
i understand, can you screenshot the log pls? also when you do it manually change to see where are the changes.

EDIT:
i guess the first screenshot shows that when you change it, the popup shows? when you implement the variable then it doesn't go i guess?
 

Endercraft

Moderator (& bug finder :D)
I know what the problem is. I your trigger you are using a trigger to get the value of the system setting. To monitor changes you need to use its name only. Use flashlight_enabled instead.
 

mapriex

Active member
I know what the problem is. I your trigger you are using a trigger to get the value of the system setting. To monitor changes you need to use its name only. Use flashlight_enabled instead.
i dont know if its neccessary, the trigger fired constraint, since the trigger works only when its changing?
 

Winny57

Member
My macro should do the following: When I activate the flash, the {setting_secure=flashlight_enabled} parameter changes from 0 to 1, triggering a notification through the variable.
However, I have to execute "test the action" on the variable for it to work because it doesn't automatically detect the variable change.

Edit:
 
Last edited:

Winny57

Member
I'm bringing new information: I managed to perform the desired actions using the Tasker application. I created a Tasker macro that triggers a notification when the {setting_secure=flashlight_enabled} parameter changes. After that, I retrieve the notification event with Macrodroid. However, the issue seems to stem from Macrodroid not detecting the change in the {setting_secure=flashlight_enabled} parameter.
 

Winny57

Member
I know what the problem is. I your trigger you are using a trigger to get the value of the system setting. To monitor changes you need to use its name only. Use flashlight_enabled instead.
"You were right about replacing it with the `flashlight_enabled` code. I've simplified my macro now and share it through the app with the name 'Macro Flash On/Off.' The only remaining issue is that the macro triggers multiple times per second. I managed to handle it a bit, but if you have any ideas to address the repetitive triggering, I'm open to suggestions ;-) "

Edit:
Venant d'un français en plus 💪🤜🤛
 

mapriex

Active member
"You were right about replacing it with the `flashlight_enabled` code. I've simplified my macro now and share it through the app with the name 'Macro Flash On/Off.' The only remaining issue is that the macro triggers multiple times per second. I managed to handle it a bit, but if you have any ideas to address the repetitive triggering, I'm open to suggestions ;-) "

Edit:
Venant d'un français en plus 💪🤜🤛
using a prell time of 1 second - wait until - at the last action.
 

Endercraft

Moderator (& bug finder :D)
Set a variable to the obtained value everytime the macro is ran. Then add a constraint globally or to the trigger "if {setting_secure=flashlight_enabled} != {lv=check}" (assuming the variable is named check).
 

Winny57

Member
ok, i got it, a toggle variable is needed, lemme think, how you can implement it.
Not sure if it's necessary because when "flashlight_enabled" is triggered, it triggers twice, as indicated in the log. It's not a big deal since the macro still works, but it would be cool if it were perfect ;-)
Anyway, thank you for following up on the issue. I'm marking it as resolved.
 

mapriex

Active member
in the log it triggered several times. why you deleted the 2 sec before? if you think its just time related action within a certain time the trigger fires then its the prell time, but in the logs it looks like the enable state will fire "always", because its enabling trigger then. thats why you need a toggle as trigger and not a state of the flashlight (and maybe an entry point.)

what of these 2 cases is it?
 

Winny57

Member
in the log it triggered several times. why you deleted the 2 sec before? if you think its just time related action within a certain time the trigger fires then its the prell time, but in the logs it looks like the enable state will fire "always", because its enabling trigger then. thats why you need a toggle as trigger and not a state of the flashlight (and maybe an entry point.)

what of these 2 cases is it?
The time in between is the duration during which the flash is on. The first activation is:16:14:35.608 - T: Modification of system settings (Flash macro test)
25-01-24 16:14:35.608 - Invocation of macro: flash test macro (Flash macro test)
25-01-24 16:14:35.609 - A: Contextual message 'Attention flash activated' (Flash macro test)
25-01-24 16:14:35.610 - T: Modification of system settings (Flash macro test)
25-01-24 16:14:35.610 - Invocation of macro: flash test macro (Flash macro test)
25-01-24 16:14:35.611 - A: Contextual message 'Attention flash activated' (Flash macro test)The rest is about turning off the lamp, and we can see that the trigger sends two activations.
 

mapriex

Active member
here are 2 methods to prevent this missbeavior. the reason behind was the signal triggering thats come as a waveform that triggers the enable function twice. for that i used a simple toggler macro and a global toggler variable (screenshot 1 and 2)

the second solution is an aio macro (yes i know in macroid its cooler to have a function compressed in one macro) with allowing only oneway flankpoint activation since the flash trigger variable is not filtered. (screenshot 3 and 4)

with personal debugging its much easier to recreate the actual problem. i am sorry for the false advices.

the prell timer prevention couldnt activate since the trigger fires twice before running the macro.

have fun with your macro.
 

Attachments

  • Screenshot_20240125-233511.png
    Screenshot_20240125-233511.png
    111.3 KB · Views: 10
  • Screenshot_20240125-233547.png
    Screenshot_20240125-233547.png
    226.9 KB · Views: 10
  • Screenshot_20240125-233759.png
    Screenshot_20240125-233759.png
    233.2 KB · Views: 11
  • Screenshot_20240125-233810.png
    Screenshot_20240125-233810.png
    234.4 KB · Views: 10
Top