Sensor check in specific modes or at specific time

James generally has you pointed in the right direction, but I think the trigger and condition would be swapped based on your specific example.

The trigger would be the mode changing to asleep.

Then you could setup an IF condition for the garage being open and as James showed in his screenshot, optionally restrict it to night time only.

And here’s some good info on triggers and conditions: