Goodbye and Hello Routines

Ok, so first, you’ll need to create a virtual switch. You can find some info on that here:

Then you’ll need to create a SmartApp that has a switch and a thermostat as an input. Subscribe to the switch and when it is turned off, you’ll want to call the off() method on your thermostat, and when it is turned on, you’ll want to call the auto() method. Here is a good place for getting started with SmartApps:

http://docs.smartthings.com/en/latest/smartapp-developers-guide/index.html

If you prefer to learn from examples, you can look at this SmartApp which also subscribes to a switch and takes some actions: