Residential Heating, Ventilation, and Air Conditioning (HVAC) systems can play significant role in the future smart grids in order to balance demand and supply patterns as they are the main electrical load during peak load periods. Programmable thermostats and programmable communicating thermostats are widely used for automatic control of residential HVAC systems with the aim of energy management and providing thermal comfort while users set their daily/weekly schedules and preferences. On the other hand, the programs such as Time-of-Use (TOU) rates, Real-time Pricing (RTP), and Demand Response (DR) are often applied by utilities in order to encourage users to reduce their consumption during peak load periods. However, it is often an inconvenience for residential users to manually modify their schedules and preferences based on the electricity prices that vary over time. Hence, in this paper an autonomous thermostat capable of responding to different parameters such as time-varying prices, while saving energy and maintaining user's thermal comfort is presented. The developed thermostat is the result of integration of fuzzy logic, wireless sensors, and smart grid initiatives. To implement and validate the approach; a house simulator that represents a smart thermostat is developed in Matlab-GUI. The simulation results demonstrate the overall improvement with respect to energy saving and conservation without jeopardizing occupant's thermal comfort.