You are replying to a thread which is three years old. A lot has changed in that time.
Two years ago, using the V2 app (now called the “classic” app) the answer would have been that this functionality was added to routines. So you just create a routine triggered by the switch.
Now, however, things are very different in the V3 app (called “SmartThings ( Samsung connect)“).
Although both the V2 app and the V3 app have a feature called “smart home monitor” they are in fact completely different code with different features.
And in the V3 app, Smartthings has changed their design philosophy on security features, and there is no longer any way to automate arming or disarming smart home monitor except manually opening the app and doing it there, or by time of day.