Page 1 of 1

Trigger "User absent"

Posted: 12 Jan 2019 07:42
by tempe222
This trigger when locking the screen would be very helpful for battery saving actions.

Tempe

Re: Trigger "User absent"

Posted: 12 Jan 2019 11:20
by Desmanto
Locking the screen will turn it off. Why don't just use Trigger "Display State" - off?

Re: Trigger "User absent"

Posted: 12 Jan 2019 21:46
by tempe222
It's not the same because this triggers flows e.g. when you just turn on the display for seeing the time or if you have new messages (i.e. not unlocking) and the screen turns off again by itsself

Re: Trigger "User absent"

Posted: 13 Jan 2019 17:51
by Desmanto
Let me rephrase your need (CMIIW). What you want is
Screen off : turn on battery saver
Unlock screen : turn off battery saver.

If that so, use
Trigger Display State - off : turn on battery saver
Trigger User Present : Turn off battery saver

Don't use Trigger Display State - On, for turning off battery saver, as you haven't unlocked the phone yet (only to check time). Using User present, the flow only triggered after you successfully unlock the phone; turning the screen on won't trigger it.

Re: Trigger "User absent"

Posted: 14 Jan 2019 06:36
by lojzik
Sometimes phone is not locked after "display off" immediately, so If I switch on phone after "display off", I get only "display on" trigger without "User present" trigger and phone is not locked. So "user present" can't be paired with "display off"

Re: Trigger "User absent"

Posted: 14 Jan 2019 16:53
by Desmanto
You can try to check at your lockscreen setting, change the lockscreen after timeout to immediately. But if you still want some buffer time, example 5-10 seconds; you can still do the same buffer in the Screen off flow.

Use Condition Keyguard Locked to check if the screen is off and locked. If it hasn't yet, false, go to sleep 5-10 seconds (depends on the delay), and check again using another Keyguard locked. Both true from both Keyguard Locked, turn on the battery saver. So in case, you turn on the screen before the 5-10 seconds delay, then the condition will be false, battery saver is not enabled during that period. It will wait until another cycle of screen off, triggering the flow again and only after finally confirm it is locked, then it will enable the battery saver.

The exit still the same trigger, user present, turn off battery saver.