• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[Profile] [Light Sensor] V2 - Brightness adjust on Screen on

SUroot

Extreme Android User
This is a mid-level complexity profile to set the screen brightness higher if its bright outside.

This profile is for those who don't use Auto-brightness (which we know uses power whilst constantly polling the light sensor).

Thanks to Davoid for the inspiration / base and to guys on google groups helping me iron out issues with the light sensor.


NB. These are my values, set up for my preference. Please experiment with your own ;)

V2:

This consists of 3 profiles.

I have exported them and attached them as a zip.


The two .xml files inside need to go to /sdcard/tasker/profiles/ to import them.

To import, long press on the "Profiles" tab. I haven't tested these.


Profile 1: GetLight

Profile

GetLight_pro.png


  • Add (+) Profile, name "GetLight"

Context
  • Select Event > Display > Display on

Task

GetLight_tas.png


  • New Task
  • + Variable > Variable Set >Name "%LightValue", To "%LIGHT"
  • + Tasker > Profile Status > Name "GetLight", Set "Off"

Profile 2: DisplayOn

Profile

DisplayOn_pro.png


  • Add (+) Profile, name "DisplayOn"

Context

DisplayOn_Con.png


  • Select Event > Variable > Variable set > "%LightValue"

Task

DisplayOn_Tas.png


  • New Task
  • + Display > Display Brightness > Level (0), IF "%LightValue" < "500"
  • + Display > Display Brightness > Level (75), IF "%LightValue" > "500"
  • + Display > Display Brightness > Level (120), IF "%LightValue" > "1500"
  • + Display > Display Brightness > Level (190), IF "%LightValue" > "3000"
  • + Display > Display Brightness > Level (120), IF "%LightValue" > "4000"
  • + Tasker > Profile Status > Name "GetLight", Set "Off"


Profile 3: DisplayOff

Profile

DisplayOff_Pro.png


  • Add (+) Profile, name "DisplayOff"

Context
  • Select Event > Display> Display Off

Task

DisplayOff_Tas.png


  • New Task
  • + Tasker > Profile Status > Name "GetLight", Set "Off"



V1:
This consists of 2 profiles.

I have exported them and attached them as a zip.


The two .xml files inside need to go to /sdcard/tasker/profiles/ to import them.

To import, long press on the "Profiles" tab. I haven't tested these.

Profile 1: GetLight

Profile

  • Add (+) Profile, name "GetLight"

Context
  • Select Event > Variable > Variable Set > Variable "%WantLight", Value "1"

Task
  • New Task
  • + Variable > Variable Set >Name "%LightValue", To "%LIGHT"
  • + Tasker > Profile Status > Name "GetLight", Set "Off"

Screenshot_2012-09-11-20-54-28.png


Profile 2: DisplayOn

Profile

  • Add (+) Profile, name "DisplayOn"

Context
  • Select Event > Display > Display On

Task
  • New Task
  • + Tasker > Profile Status > name "GetLight", Set "On"
  • + Variable > Variable Set > name "%WantLight", To "1"
  • + Task > Wait > (1 MS) Until "%LightValue" Is Set
  • + Display > Display Brightness > Level (100), IF "%LightValue" > "1000"
  • + Display > Display Brightness > Level (180), IF "%LightValue" > "2000"
  • + Display > Display Brightness > Level (255), IF "%LightValue" > "3000"
  • + Variable > variable Set > name "%WantLight%, To "0"
  • + Tasker > Profile Status > Name "GetLight", Set "On"

You can add a few values and IF's here. This example has 3. Just ensure you start with the lower values and build up. Don't add too many though.

I am aware there is a "Wait Until" task that probably makes more sense than the "Wait" with 1MS. Truth is I hadn't noticed it until writing this up. I'm sure it works but I haven't tested it so....

Screenshot_2012-09-11-21-03-42.png
 

Attachments

Awesome. Auto-brightness has always driven me nuts but forgetting to change the brightness before going outside is annoying too. Great solution.

* I'm not getting it to run. Why do I have orange triangles next to the names?
 
The only orange triangle I can see is the symbol for event


Can I have screenshots within the tasks please?
 
Ah. The ! in the triangle had me worried. I'll check in the morning to see if it works in sunlight.

