Debug a Routine that won't reliably execute

I’m trying to figure out how to debug a routine that I have that doesn’t seem to execute despite all conditions being met. It’s a pretty simple routine and what’s also weird is that there are several other similar routines that always execute. I also don’t see any reference to routines in the IDE - just my Smart Apps and SmartLighting so I’m unsure of the best way to debug it.

It’s a pretty simple scheme to control smart shades:
Routine 1: Open shades 50% at Sunrise (executes fine all the time)
Routine 2: Close shades at Sunset (executes fine all the time)
Routine 3: Partially close the shades to 20% when the lux level is above 25000 (executes fine all the time)
Routine 4: Reopen the shades to 50% after the lux level goes below 20000 (spotty execution)

To me it makes no sense why Routine 4 seems to inconsistently function.

To provide more clarity, Routine 3 and 4 are similar in that they are time and lux based with Routine 4 also checking the shade level (so if you manually closed it completely it won’t execute). The exact config for these two routines are below.

Routine 3 (Always executes)

Routine 4 (Spotty Execution)

I’ve messed with the time range, lux levels, and the shade levels in Routine 4 but it doesn’t seem to always execute - even though the device history indicates the lux and shade levels are within the ranges during the time period.

I also can’t seem to find a way to monitor or view the Routine in the IDE…seems odd.

Anyone have some good ideas?

I would change the office sensor to a precondition, and then switch from “when all conditions ar met”, to “When any condition is met”.

So yes, I actually had also previously set the office sensor to a precondition to no avail but I don’t think I’ve changed the shade levels from “all” to “any”. Assuming for a moment that having the lux level as a precondition isn’t part of the issue, what’s your theory on what changing the shade levels from “all” to “any” will do?

If for instance set to “All”, if one of the shades is not equal to or above 15%, then it would not trigger the other two to go to the preset position. If set to “Any”, then if one is not 15% or above, it would still trigger the automation. Second thing I would do, is get rid of the time precondition, and replace it with a virtual switch. Set up an automation for the virtual switch to turn on at 11:05 AM, and set up another to turn the virtual switch to off at 2:05 PM. Reason for this is that if its below 20,000 lux when it switches over to 11:05, the automation will not run, unless it gets above 20,000 lux, and drops below in that time frame.