Trigger at fixed time except if after sunrise (node-red)

I am trying to create a light-flow in node-red where lights turn on at a specific time except if after the sunrise (which happens a couple of months of the year)

So far the only solution I have found is to use the inject-node for the fixed time and then check if the state of the entity sun.sun is below_horizon.

And while this works it feels like a hack.

Are there any other ways to check this that are more… nice?

If it works, how is it a hack?