r/tasker • u/unselective-amnesia • 27d ago
Tasker profile/task combination for periodically firing off a task when device is asleep?
I'm using Tasker version 6.7.9 under rooted Android 13. Can anyone suggest the most efficient and effective way to code the following logic in Tasker? ... probably a combination of one or more profiles and tasks.
whenever device has been asleep for X seconds
then
invoke task named Y
put the device back to sleep
endif
... where "X" and "Y" are configurable parameters. And my assumption is that the device will "wake up" when task "Y" is invoked. However, if that assumption is not correct, then preceding the "invoke task named Y" operation, I would also want there to be some sort of "wake up device" operation.
UPDATE: And I'm perfectly happy with the possibility that one or more "Code=>Run Shell" actions also might be used as part of the implementation of this logic.
3
u/bliblabl812 27d ago
Define device asleep.
3
u/Exciting-Compote5680 26d ago
There is a 'Device Idle' state context you could try. But I can't help but think this might be one of those 'XY problem' cases.
2
u/DifficultyCrafty7623 27d ago
define wake up.
1
u/sasreedit S22, GW5P 26d ago
I second the prev questions, tho I also wonder what is waking your phone? I think it would be best to figure out what's causing the 'wake' first before providing a bandaid?
1
u/nednednerb 26d ago
I think more relevant your use case is making sure the apps and processes involved in your tasks are not actively suppressed into "background tasks" and then terminated entirely, and also, not delayed by any "battery optimization".
Ultimately, though, first I'd create a profile based on Dispaly Off + regular time interval, and then just test if you have issues with your tasks. If something does not run all the time, then something is likely killing it \ pushing it out of memory.