Use anything which does trigger on temperature to turn on a virtual switch. Then have that virtual switch coming on start the routine that changes the mode. Or just use webcore and you won’t need the virtual switch.
How to Get Started Creating Complex Rules in SmartThings (2017) (SmartThings Classic)