Not if you implement the design pattern Hellis81 recommended.
Your application’s requirements are fulfilled by this classic design pattern of creating a matching set of triggers and conditions.
It was initially difficult to implement because of the inability to check light level with a State Condition and for. However that’s now resolved by using a Threshold Binary Sensor.
It’s a very efficient way of handling the case where multiple factors determine when an action ought to occur (especially when a time period is one of the constraints).
FWIW, it’s a design pattern I have used myself and recommended to others many times. Here’s an example dating back to 2021.
Just in case you are interested in the reason a state trigger allows “for” in the conditions but a numeric state trigger does not:
Automations can only use information from HA’s state machine. Or in other words, automations can only use information that HA knows about “right now” as opposed to being able to access the history database and see what happened previously.
In your case, when the automation triggers and then reaches the conditions section, it has no idea when the lux value passed 50,000 because it can’t access the history. For a state condition, it does know when the binary (threshold) sensor changed because every entity has a last_changed property which is the datetime that the state most recently changed. For a numeric sensor which might currently read 67233, the last_changed property is not useful to determine when the value crossed the 50000 threshold.
The threshold sensor brings that datetime into the state machine so that it can be accessed by a condition.
One you understand that, it becomes immediately obvious from your initial problem statement that a new entity will be required to achieve your automation goal. Then the only question is: what is the simplest way to get that datetime (of when the lux value was crossed) into the state machine?
Thanks for the explanation! That makes me think how does automation support “for xx minutes” in the trigger, not only simple number state triggers but even very complex template triggers. Does HA create some “virtual” binary state and store the value once the trigger condition is met, and keep updating until for xx period is over?
When an automation is ‘armed’ it will register a listener for each trigger. The numeric state trigger listener will listen for state changes and capture the time when the trigger criteria became true, and will then trigger the automation when the duration in the for setting is met.
The same does not happen for conditions used throughout the automation; there are no listeners registered for conditions. Hence, the data must be available in the state machine when the automation (or script) hits that point in the code.