Real-time electricity prices and customer demands are inextricably linked in the smart grid environment. For the purpose of reducing grid load peaks, enhancing grid security, and optimizing customers’ electricity bills, it is critical to model dynamic real-time electricity prices and flexible customer requests, along with providing an optimized plan to guide users’ decisions regarding the use of household appliances and quantify their needs. The solution to this problem, however, is not straightforward due to the following factors. Firstly, the real-time electricity price is constantly changing, so it must be estimated from grid data associated with it. Furthermore, there are often some variations in the actual power consumption of appliances due to the uncertainty of human behavior, the characteristics of appliances, and the influence of the environment. In addition, when optimizing, serious problems such as tripping and circuit overload must be taken into account. Therefore, considering random electricity prices and random electricity consumption, in the paper, we present the models to simulate real-time changes in electricity prices and energy consumption behaviors, as well as a method to help users optimize their use of household appliances and quantify their requirements with lower electricity cost. By analyzing the experimental results, we demonstrate that our work can be used to provide a scheduling scheme for appliances that minimizes electricity costs and reduces grid pressure.