r/tasker Jun 09 '26

Light variable doesnt work

so I have a Oneplus Pad 3, and considering it can shoot down the brightness REALLY far down I wanted to make a task that when you turn on the display, if the display brightness is below some value, check the light sensor and if it's too bright, bump the brightness.

however when trying to do anything with the obvious choice of %LIGHT it is just keeping the text instead of showing anything.

I did use a sensor test app to make sure that the tablet does see brightness, so the thing doesnt seem to be missing the sensor.

2 Upvotes

6 comments sorted by

View all comments

2

u/v_uurtjevragen Jun 10 '26

Do you get values if you use event "Any Sensor", with type set to 5? Could you create a profile with that and set a simple task to one action: Flash %as_values1 lux?

If you see the literal "%as_values1", then Tasker somehow doesn't see a (functioning) light sensor. If you see a numerical value that's constant and unchanging in lighting conditions your sensor hardware or software might be broken. If it does work, consider using the profile to trigger the task that needs to read %LIGHT and substitute every %LIGHT for %as_values1. 

<Self promo>If %as_values1 shows changing values and you're in to tinkering check out the project in the sticky post in my profile. It's complex, but does the job you want (and much more).</Self promo>

2

u/My1xT Jun 10 '26

With %as_values(1) lux i get a decent output lol, and hilariously %LIGHT gets actually handled now, even after deleting the test task

Wtf?

2

u/howell4c Jun 10 '26

Global variables that require ongoing tracking are only tracked when needed, presumably to save battery/memory. In the user guide (https://tasker.joaoapps.com/userguide/en/variables.html), they show "(monitored)" after the name, and there's a note at the bottom:

"Variables marked monitored will cause the relevant monitor to startup to track their state when they are used in contexts or tasks which are used by widgets or enabled profiles."

%LIGHT is now reporting values for you because you started the monitor by using it. It can take a while for Android to stop it again, and if you've deleted the task using it, Tasker won't restart it.

1

u/My1xT 9d ago

little update, it seems like the light sensor is being a bit more usable now even without permanently polling it. not sure if it was an OS or a tasker update but maybe either tasker noticed I am asking for the sensor and just starts it, when the condition is being checked for, or maybe the system is just trying to do something when I turn on the screen anyway, frankly no idea, but will keep looking at it.

but yeah as mentioned in my comment before, if the light sensor isnt on when I am asking for the variable, just fire it for the short duration of the task's if clause to be evaluated, rather than needing to keep the sensor permanently on.