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


  1. SUroot

    SUroot Well-Known Member Developer

    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

    [​IMG]

    • Add (+) Profile, name "GetLight"

    Context
    • Select Event > Display > Display on

    Task

    [​IMG]

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

    Profile 2: DisplayOn

    Profile

    [​IMG]

    • Add (+) Profile, name "DisplayOn"

    Context

    [​IMG]

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

    Task

    [​IMG]

    • 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

    [​IMG]

    • Add (+) Profile, name "DisplayOff"

    Context
    • Select Event > Display> Display Off

    Task

    [​IMG]

    • 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"

    [​IMG]

    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....

    [​IMG]

    Attached Files:


    Advertisement
    :
  2. bberryhill0

    bberryhill0 Well-Known Member

    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?
  3. bberryhill0

    bberryhill0 Well-Known Member

    Maybe in a new post instead of editing:

    Attached Files:

  4. SUroot

    SUroot Well-Known Member Developer

    The only orange triangle I can see is the symbol for event


    Can I have screenshots within the tasks please?
  5. bberryhill0

    bberryhill0 Well-Known Member

    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?
  6. SUroot

    SUroot Well-Known Member Developer

    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.
    bberryhill0 likes this.
  7. mrhomiec

    mrhomiec Well-Known Member

    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.
  8. bruce73

    bruce73 Well-Known Member

    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?
  9. bberryhill0

    bberryhill0 Well-Known Member

    It only checks the light sensor when the display comes on.
  10. SUroot

    SUroot Well-Known Member Developer

    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.
  11. bberryhill0

    bberryhill0 Well-Known Member

    My Incredible 2 is too slow to handle Tasker. I can see the brightness change through the three levels when I'm outside.
  12. mrhomiec

    mrhomiec Well-Known Member

    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.
  13. SUroot

    SUroot Well-Known Member Developer

    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.
    mrhomiec likes this.
  14. SUroot

    SUroot Well-Known Member Developer

    [*]+ Tasker > Profile Status > Name "GetLight", Set "Off"

    Added to end of DisplayOn to double disable GetLight
    bruce73 and bberryhill0 like this.
  15. SUroot

    SUroot Well-Known Member Developer

    I've attached exported xml profiles in post 1.
  16. bruce73

    bruce73 Well-Known Member

    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)?
  17. SUroot

    SUroot Well-Known Member Developer

    Because I've made a mistake....


    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.


    Maybe it is a limitation of your phone.
  18. mrhomiec

    mrhomiec Well-Known Member

    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.
  19. bberryhill0

    bberryhill0 Well-Known Member

    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.
  20. bruce73

    bruce73 Well-Known Member

    Same here.
  21. SUroot

    SUroot Well-Known Member Developer

    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.
  22. SUroot

    SUroot Well-Known Member Developer

    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...

    Attached Files:

    mrhomiec likes this.
  23. bruce73

    bruce73 Well-Known Member

    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%.
  24. SUroot

    SUroot Well-Known Member Developer

    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
  25. bruce73

    bruce73 Well-Known Member

    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.
Loading...

Share This Page