Disarm HSM after a set time once activated

Is there a way to disarm HSM after a set time once it has been activated, and then re arm HSM.
I would like HSM to stop sending alerts, and be disarmed after a set time once it has been activated. and then after a delayed time after that to re arm HSM. Looking for a rule to do this when I am away from Home.

T.I.A.

I would use Rule Machine to do this.

Use Required Expression: You are present

Trigger: HSM Armed Away

Actions:
Wait duration X hours/minutes
Disarm HSM
Cancel all alerts
Wait duration X hours/minutes
HSM Armed Away

—> Note that the last action will re-trigger this app. To avoid this:
Add Rule Boolean to be true as a Required Expression

Add as the first action: Set Rule Boolean to False
Add after the last action: Set Rule Boolean to True -> Delay 5 minutes

Thanks for help, tried the boolean and yes it works but only once which is not what I ideally wanted. Played around with timers etc and eventually got what I was after. Thank you v much for info tho it will come in v handy in the future