You can’t do it with just a routine, but there are several other automation options available with SmartThings which will allow this.
See the following FAQ( this is a clickable link)