Trigger Flashlight on

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Post Reply
tempe222
Posts: 7
Joined: 11 Jan 2019 09:40

Trigger Flashlight on

Post by tempe222 » 12 Jan 2019 19:14

It would be useful to be able to count down after turning on the flashlight to turn it off again after X minutes, e.g. when it was turned on accidently, or when reading in the evening or putting the baby to sleep.

User avatar
Rafi4
Posts: 127
Joined: 01 Dec 2017 05:23

Re: Trigger Flashlight on

Post by Rafi4 » 14 Jan 2019 09:32

hi
this trigger is already available.

trigger = system setting changed
category = system
name = torch_light
variable = torch

condition = torch == 1; true;
add actions which you want to true branch.

any doubts please post?

welcome

User avatar
Desmanto
Posts: 1757
Joined: 21 Jul 2017 17:50

Re: Trigger Flashlight on

Post by Desmanto » 14 Jan 2019 16:56

This event is not created in every android, at least not at mine, RR 6.2.0 Oreo 8.1. I have checked the system setting and the LOS setting too, nothing change during the flashlight is on. Logcat only show some camera manager invoking the flashlight. No broadcast, no event created. But I can still use condition Flashlight on to check whether the flashlight is turned on.

So the only way to check it is using some periodic timer to check if the flashlight is on, then turn it off. But this is not the best. Maybe it is better just create a flow, which turn on flashlight and auto turn it off after several minutes. Next time, to use flashlight, create a shortcut to that flow and give it a flashlight icon.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), Resurrection Remix Official 7.0.2 20190512, Pie 9.0, Rooted.

User avatar
Rafi4
Posts: 127
Joined: 01 Dec 2017 05:23

Re: Trigger Flashlight on

Post by Rafi4 » 15 Jan 2019 00:25

hi desmanto
this is working perfectly on my device Samsung Galaxy j2.
I am uploading flow. turn on flash light through Automagic or notification panel this flow is perfectly working. edit it as your needs

from record4
Attachments
Light_off_20190115_055210.xml
(4.09 KiB) Downloaded 29 times

tempe222
Posts: 7
Joined: 11 Jan 2019 09:40

Re: Trigger Flashlight on

Post by tempe222 » 15 Jan 2019 08:12

Thanks! This goes way beyond my current experience. How do I know the variable is "torch"?

And is the attached flow then correct?
Attachments
Screenshot_20190115-091010.jpg
Screenshot_20190115-091010.jpg (145.42 KiB) Viewed 843 times

User avatar
Rafi4
Posts: 127
Joined: 01 Dec 2017 05:23

Re: Trigger Flashlight on

Post by Rafi4 » 15 Jan 2019 08:40

hi
In trigger you can find the variable "torch".
you may change it as you wish, if you named it as example
"light". change it in condition "expression" also as "light."

from record4

User avatar
Desmanto
Posts: 1757
Joined: 21 Jul 2017 17:50

Re: Trigger Flashlight on

Post by Desmanto » 15 Jan 2019 18:24

@Rafi4 : Your flow use trigger Glovar dt, I don't know why you need that. Probably you uploaded the wrong flow. Maybe it is system setting changed. But not all android provide this value change when flashlight is on, so it depends on the phone. To perform action on notification, the screen doesn't need to be on, nor the notif bar should be pulled down. So no need to turn screen on, pull down the notif. Simply directly perform action on notif.

@tempe222 : if your phone set the value after turn on flashlight, you can find it in system setting. Create another flow, add trigger, System Setting Changed, system. Add another two same trigger, choose secure and global. Add condition debug dialog after it. Enable the flow and Turn on the flashlight. If the value is set, you should debug dialog pop up. If not (mostly likely nothing), then the system doesn't provide you the value for flashlight. Disable the flow afterward, or you will get a bunch of popup later.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), Resurrection Remix Official 7.0.2 20190512, Pie 9.0, Rooted.

User avatar
Rafi4
Posts: 127
Joined: 01 Dec 2017 05:23

Re: Trigger Flashlight on

Post by Rafi4 » 15 Jan 2019 21:40

hidesmanto
thanks for your suggestion.

from record4

User avatar
Rafi4
Posts: 127
Joined: 01 Dec 2017 05:23

Re: Trigger Flashlight on

Post by Rafi4 » 16 Jan 2019 00:30

hi
Attachments
torch_20190116_055810.xml
(2.82 KiB) Downloaded 25 times

Post Reply