Should the set %LightValue to %Light be %LIGHT?

* Is changing the profile status necessary to get GetLight to notice the variable %WantLight change?
 
Ah. The ! in the triangle had me worried. I'll check in the morning to see if it works in sunlight.

Should the set %LightValue to %Light be %LIGHT?

* Is changing the profile status necessary to get GetLight to notice the variable %WantLight change?

Sorry %LIGHT is correct. Edited

Yes, we want GetLight off so it's not getting light from sensor constantly. We turn it on for a moment when we want light.
 
I can't get this to work, and everything matches perfectly.

I turned off Auto Brightness, turned it up high, and covered the sensors. But nothing changed.
 
Sorry %LIGHT is correct. Edited

Yes, we want GetLight off so it's not getting light from sensor constantly. We turn it on for a moment when we want light.

I'm a little confused about this. It seems to work (when I'm in the house brightness is at 39%, and outside in the shade it's at 71%), but, after it's set, when I look at the profiles in Tasker, GetLight is active. According to what you said, shouldn't it be inactive?
 
I'm a little confused about this. It seems to work (when I'm in the house brightness is at 39%, and outside in the shade it's at 71%), but, after it's set, when I look at the profiles in Tasker, GetLight is active. According to what you said, shouldn't it be inactive?

I've noticed a glitch where getlight wasn't deactivated. I manually deactivated and then tested. It was fine after that. I'll do some testing to see if I can tidy it up or something.
 
i tried testing that too. i set the display to max brightness. turned off screen. covered up the sensor and unlocked. the screen was still at max brightness.

Well thats wrong on both accounts. It doesn't turn the brightness down if its dark. It turns the brightness up if its light.

You could add a "less than" if you wanted.
 
Thx for the files, but it still ill doesn't work properly for me. Why is brightness @ 180 listed twice in the WantLightOn task? Also, even with setting brightness to 0 (why would I want to do this anyway), my display only goes down to 8%? Is that a limitation of my phone (HTC Vivid on ICS)?
 
Why is brightness @ 180 listed twice in the WantLightOn task?

Because I've made a mistake....


with setting brightness to 0 (why would I want to do this anyway)

Why wouldn't you want the brightness as 0 (lowest setting) in a dark room? Its not like you need brightness to overcome the abundance the light in the room.


my display only goes down to 8%? Is that a limitation of my phone (HTC Vivid on ICS)?

Maybe it is a limitation of your phone.
 
Well thats wrong on both accounts. It doesn't turn the brightness down if its dark. It turns the brightness up if its light.

You could add a "less than" if you wanted.

I have no idea what's going on then.

I have my brightness set to the lowest. When it's under direct sunlight, it doesn't change when I turn in the screen.
 
I left Tasker open on the variables tab then locked and unlocked my phone. You can see the variables change if they're going to. It didn't work very often for me.
 
I'm finding at the moment I have to turn my screen on then off then on often for it to work at the moment. Its like it only works 50% of the time.

Other times, it wont work until I touch my status bar (Wonder if this is because I have a brightness slider in the Notification area?)

May have to rethink it.
 
Think I have a solution. Seems to be working for me so far.... Variable updates at every screen on.

3x profiles.

1) GetLight
Event Display On
Task %LightValue To %LIGHT

2) Display On
Event Variable Set %LightValue
Task Display Brightness whatever if Greater than whatever
Task tasker Profile Status GetLight Off

3) Display Off
Event Display Off
Task Tasker Profile Status GetLight On*

* GetLight will continue to Poll %LIGHT if the display is on and The GetLight Profile is On so we turn off the Profile. We turn it on When the Display is off as it Does not Poll %LIGHT until the display is turned back on...

Will upload test Profiles in a bit...
 

Attachments

Still not working properly for me. I went outside, turned the display on, and it popped up to 75%. But when I came back in and turned the display on in a darkened room, it didn't change from 75%.
 
Did the variable change? If so, to what? There's no less than in the test profile so you'll only see a drop if its below the step its on and above the lowest step.

Lets keep it simple and confirm it goes up properly
 
That was it. The variable was changing, but the ambient light in my apartment is only around 200. So I brought down the first value to 150 (@75 brightness) and it works. Cool. Thanks.
 
Back
Top Bottom