Trigger an event seconds bevore the screen goes off

89 views
Skip to first unread message

Uwe

unread,
Mar 25, 2015, 6:53:43 AM3/25/15
to tas...@googlegroups.com
I'm fiddling with tasker a while now but can't figure out how to do this.
For an e-ink device I wan't Tasker to do a screenshot just some seconds before the screen is switch off, e.g. screensaver is started.
I found out how to make screenshots with tasker and using %DTOUT I can get the general timout for the display but not the time left till timout.
This could be used in Tasker with a countdown timer that is reset by every button and screenaction. Button action as trigger I figured out, but general touchscreen actions? 

What I'm really searching is, how much time is still left till the display timout is triggered to make the screenshot in the last 10s.

Can somebody help me? 

Brad Minion

unread,
Mar 25, 2015, 8:57:12 AM3/25/15
to tas...@googlegroups.com
Could you have a profile that activates when the screen goes off and then have it's task wake the phone (Secure Settings or popup), do the screenshot and then put the phone back to sleep (Secure Settings)?  You'll need a cooldown or some other way to prevent a nasty loop.

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Uwe

unread,
Mar 26, 2015, 9:27:37 AM3/26/15
to tas...@googlegroups.com
Thanks, that could help. I'm still trying a different approach (changing settings.db table system lockscreen.disabled from 0 to 1) but this  settings.db  is rewritten with every systemstart.


Am Mittwoch, 25. März 2015 13:57:12 UTC+1 schrieb Brad Minion:
Could you have a profile that activates when the screen goes off and then have it's task wake the phone (Secure Settings or popup), do the screenshot and then put the phone back to sleep (Secure Settings)?  You'll need a cooldown or some other way to prevent a nasty loop.
--

Uwe

unread,
Mar 26, 2015, 10:16:31 AM3/26/15
to tas...@googlegroups.com
Thanks that may work. Actually I'm trying it another since I can't locate the real image that is loaded as standby picture. Thought I had it but the one I found wasn't used by the system.


Am Mittwoch, 25. März 2015 13:57:12 UTC+1 schrieb Brad Minion:

Uwe

unread,
Mar 28, 2015, 3:09:36 AM3/28/15
to tas...@googlegroups.com
Some progresses here.
I figured the screenshot part out and how to put the device to sleep (Shell: input keyevent 26).
But what I can't find is how to get Tasker to intercept the Display off and how to prevent an on/off loop.
Tried: profile Display off, Tasker is activated after the display is manually turned on again (Display stay active is not supported [Android 4.2.2]).
Tried: Secure Settings Screen&Keyboard Lights On 4 seconds, doesn't wake the screen.
Any ideas?

Am Mittwoch, 25. März 2015 13:57:12 UTC+1 schrieb Brad Minion:

Rich D

unread,
Mar 28, 2015, 12:44:13 PM3/28/15
to Tasker Google Groups Post
On Sat, Mar 28, 2015 at 2:09 AM, Uwe <bei0k...@googlemail.com> wrote:
Some progresses here.
I figured the screenshot part out and how to put the device to sleep (Shell: input keyevent 26).
But what I can't find is how to get Tasker to intercept the Display off


​Not sure ​if this will help, but on my device the screen dims just before it shuts down. The dim setting is lower then I ever have the display so, could you trigger on Brightness < X 

You could poke around in the Shell dumpsys to see if there is some sort of display off timer info in there.  





Uwe

unread,
Mar 29, 2015, 4:51:32 AM3/29/15
to tas...@googlegroups.com
Thanks for the ideas.

To specify, it is an E-Ink device. The screen goes off and the device just hibernates to preserve power. That is probably the reason, Tasker is not fired up. If screenlight is on it goes off some 2s before the screen goes off, but most of the time, I don't use the screenlight.
It is not, that the screen goes off in a normal Android way. Before that, a standbypicture is loaded and stays on.
I want to change that picture into the last screenview. (as I wrote before, I figured out how to change the picture but not before it is loaded into the stanby screen).

Tried it with the dimming, not working
Had a look into  dumpsys  (very interesting but my output is missing some information like:  "mNextTimeout=91922738 now=92136117 -213s from now").

Rich D

unread,
Mar 29, 2015, 9:41:33 AM3/29/15
to Tasker Google Groups Post


Could you explain a bit more why the display off approach is not working?

> Tried: profile Display off, Tasker is activated after the display is manually turned on again

Are you saying tasker does not detect your screen off event?

(Display stay active is not supported [Android 4.2.2]).
> Tried: Secure Settings Screen&Keyboard Lights On 4 seconds, doesn't wake the screen.

Are you saying you can not get tasker to wake the screen?  You can use a pop up action with a 0 time out for that.

Uwe

unread,
Mar 29, 2015, 10:04:56 AM3/29/15
to tas...@googlegroups.com
Display off approach is not working because Tasker is not able to let the device stay awake or wake up again. Tasker detects Display off event but can not awake the device. Tasker actions are done immediately after device returns from standby (that way I'm sure the  Display off event is detected). What I tried  in Tasker to make device awake is:
1)  use a pop up action with a 1s time out (0 time was not available) for that - popup showed after returning from standby via powerbutton.
2)  use Secure Settings - Konfiguration Screen&Keyboard Lights On 4 Seconds
Not sure how Tasker could be persuated to wake up the device. 

Uwe

unread,
Mar 29, 2015, 4:57:37 PM3/29/15
to tas...@googlegroups.com
I tried the same approach on my phone now and it was working.
So this is  woring only on the phone, I could intercept the standby mode but it will not work this way on my Android EReader.
Reply all
Reply to author
Forward
0 new messages