If Mode Away AND between sunset and Sunrise

Hey all. I am pretty new to hubitat and I am a bit stuck on this.

I have a virtual switch that will run lights in a certain order and timing (At home Simulator).

What I want to do is pretty simple but I am stuck on what should be the trigger event. I want to have the virtual switch to turn on only if my mode is away AND the time is between sunset and sunrise. My issue is that if the mode is away during the day into the night, then I want the trigger to be sunset, but if I leave after sunset has happened, I want the trigger to be the mode away.

Help would be appreciated!

M

Test for mode then time between sunset and sunset + 1339 minutes?

So the following will not work because it's sunset + 24 hrs... and even if you set + 12 hrs (1220) it may not be sunrise... argh.. my bad. I don't know if you can compare times between for sunset-sunrise but if so you would use that instead. I left this in to maybe give you some ideas... :grimacing:

Untitled2

This may give you some ideas.
Downstairs hall light turns on.
Few secs later downstairs loo.
Then loo turns off then hall light.
Looks like someone is moving through the hall and using the loo.