Need help with Arm night and Sleep modes

New to HE, coming from ST, trying to duplicate an automation rule I had in ST.

I would like HE to go into sleeping mode and HSM to go into Arm Night when:

10pm
Motion in LV has been inactive for more than 1 hr
Presence indicates we are home

Obviously would need to go back to home mode and disarmed if:

5am but <10pm
Presence indicates we are home

Can I get some help building this automation?