• 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
May 25, 2010
23,907
5,306
Riddlesden, West Yorkshire, UK
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

  • profiles.zip
    1.6 KB · Views: 968
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.
 
  • Like
Reactions: bberryhill0
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0
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.
 
  • Like
Reactions: mrhomiec
Upvote 0
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.
 
Upvote 0
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

  • profiles.zip
    1.5 KB · Views: 345
  • Like
Reactions: mrhomiec
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones