AndroidApps

Create a time of day-dependent outdoor auto-brightness profile in Tasker

tasker time of day - for some reason we don't have an alt tag hereThis time of year is dark, at least in my part of the world. The sun heads out the door at about 15:00, making it seem like it’s the middle of the night by the time a lot of people finish work. My Outside Tasker profile therefore needed an upgrade to handle this time of year, allowing it to intelligently set the brightness depending on whether or not it’s dark outside or not, rather than just blasting it up to max like it did during the summer months.

I didn’t make much out of it this time, going for a simple manually changed time-based solution. My Outside profile now has the section you see in the screenshot, where it checks to see if %TIME is above a certain value (15 in my case) and act accordingly. If it is, it’s dark outside, and it sets the brightness to about 40%. If it’s not, it sets it to max. Since the Outside profile only triggers when I’m outside, other scenarios aren’t part of this specific task.

You can however make much more out of this than I did. Perhaps the most natural thing to do would be to create a profile that checks sunset/sunrise data online, and act accordingly. That is quite simple to do using standard variable data processing techniques.  I’ll probably do that too soon, as the current system needs to be manually changed as the sunset time changes. All you really need to do is get sunset data, and do an if condition to see if %TIME is larger- assuming you use 24 hour format for time, AM/PM is more complicated. You could also make it weather-dependent, setting the brightness lower on a cloudy day, or you could make it more dynamic, using different brightness values depending on how long it’s been since the sun set.

I don’t know if it’s just me, but the automatic brightness on all my devices is very far off from what I would consider decent brightness in any given situation. As such, I prefer to handle it myself using Tasker.

Pocketables does not accept targeted advertising, phony guest posts, paid reviews, etc. Help us keep this way with support on Patreon!
Become a patron at Patreon!

Andreas Ødegård

Andreas Ødegård is more interested in aftermarket (and user created) software and hardware than chasing the latest gadgets. His day job as a teacher keeps him interested in education tech and takes up most of his time.

Avatar of Andreas Ødegård

6 thoughts on “Create a time of day-dependent outdoor auto-brightness profile in Tasker

  • Avatar of David

    Although this is a good article, I feel it needs to be mentioned that tasker can read the ambient light level and adjust the brightness based on that value. This is preferrable to a time-based setup, and changes based on whether you may walk into bright sunlight or a dimly lit room. Going from room to room means different lighting conditions, and therefore, different brightness levels can be set, regardless of location or time.

    Reply
  • Avatar of Patrick Harris

    Thanks for your fantastic series on tasker! If I grabbed sunrise/sunset times each day, what would be the best way of using these in a context? The normal time context won’t accept variables. Some people add sunrise/sunset to a google calendar, but that seems overly involved. Context won’t allow ‘if’, only ‘and’, but I could have contexts “%time !> sunrise & %time !< sunset" but this won't work for after midnight. I could say "if time is greater than sunrise" and count seconds to the sunset, with an appropriate cool down period before the context can fire again I guess. Am I missing something obvious, or is this kind of thing always a little tricky in tasker?

    Reply
    • Avatar of Andreas Ødegård

      Unfortunately I think a calendar system would be the best option. It sounds excessive, but you can make a dedicated calendar for it, hide it from view in your other calendar apps, and even populate it automatically with Tasker’s calendar entry option.

      Reply
  • Avatar of Patrick Harris

    Okay – I’ll try that. Thanks for the info – always good to learn ‘best practice’ from a tasker legend!

    Reply
    • Avatar of Andreas Ødegård

      I wouldn’t take my suggestions as the automatic best practice, I have after all used Tasker for a lot less time than most (coming up on a year). I’m not aware of any better workarounds for the lack of variables in time contexts though, the only other option I’ve used would involve checking the sunrise time in the middle of the night and then use a Wait, but that’s not really ideal.

      Reply
      • Avatar of Patrick Harris

        Well, if not best, then hopefully not worst. And if worst, it’s at least nice to have company.

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *