Presence sensor smartapp

This can easily be accomplished with Rule Machine. If you needs assistance setting up the logic, ask here: