Can an automation check two things before it runs?
Yes. Add as many device conditions as you need, plus who's home and the time of day. Each condition reads as a sentence, so you can check it at a glance.
In the app: Automations › +. Device conditions are Pro; time and people conditions are Free.