"Outdoors"??? Water and electricity don't work well together.
What is the application?
Type "thermostat" into ebay and you will see lots of different types. One of them may suit your application.
WARNING. Household mains electrical supply can be lethal, so don't put yourself or others at risk.
Get a qualified person to do the wiring for you.