In smart grid, a home appliance can adjust its power consumption level according to the realtime power price obtained from communication channels. Most studies on smart grid do not consider the cost of communications which cannot be ignored in many situations. Therefore, the total cost in smart grid should be jointly optimized with the communication cost. In this paper, a probabilistic mechanism of locational margin price (LMP) is applied and a model for the stochastic evolution of the underlying load which determines the power price is proposed. Based on this framework of power price, the problem of determining when to inquire the power price is formulated as a Markov decision process and the corresponding elements, namely the action space, system state and reward function, are defined. Dynamic programming is then applied to obtain the optimal strategy. A simpler myopic approach is proposed by comparing the cost of communications and the penalty incurred by using the old value of power price. Numerical results show the significant performance gain of the optimal strategy of price inquiry, as well as the near-optimality of the myopic approach.