Below is a code snippet for my system. Reads temperatures using a DS1621. Stores high and low temperatures. A RTC clock alarms once per day (on digital pin 2) and fires up a Telit GSM modem and SMSes out the high and low temperature, resets the RTC alarm, and then shuts down the GSM modem. You could easily test for high and low temps and turn on relays, etc...
digitalWrite(13, HIGH); // sets the LED on
digitalWrite(4, HIGH); //pulse turn-on for GSM modem
delay(2000); //must be held high minimum of 1 second per Telit spec; we'll do 2
digitalWrite(13, LOW); //set LED off
delay(20000); // allow GSM modem to get on the air
Serial.println("AT+CMGS=cell phone number here,129");
Serial.print("High Temp = "); Serial.print(hightemp, DEC);
Serial.print(" Low Temp = "); Serial.print(lowtemp, DEC);
Serial.print("AT#SHDN"); // shutdown GSM modem
hightemp = 0;
lowtemp = 100;
I have not written code yet to read and parse an in-coming SMS message to take action. In GSM text mode, that should not be too hard.