Smart Home Monitor - Serious Bug

With webCoRE you could control the execution order of turning off all the lights, then locking the doors, and running all the tasks you need to perform before actually arming the SHM to Armed (Away) and setting the Mode to Away as well. They would prevent whatever the order of the Routine is performing everything in.

If you don’t want to move over to the wonderful world of webCoRE and the power that has to offer, then you could use the community developed SmartApp: