Help making a simple trigger - Newbee. (Range determined by sunset to a set time)

After putting ST back in its box a year ago, I’m now having another bash at it.
I am trying to set a trigger to turn on my outside lights if the gate is opened between 11pm and sunset. The Smart Lighting App is not flexible enough to allow this. Or perhaps i’m thinking it around the wrong way.

Using the official features, you could do this quite easily by changing the mode at 11 PM. At our house we have one mode for the evening, called “night” and another mode for after I’ve gone to bed, called “asleep.” (When you add a new mode you can call it whatever you want.)

So there is a motion sensor in the bedroom. During the day, nothing happens if it triggers.

At sunset, the mode automatically changes to “night” using a routine.

When the mode is night, if the motion sensor is triggered then the overhead light comes on.

When I go to bed, I manually run a routine that changes the mode to asleep,

Then when the mode is asleep, if the motion sensor is triggered, then the overhead light does not come on – – instead, soft night light on the wall comes on.

At seven every morning, a routine runs that changes the mode to “home” again.

So you could do something similar to separate evening from late night if you want, and then have the motion sensor only turn on the outside light if it is evening.

Otherwise, if you want to mix “sunset” with a fixed hour time as a range, you would probably have to use core.