A smart grid (SG) has attracted great attention due to recent environmental problems. SG technologies enable users, such as energy system operators and consumers, to reduce energy consumption and the emission of greenhouse gases, by changing energy infrastructure more efficiently. As a part of the SG, home energy management system (HEMS) has become increasingly important, because energy consumption of a residential sector accounts for a significant amount of total energy consumption. However, a conventional HEMS has some architectural limitations on scalability, reusability, and interoperability. Furthermore, the cost of implementation of a HEMS is very expensive, which leads to the disturbance of the spread of a HEMS. Therefore, this paper proposes an Internet of Things- (IoT-) based HEMS with lightweight photovoltaic (PV) system over dynamic home area networks (DHANs), which enables the construction of a HEMS to be more scalable, reusable, and interoperable. We suggest the techniques for reducing the cost of the HEMS with various perspectives on system, network, and middleware architecture. We designed and implemented the proposed HEMS and conducted a experiment to verify the performance of the proposed system.