[Google Pixel 3 Questions & Answers] emale999:
Oh yes, this ambient display really is very stupid!

Attached you find my tasker profiles to enable and disable ambient display automatically. I'm also going to describe how to set up this profiles manually.

Prerequisites

- Tasker

- Tasker-Plugin Auto Notification or Notification Listener (I'm using Auto Notification, but you could also fit your profile to use Notification Listener)

- I presume `Settings > Display > Lockscreen Display > New Notifications` should be enabled. Please enable it if AOD doesn't wake up on new notifications

- Auto Notification / Notification Listener should have access to notifications!

- Tasker shouldn't be suspended by Androids battery saver logic

Disclaimer

- If you are going to import the attached profiles please be aware that they are only set to trigger on WhatsApp and Aquamail messages!

Maybe you will have to change that if your are using other messenger applications. Read the following notes to find out how.

- It seemed that just enabling AOD via Tasker isn't enough. Something shoud trigger the display so that it's activated. So I activated the option `Settings > Display > Lockscreen Display > New Notifications`

- Same on disabling: When AOD is active and tasker disables the setting in background, AOD stays active. So I'll wake the whole display for a short time in my profile. After this it will go to sleep (without AOD). This is only a problem if you dismiss the notifications from another device

- I'm used to have an Android system in german language. So sorry for the screenshots and maybe not all menu names will be correct.

Alternatives

Pixel Pulse could also do a great job but didn't work for me. It activates and de-activates the AOD display in intervalls if there are notifications.

AC Display looks like something we all want...but also doesn't work for me

Set it up!

Task #1 - AOD on

Enables AOD if not enabled.

Determine if AOD is already active

Add a custom setting

- type secure

- name doze_always_on

- read setting to %aod_an

[IMG="Img 1"]http://www.apfel-z.net/bilder/0312/tasks-aod-an-2.png[/IMG] [IMG="Img 2"]http://www.apfel-z.net/bilder/0312/tasks-aod-an-3.png[/IMG]

Enable if not already enabled

Add "If" statement

- %aod_an gl 0 (if AOD not already active)

Add custom setting (again)

- type secure

- name doze_always_on

- set value to 1

Add Endif

Should now look like this:

Task #1 - AOD off

Disable AOD if enabled and no notifications (of prefered apps).

Check notifications

Add Plugin "AutoNotification" and "Query"

Edit configuration, set "Persistency Type: Non-Persistent only" and choose your "Notification Apps:" - all apps where AOD should be active (WhatsApp and Aquamail in my case - I don't want AOD enabled because of Google Play notifications or something else)

Determine if AOD is already active

Add a custom setting

- type secure

- name doze_always_on

- read setting to %aod_an

[IMG="Img 1"]http://www.apfel-z.net/bilder/0312/tasks-aod-an-2.png[/IMG] [IMG="Img 2"]http://www.apfel-z.net/bilder/0312/tasks-aod-an-3.png[/IMG]

Disable if enabled and no noteworthy notifications

Add "If" statement

- %aod_an gl 1 and %annumber(#) gl 0 (if AOD active and no notifications from the apps chosen beforehand)

(You should use %nlqkey(#) instead of %annumber(#) if you are using Notification Listener instead of Auto Notification)

Add custom setting

- type secure

- name doze_always_on

- set value to 0

Unfortunately the display stays in AOD mode when changing this setting doze_always_on to 0 and doesn't go off (maybe you discarded the notification from another device). So I decided to wake the screen completely.

Thats unlovely...maybe someone has a better idea:

Add "If" statement (only wake the display when it's not already awake...that's the case when you discarded the notification from another device)

- %SCREEN gl off

Add "activate screen" and set block time to a minimum

Add "wait" for 130ms

Add "turn off screen" - Unfortunately this doesn't lead to my idea that the screen turns off after 130ms :(

Add "End if"

This action should now look like this:

Now the profiles...

Profile #1 - AOD on

Event "Notification"

Choose all apps which should trigger our profile. WhatsApp and Aquamail in my case. Maybe you have other messengers ;)

And now choose our task "AOD on"

Profile #2 - AOD off

Event "Notification removed". Applications don't matter. This job does our AutoNotification plugin in the AOD off task

Choose our task "AOD off"

System stuff

Make sure that...

1. Tasker is not battery optimized: Settings > Apps > Show all > Tasker > Advanced > Battery

2. Auto Notification and Tasker have access to notifications: Settings > Apps & Notifications > Advanced > Special App-Access > Notification accsss

Goog luck! ;)