[OnePlus 5 Guides, News, & Discussion] J0kker:
Hello guys, i'm no tasker expert, but i'll try to share my setup in order to turn off automatically notification (pulse) led, charging led and new notification wake up screen (under ambiant display) using tasker.

Requirements:

OOS (most custom roms have these things natively, and commands may differ from rom to rom)

Root

tasker

If you're new to tasker and need more step by step guide to create a task, there are plenty of tutorials and videos for that :good:.

First thing to understand is that there are multiple commands, you can choose to merge all the ones to disable lights into one task, and all the ones to enable lights back into another task, that's the easier way, but you can choose to make individual tasks that will be called one by one in another "main task", that's up to you, but the second choice will ask some extra work.

All the tasks will be created the same way, so i'll just help you with the first, then simply redo the things with the other commands.

Let's start with charging led, I named it LightsOff but you can name any task like you want.

Go to thet tasks tab, hit the "+" in the lower right, then name your task (LightsOff ?), then hit again the "+", type shell in the search field and select the "run shell", then, you'll need to type the different commands to be ran, one by line, so it meens after each command, hit "enter"

Once you're done, don't forget to tick the root checkbox.

For example, to turn the charging led Off you'll need the following commands:

settings put system battery_light_full_color 00
settings put system battery_light_medium_color 00
settings put system battery_light_low_color 00

There are other commands to turn it off, but for some reason, turn it back on will require a reboot, so to avoid that, i simply changed the colors to black, so it's not really turned off, but black (which is, for us, exactly the same).

You'll find all the commands at the end of the post, if you want to merge all commands (recommanded) into one task, go there and just add them to the task before saving it.

Save the task.

Now let's make the task that will get your charging led back to normal (or whatever suits you).

It's almost a copy and paste as the only changes are the name of the task (LightsOn ?) and the values for the colors.

Commands to type:

settings put system battery_light_full_color 16711936
settings put system battery_light_medium_color 16842752
settings put system battery_light_low_color 16842752

Save the task (root ticked obviously).

These are the default values, you can try other values if you like, that's what i've done, i like dimmed lights for charging, so mines are

settings put system battery_light_full_color 4096
settings put system battery_light_medium_color 8126464
settings put system battery_light_low_color 8126464

Before you ask, i could not find how find the correct number for a wanted color, i just tried many and wrote down ones i could keep, if you have an idea let's share it :)

So, now, here are the other commands that you can choose to merge to the first task or just create more tasks for each.

Wake up screen on new notification (you can find it under the ambiant display menu)

Warning: not same command as before, this setting is stored in the secure settings, not the system settings

Disable:

settings put secure notification_wake_enabled 0

Enable:

settings put secure notification_wake_enabled 1

And for the pulsing notification light.

Disable:

settings put system notification_light_pulse 0

Enable:

settings put system notification_light_pulse 1

You can merge all the commands in one single task for enable and another for disable if you want, that will be easier to setup.

Now all you have to do is create a new profile for night based on time of the day that will trigger the lights off.

Go to profiles tab, hit the "+" then "time" and choose the hours that suits you.

then select the task you want to run (the one that will turn off everything), after that, long click on the selected tak and select "add exit task"

then select the task that will turn all back on.

If you merged all the commands you're done, if not, you'll need to crete two tasks that will group the different tasks you want, i don't thinks it's worth the extra work but for knowledge purpose here's what you have to do.

Go to Tasks Tab, hit "+", give a name, hit "+" type "perform" in the search field and then select "perform task", hit the magnifying glass (the search icon, sorry english isn't my native language) then select the task you want, repeat this for each task you want to add to the "main" task.

Do the same for the "exiting" task.

This way is better as you can add extra tasks like going to airplane mode or mute sounds or whatever you want, but i i told before, it's much more work.

Hope this will help some stock (or xXx :good:) users, if you have questions, i'll try to answer, but as i said earlier, i'm really no expert with tasker, but if i could manage to do it, you too !

Have a nice day XDA !