Tasks Not Running When Screen is Locked - Tasker Tips & Tricks

I am running an AOSP 8.1 based ROM (Validus) on my rooted OnePlus 5 (no xposed). Tasker has "Modify system settings", "Display over other apps", "Background activity" on, "Battery optimization" set to "Not optimized", and is a Device admin.
I made a simple task to test this problem. I added this task to my quick settings. The task has only one action:
Beep
Frequency: 8000
Duration: 500
When I try to run this task from quick settings while my phone is locked (fingerprint/pin required), it does not run until I first unlock (fingerprint/pin). I have also tested in this same manner with other simple tasks such as Popup, Setup Quick Settings, and Notify. I get the same result in all cases.
This seems like a bug and/or oversight? How can I fix this?

Tasker FAQ: Why doesn't Tasker work in the background on my device
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

ktmom said:
Tasker FAQ: Why doesn't Tasker work in the background on my device
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
Tasker works in the background just fine for me, but will not run a task initiated from quick settings over a secure lock screen.

That's Android
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Related

HELP:Task won't run when phone locked,using shell with root

Hello,
I am using tasker latest version from playstore,issue i am facing is where i have a task to perform root input command to send info via whatsapp, this task would work pretty well when screen ON & unlocked, but wouldnt run with screen locked.
I am learning tasker and have been fun tinkering with stuff, perhaps there are some basic pointers some one could point me towards?
Basic Whatsapp send task
Send WhatsApp Basic (2)
A1: Secure Settings [ Configuration:Screen & Keyboard Lights On
30 Seconds Timeout (Seconds):0 Continue Task After Errorn ]
A2: Go Home [ Page:0 ]
A3: Wait [ MS:150 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A4: Launch App [ App:WhatsApp Data: Exclude From Recent Appsff Always Start New Copyn ]
A5: Wait [ MS:300 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A6: Run Shell [ Command:input tap 850 150 Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: ]
A7: Wait [ MS:300 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A8: Run Shell [ Command:input tap 850 150 Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: ]
A9: Wait [ MS:300 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A10: Type [ Text:%Clip Repeat Times:1 ]
A11: Wait [ MS:300 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A12: Run Shell [ Command:input tap 630 330 Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: ]
A13: Wait [ MS:300 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A14: Type [ Text:%Clipmsg Repeat Times:1 ]
A15: Wait [ MS:300 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A16: Run Shell [ Command:input tap 1000 1100 Timeout (Seconds):1 Use Rootn Store Output In: Store Errors In:%clip Store Result In: ]
A17: Variable Clear [ Name:%Clipmsg Pattern Matchingff Local Variables Onlyff ]
A18: Variable Clear [ Name:%Clip Pattern Matchingff Local Variables Onlyff ]
A19: Flash [ Text:Message sent!! Longff ]
A20: Button [ Button:Back ]
A21: Wait [ MS:150 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A22: Button [ Button:Back ]
A23: Button [ Button:Back ]
A24: Button [ Button:Back ]
A25: Stop [ With Errorff Task: ]
Here %Clip is senders name, %Clipmsg is what you want to send,the text
I use it to send date time and GPS co ordinates via whatsapp using Task no 2
Send Location WhatsApp (55)
A1: Variable Set [ Name:%Clipmsg To:%DATE,%TIME,**Using Google Api to send link*** Recurse Variablesff Do Mathsff Appendff ]
A2: Get Location [ Source:Any Timeout (Seconds):100 Continue Task Immediatelyff Keep Trackingff ]
A3: Variable Set [ Name:%Clip To:*mobile number** Recurse Variablesff Do Mathsff Appendff ]
A4: Perform Task [ Name:Send WhatsApp Basic Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stopff ]
A5: Stop [ With Errorff Task:Send WhatsApp Basic ]
A6: Beep [ Frequency:500 Duration:1000 Amplitude:50 Stream:3 ]
Tasker is my device administrator,Battery saving has been turned off,Run in foreground enabled,Reliable Alarms Always
What am i missing?
Device;Redmi Note 4, Snapdragon 625 version, OS-Miui 9 (Android 7.0), Rooted.
Is it locked with the display on or off? Tasker is weird sometimes when the screen is off. You can wake the screen with Secure Settings.
Have you disabled battery optimization for tasker? Tried using reliable alarms in preferences?
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
I am facing similiar issue Tasker not run during screen off and locked. I would like to know too.
claudchan said:
I am facing similiar issue Tasker not run during screen off and locked. I would like to know too.
Click to expand...
Click to collapse
Your response to the post above yours?
ktmom said:
Your response to the post above yours?
Click to expand...
Click to collapse
No. My Tasker is not optimized. I still facing not run. When I wake up my screen and unlock, then task start to run.
claudchan said:
No. My Tasker is not optimized. I still facing not run. When I wake up my screen and unlock, then task start to run.
Click to expand...
Click to collapse
In addition to disabling battery optimization for Tasker, you need to enable reliable alarms in preferences so when the screen is off, Tasker still runs.
If you are using a Samsung device, there are probably additional settings specific to Samsung to prevent the ROM from killing Tasker processes when the screen is off.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
ktmom said:
In addition to disabling battery optimization for Tasker, you need to enable reliable alarms in preferences so when the screen is off, Tasker still runs.
If you are using a Samsung device, there are probably additional settings specific to Samsung to prevent the ROM from killing Tasker processes when the screen is off.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
I did try realiable alarm set to always. Still have same issue. Sometimes it work but sometimes not.
claudchan said:
I did try realiable alarm set to always. Still have same issue. Sometimes it work but sometimes not.
Click to expand...
Click to collapse
What device, ROM and Tasker version are you using? Do you have a wake lock blocker installed? Maybe xposed, a Magisk module, greenify...
At this point, it would also help for you to share your profile.
Make sure it's named - not a default name assigned by tasker. Then long press on the name to highlight the profile. Go to the 3-dot menu and select export -> Description to Clipboard.
Then you'll be able to paste it. Be aware, it easier to use pastebin then link to a post here.
If you paste in a post here, the forum software will convert all semicolons with characters after, typically "on" and "off" to emoticons making it very hard to read.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
ktmom said:
What device, ROM and Tasker version are you using? Do you have a wake lock blocker installed? Maybe xposed, a Magisk module, greenify...
At this point, it would also help for you to share your profile.
Make sure it's named - not a default name assigned by tasker. Then long press on the name to highlight the profile. Go to the 3-dot menu and select export -> Description to Clipboard.
Then you'll be able to paste it. Be aware, it easier to use pastebin then link to a post here.
If you paste in a post here, the forum software will convert all semicolons with characters after, typically "on" and "off" to emoticons making it very hard to read.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
Device Oneplus One
Custom ROM Oreo, Bootleggers but had same issue on other rom too. Thunder kernel.
Using Magisk but no module installed.
App use ForceDoze. I had set whitelist for tasker too.
Tasker version 5.4.1b.bf2
The profile that had issue;
https://pastebin.com/qxnmy0vL
claudchan said:
Device Oneplus One
Custom ROM Oreo, Bootleggers but had same issue on other rom too. Thunder kernel.
Using Magisk but no module installed.
App use ForceDoze. I had set whitelist for tasker too.
Tasker version 5.4.1b.bf2
The profile that had issue;
https://pastebin.com/qxnmy0vL
Click to expand...
Click to collapse
You exported to XML, not description to clipboard so I'm guessing what's happening. I think you need to revisit your WiFi connected context and set "active" to "any".
If that doesn't help, please export again and use DESCRIPTION to clipboard.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
ktmom said:
You exported to XML, not description to clipboard so I'm guessing what's happening. I think you need to revisit your WiFi connected context and set "active" to "any".
If that doesn't help, please export again and use DESCRIPTION to clipboard.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
I use wifi near not wifi state. There is no input for active or any. Today tested and the issue still persist.
Pastbin: https://pastebin.com/PFxysnL6
claudchan said:
I use wifi near not wifi state. There is no input for active or any. Today tested and the issue still persist.
Pastbin: https://pastebin.com/PFxysnL6
Click to expand...
Click to collapse
Switch "toggle WiFi" to "on" (check the box) in the WiFi near context. Make sure WiFi scanning is enabled in settings. On Oreo; security&location -> location -> scanning
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
ktmom said:
Switch "toggle WiFi" to "on" (check the box) in the WiFi near context. Make sure WiFi scanning is enabled in settings. On Oreo; security&location -> location -> scanning
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
Toggle wifi doesn't have option to choose wether is on or off.
So I just make it checked?
Yes, check the box for toggle WiFi to turn it on.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
ktmom said:
Yes, check the box for toggle WiFi to turn it on.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Click to expand...
Click to collapse
Seems like working. So is the wifi toggle require to be checked. But from my past years i been using without wifi checked but working fine. Still not sure what is the recently caused. Anyway thanks a lot man.
Problem still the same after clean flashed new rom.
I assuming Is Tasker clashed during screen off.

Basic sound profiles

Hello guys, despite having bought this app for years, I never used it because I was never able to create simple sound profiles.
I'd like to create basic timer tasks like:
- at 23h59 every day, enable DND
- at 7h30 on MTWTF, disable DND, volume at 1, no vibrate mode
+ other tasks based on week day and time of the day.
The thing is, with Tasker, it looks like you have to put an end to a time schedule, but I don't want that. I just don't know when it will ends. If I keep only "from" and don't enable "to", it just goes to midnight, which I don't want.
I wan't a profile to do a one time action at a given time, no end. Is there a way ?
Feel free to answer even in 1 year, I'm sure it would allow me to use this app.
Just use a time profile to set a variable. Then use the variable as the context to trigger the task. You can use a non-time related method (e. g. a widget) to clear the variable to end the task.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
But I don't want to use a widget to end a task. I just want an action to be done at a precise time and that's it.
Nojevah said:
But I don't want to use a widget to end a task. I just want an action to be done at a precise time and that's it.
Click to expand...
Click to collapse
So you want the task to run at a specific time every day? Set the time context start and end times to the same time. It will run every day at that time.
By the way, all of this type of information is available on how to use these contexts and actions in the online [URL="http://tasker.dinglisch.net/userguide/en/" ]user guide[/URL]. Specifically, what I just posted above is on the [URL="http://tasker.dinglisch.net/userguide/en/timecontext.html" ]profile - > time context page [/URL], at the end under notes.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
I've tried this, but it does not work !
If I set a rule: at 07:30 use vibrate mode (with end at 7:30), it will put the phone in vibrate mode (btw it does not always work since tasker is late sometimes and miss the right time and will trigger at 07:32 but that's another problem).
Then at 07:31, it will remove vibrate mode. I never asked for this, but it considers that at 07:31 it has to stop profile and so it has to remove vibrate mode, surely because it considers it was not in vibrate mode before 07:30.
Nojevah said:
I've tried this, but it does not work !
If I set a rule: at 07:30 use vibrate mode (with end at 7:30), it will put the phone in vibrate mode (btw it does not always work since tasker is late sometimes and miss the right time and will trigger at 07:32 but that's another problem).
Then at 07:31, it will remove vibrate mode. I never asked for this, but it considers that at 07:31 it has to stop profile and so it has to remove vibrate mode, surely because it considers it was not in vibrate mode before 07:30.
Click to expand...
Click to collapse
Ok, now we get to the real problem. Long press the profile so it is highlighted then tap the gear icon top, right. Unchecked restore settings.
As far as accurate times, preferences -> monitor -> reliable alarms -> always.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Wow, thanks for this ! I don't know why it's in a hidden setting in "advanced mode", since I prefer to use beginner mode but if it works, I'm fine with this. I'll create my profiles again soon with this new setting.
Concerning "reliable alarms", I had tried this, but it adds an alarm icon in the notification bar, and I don't want that. But that's not a problem, now that I know how to prevent settings to change when profile ends, I'll use a 5 minutes delta between beginning and end.
Thanks for your patience and your useful help !
If you run in beginner mode, you should preface your questions with that info. It limits the things you can do.
As far as the status bar icon goes, in preferences -> monitor, make sure "run in foreground" is checked, set reliable alarms to always and then uncheck "show notification icon".
Is possible you have to take the additional steps described in the pop-up that appears. It's also possible, depending on device and OS, that the Tasker notifications for tasks will also be hidden.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Nojevah said:
...
I'll use a 5 minutes delta between beginning and end.
...
Click to expand...
Click to collapse
If what you mean by this comment is the end time of the profile context will be set 5 minutes after the start time, and you have an exit task, the exit task will run at the end time. The only way to make a time context instantaneous is for the start and end times to be identical.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
This 5 minutes delta is for Tasker to trigger the task, since sometimes it misses the precise time.
For example, if I put
"From 7:30 To 7:30" -> Vibrate mode On
It won't necessarily work since Tasker will miss 7:30 (since I don't use "reliable alarm" because of the alarm clock icon in notification bar next to time). But If I put
"From 7:30 To 7:35" -> Vibrate mode On
It will work. Because Tasker might miss 7:30, but it won't miss 31 or 32 or ... 35
When 7:36 happens, profile is ended, but like it does nothing, I'm good, that's what I want !
So for now, my profiles work great, I'm happy.
That's interesting behavior. What device is this?
The only time I get a clock icon is for future alarms. I disable that in my ROM's settings. Tasker has never impacted that icon on any of my devices.
Running Tasker in foreground causes the Tasker icon to display but using the feature in preferences to disable the icon works for me.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
The phone is a Samsung Galaxy A3 2017.
Here is the clock icon in notification bar (I have the same if I set an alarm in a Clock app): https://i.imgur.com/8jBURTJ.jpg
And if I enable "run in foreground", I have an extra icon thanks to Android 8, and in notification, it's said "Tasker is running in background":
https://i.imgur.com/qJHRvb8.jpg
FWIW, there is a way to hide status bar icons using Tasker. Here a tutorial.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

tasker geofences in an if statement

Not sure if its possible but i was wondering if you can do a task IF i am at 1 location and a different task within an app at another.
I have an app that i need to switch to loud while at work and silent when i get home. I can use autoactions one for each location but was wondering if it could be done cleaner... Its a pager app for the fire service as i am a firefighter in the uk.
I have thought about it but cant quite get my head around it...
Aby advice would be greatly appreciated
You need 2 profiles regardless because it's 2 locations.
The only alternative to 2 profiles (one for each location) is an action at one location and a reset (e.g. exit task) when not at that location. If you're ok with a louder volume everywhere but at home, then you can just have the exit task restore the volume when you leave home.
You can do this with geofencing or if there is WiFi at each of these locations, you can use a WiFi near context.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
I have an app that i need to switch to loud while at work and silent when i get home. [/QUOTE said:
I would do a simple one , i.e. :
Profile
Apps ( i.e. Whatsapp )
Task
A1: If
%WIFII~home ( of course you use scan option to get correct SSID of your home Wi-Fi )
A2: Go to action label LOW
A3: End if
A4: If
%WIFII~work ( of course you use scan option to get correct SSID of your work Wi-Fi )
A5: Go to action label HIGH
A6: End if
A7: Media Volume 2 ( or anything you like ) *** at bottom , check mark label and type " LOW "
A8: Media Volume 9 ( or anything you like ) *** at bottom , check mark label and type " HIGH "
A9: STOP
so that you are relying on Wifi situation to control the volume of your phone in my opinion is battery friendly.
Thanks
edmond
Click to expand...
Click to collapse
Brilliant guys. Thanks!

profile request

If I could.please get some help with a profile or link to a current one that when screen is off i would like my data and WiFi turn off
Thanks.in advance
That's pretty straight forward. The profile context would be a state -> display -> display state and select off. That will trigger whenever the display goes off. Then use the task to turn off WiFi and data. They are both in the "net" section.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Sync Notification Pop Up dismissed using Tasker and AutoInput

Hi Everyone!
On my Galaxy S9+ running Oreo, I'm getting a similar pop-up window prompt every time I press the sync button:
Turn on Auto sync
Any changes you make to your accounts on the web will be automatically copied to your phone...
I've known about this pop up window ever since my Galaxy S7 (Marshmallow), it annoys the heck out of me. However, using the same code with Tasker and AutoInput doesn't seem to automatically press OK for me like it used to. In a nutshell, an event profile with %WIN (new window, dialog window) with the label "Turn on auto sync" linked to a task to press OK using the AutoInput plugin. There were many user guides created back then about this, such as this one: http://tech-rg.blogspot.com/2016/04/disable-auto-sync-pop-up-message-on.html
Any ideas as to what internally has changed in Oreo that I need to modify to make this work now?
Thanks for your help!
Try flashing the %WIN variable at the start of your task. It's possible that had changed. There have been increasing difficulties picking up the value.
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini
Thanks for the reply. I think this is a lost cause...after looking at the %WIN variable a bit more today, it appears this one no longer works after Google revises the accessibility service. https://www.androidpolice.com/2017/...vices-anything-except-helping-disabled-users/
From another thread...
The only things effected in core Tasker (even with the work-around in place) will be the following few actions:
Events: Button Clicked, Notification Clicked, New Window
Variables: %WIN
Actions: Long Power, Back Button, Toggle App Dock, Quick Settings, Show Recents, Status Bar
Have you tried going to:
Menu -> Preferences -> Monitor -> Display On Monitoring -> App Check Method and selecting "Accessibility"
"find somebody that you think is undeserving of your compassion and give it to them" - Christian Picciolini

Categories

Resources