Rooftop solar panels paired with home‐scale batteries are increasingly popular in the residential area and they bring a fantastic opportunity to households, considered as prosumers, to make benefits from trading electricity. Unlike research in the literature, we consider the trading with technical influences of utility requirements: Volt‐Watt and Volt‐Var functions. As possible active power curtailments may occur and lead to economic losses to households, our work reveals how a home energy management system (HEMS) maximizes profit from trading energy with an aggregator and an electricity retailer. Appropriate optimization problems are formulated with technical constraints, these functions, and home appliances. HEMS responses are optimized in two phases. The first phase is for planning an optimal day‐ahead energy commitment to the aggregator with a consideration of the predicted power curtailments. On the day of operation, the second phase tries to follow the commitment by reoptimizing the responses in the real condition. Simulation of a practical power system shows that addressing these functions can mitigate power curtailment, reduce economic loss, and improve home profits. © 2020 Institute of Electrical Engineers of Japan. Published by John Wiley & Sons, Inc.