Automatically Adjust Display Brightness with %LIGHT

2,653 views
Skip to first unread message

Mardon "Mardy" Navalta

unread,
Nov 1, 2010, 4:12:19 PM11/1/10
to Tasker
I've been trying to automatically adjust Display Brightness level
based on current light condition for the last three days. I've been
unsuccessful.

If anyone here has some free time (LOL) could you help me and provide
details of how to automatically adjust Display Brightness based on
current light condition. I want the adjustment be more fluid. Would I
need to add more profiles?

Here is my three profile setup:

EVENT>Variable Value %LIGHT>75
Task +Display Display Brightness level 100

EVENT>Variable Value %LIGHT>45
Task +Display Display Brightness level 50

EVENT>Variable Value %LIGHT<20
Task +Display Display Brightness level 0

HELP!!

Thank you so much

Mardy


baudi

unread,
Nov 1, 2010, 4:31:26 PM11/1/10
to Tasker
Depending on your phone, you may only have 4 different values for
%LIGHT. That's true of the DroidX, for example. Here's my profile to
do autobright. The values you see are the only ones the DroidX ever
reports, even in total darkness or a bright sunny day.

Profile: Autobright
Event: Variable Set
Enter: Autobright
A1: Display Brightness [ Level:39 Disable Safeguard:Off Ignore
Current Level:On Immediate Effect:Off ] If [ %LIGHT = 10 ]
A2: Display Brightness [ Level:60 Disable Safeguard:Off Ignore
Current Level:On Immediate Effect:Off ] If [ %LIGHT = 100 ]
A3: Display Brightness [ Level:102 Disable Safeguard:Off Ignore
Current Level:On Immediate Effect:Off ] If [ %LIGHT = 3600 ]
A4: Display Brightness [ Level:254 Disable Safeguard:On Ignore
Current Level:On Immediate Effect:Off ] If [ %LIGHT > 8600 ]

On Nov 1, 4:12 pm, "Mardon \"Mardy\" Navalta"

baudi

unread,
Nov 1, 2010, 5:01:49 PM11/1/10
to Tasker
I just realized I've got a bug. :-)

That last value should say If [ %LIGHT = 8600 ]

Here's the thread where this was all figured out, by the way.
http://groups.google.com/group/tasker/browse_thread/thread/fc425e5dbe8ebe64/4e8163a71a6238eb#4e8163a71a6238eb

Mardon "Mardy" Navalta

unread,
Nov 1, 2010, 5:18:26 PM11/1/10
to Tasker
Thanks baudi, for your assistance. I am using HTC EVO.

Unfortunately,

I did not understand:
Enter: Autobright
A1: Display Brightness...

This is what I'm seeing at EVENT: Variable Set
Variable
%

Value

Done
> > Mardy- Hide quoted text -
>
> - Show quoted text -

Mardon "Mardy" Navalta

unread,
Nov 1, 2010, 5:24:50 PM11/1/10
to Tasker
Thank you, I did read this thread prior my undertaking of setting up
the profiles. Way over my head!!! LOL

On Nov 1, 4:01 pm, baudi <dch...@gmail.com> wrote:
> I just realized I've got a bug. :-)
>
> That last value should say If [ %LIGHT = 8600 ]
>
> Here's the thread where this was all figured out, by the way.http://groups.google.com/group/tasker/browse_thread/thread/fc425e5dbe...

Mardon "Mardy" Navalta

unread,
Nov 2, 2010, 4:39:15 PM11/2/10
to Tasker
I'm not sure if these steps are required for HTC EVO. You may find
the adjustments to be more fluid.

STATE:
Profile Name: Autobright1
Light Level from 0-11
Display
Display Brightness Level 0
Done Done

Profile Name: Autobright2
Light Level from 11-20
Display
Display Brightness Level 28
Done Done


Profile Name: Autobright3
Light Level from 21-30
Display
Display Brightness Level 56
Done Done


Profile Name: Autobright4
Light Level from 31-40
Display
Display Brightness Level 84
Done Done

Profile Name: Autobright5
Light Level from 41-50
Display
Display Brightness Level 112
Done Done


Profile Name: Autobright6
Light Level from 51-60
Display
Display Brightness Level 140
Done Done

Profile Name: Autobright7
Light Level from 61-70
Display
Display Brightness Level 168
Done Done


Profile Name: Autobright8
Light Level from 71-80
Display
Display Brightness Level 196
Done Done


Profile Name: Autobright9
Light Level from 81-90
Display
Display Brightness Level 224
Done Done

Profile Name: Autobright10
Light Level from 91-100
Display
Display Brightness Level 255
Done Done

Pent

unread,
Nov 3, 2010, 6:52:54 AM11/3/10
to Tasker
Just FYI there's a bug with brightness/auto-brightness in 1.0.12.

Pent

WPWoodJr

unread,
Nov 3, 2010, 10:07:18 AM11/3/10
to Tasker
What's the bug please?

Pent

unread,
Nov 3, 2010, 10:15:18 AM11/3/10
to Tasker
> What's the bug please?

If you had any existing Brightness actions before 1.0.12, they will
not be applied straight (you need to go to them and check Immediate
Effect).

Since the Auto-Brightness action also internally uses a Brightness
action after turning off auto-brightness, that's also affected.

Pent

Mardon "Mardy" Navalta

unread,
Nov 4, 2010, 8:37:00 AM11/4/10
to Tasker
Thanks, I had enabled the Immediate Effect with the recent Tasker
1.0.12 update. I failed to mention in my post.

