One major objective in smart grids is to improve the system efficiency by reducing the peak-to-average ratio (PAR) of the power consumption, i.e., to balance the supply and demand in the power system. In this paper, we propose to control the power adjustable appliances to reduce PAR in residential buildings. By considering the indoor temperature control appliances, whose operating power is continuously adjustable, we formulate the power management problem as a convex optimization problem to minimize the electricity cost under a comfortable temperature range. An optimal algorithm is developed, which can reduce the cost by about 25% and the PAR by about 63% given non-causal prior knowledge of the power consumption profile of the unadjustable appliances. A practical sub-optimal algorithm that requires only causal knowledge is also developed, which can reduce the cost by about 10% and the PAR by about 28%.