Pent you made my device much more enjoyable. thank you for giving us
Tasker.

Timmy

unread,
Dec 31, 2010, 1:36:37 AM12/31/10
to Tasker
Baudi-

This is exactly the post I was looking for! I also have a Droid X and
want to set up a profile for autobright. I am a new tasker and I get
lost after A1. I'm not seeing the prompts you are referencing. Could
you walk me through it a bit more.

-Tim

mwburden

unread,
Dec 31, 2010, 8:33:40 AM12/31/10
to Tasker
For those using Cyanogenmod, the Auto Brightness controls built into
Cyanogenmod (Menu -> Settings -> Cyanogenmod Settings -> User
Interface -> Automatic backlight) did a much better job for me than I
was able to do with my humble Tasker skills.

For one thing, Cyanogenmod does input averaging on the light sensor to
keep the screen from flickering. That's the part where my Tasker
profiles were starting to get complicated!

For those not running Cyanogenmod, good luck. :)

David

unread,
Jan 18, 2011, 12:21:42 PM1/18/11
to Tasker
FYI, the values for Light Level on my Droid Incredible, for now, seem
to be....

40, 90, 160, 225, 320, 640, 1280, 2600, 10240

Also, I chose the route of one profile with many Display Brightness
actions which had associated conditions in them via the IF checkbox.

mwburden

unread,
Jan 18, 2011, 12:55:13 PM1/18/11
to Tasker
Did you do anything to "smooth out" the light levels?

When I tried to control the screen brightness via Tasker, I found it
annoying that the brightness would frequently change if I moved the
phone slightly. The amount of light hitting the phone didn't change,
but the change in angle causes the value from the light sensor to
change, causing the brightness to go up and down annoyingly.

Under Cyanogenmod, the input levels are averaged over time, so the
brightness doesn't change until the light level changes and stays
changed for a few seconds.

David G

unread,
Jan 18, 2011, 3:46:39 PM1/18/11
to tas...@googlegroups.com
no, but I guess you could duplicate that averaging by making a context
that acts when a variable is changed. Then you would make that var be
the running average (which would be based on the light sensor
context).

mwburden

unread,
Jan 18, 2011, 4:50:21 PM1/18/11
to Tasker
True.... or, since I was planning to run Cyanogenmod anyway, I could
just let CM do it. :)

David G

unread,
Jan 19, 2011, 8:38:43 AM1/19/11
to tas...@googlegroups.com
I'm glad you mentioned the rapid swtiching back and forth. I had not
noticed it before because my office is so dim at work that I didn't
notice a lot of switching. But I got home and saw it in action.

I thought I would create a pseudo-array and put the most recent values
for %LIGHT in them... maybe 5 of them. Then, whatever value was the
most popular among the 5 would be the one used.

I chose that instead of a Mean Average because a mean would still change often.

I think also instead of making the array like a stack, where the most
recent one is always in the first position, I'll just have another
pointer called %LightRecentNextRecipient which will tell Tasker which
element should be overwritten next. When #5 gets overwritten with the
current %LIGHT value, that NextRecip var would be set to #1, and then
increment by one. I think that will use less code than a true stack,
and the order isn't important here.

Note that I also added another context so that my AutoBright "script"
would not be operational when the camera or video cam are being used.
There may be other apps to add to that list as well.

CheveGuerra

unread,
Feb 8, 2011, 6:43:21 PM2/8/11
to Tasker
Good afternoon,

I have a SGS i9000 with Darky's9.2 ROM, and have been trying to
implement the auto-brightness profile, but whether I create a profile
with %LIGHT as a condition (set variable) or a task with "if %LIGHT <
5000" or whatever levels my phone generates, the variable %LIGHT does
NOT get set when theres a change in the ambient light, IF I enable the
Android Auto-Brightness in settings/display/auto-brightness, the
variable %LIGHT does gets set (i made a widget that display the %light
variable), it goes down if a cover the sensor and goes up if I use a
lamp to add light to it, but if I disable Auto-Brightness, the %LIGHT
variable does not change ... shouldn't it change ALWAYS, even if the
Auto-Brightness is off?

Regards

Jose Alberto Guerra

CheveGuerra

unread,
Feb 9, 2011, 1:38:24 PM2/9/11
to Tasker
Ok, after changing the kernel for the
"voodoo.advanced.v666-20110109-08.34-update" it is working without
problems, the variable (%LIGHT) gets set properly and dinamically, I
am not sure if I previously had installed the "speedmod-kernel-k12t-
bigmem-500hz-CWM" or the kernel that comes with Darkys 9.2 ROM, I will
make some test and let you know!

On Feb 8, 5:43 pm, CheveGuerra <chevegue...@gmail.com> wrote:
> Good afternoon,
>
> I have a SGS i9000 with Darky's9.2 ROM, and have been trying to
> implement the auto-brightness profile, but whether I create a profile
> with %LIGHTas a condition (set variable) or a task with "if %LIGHT<
> 5000" or whatever levels my phone generates, the variable %LIGHTdoes
> NOT get set when theres a change in the ambientlight, IF I enable the
> Android Auto-Brightness in settings/display/auto-brightness, the
> variable %LIGHTdoes gets set (i made a widget that display the %light
> variable), it goes down if a cover the sensor and goes up if I use a
> lamp to addlightto it, but if I disable Auto-Brightness, the %LIGHT
Reply all
Reply to author
Forward
0 new messages