# Development of a Low-Cost Automated Demand Response Controller for Home Energy Management
## 2 Materials and Methods
### OpenADR  
Open Automated Demand Response (OpenADR) provides an open, interoperable information exchange model and emerging Smart Grid standard to a dispatcher to continuously broadcast a DR signal to a customer, offering the customer constant visibility to wholesale prices and helping balance supply with demand better. The OpenADR 2.0 protocol communicates a DR event over an IP-based network, similar to the Internet. Following the idea of the OASIS Energy Interoperation Standard, nodes in the network architecture of OpenADR 2.0 are divided into two groups. Nodes in the first group (upstream nodes, e.g., utilities) announce and transmit relevant event information to other nodes. Nodes in the second group (downstream nodes, e.g., end users) receive and respond to the information. Upstream nodes are called Virtual Top Nodes (VTNs), and downstream nodes are Virtual End Nodes (VENs). Figure 1 shows the relation diagram between OpenADR 2.0 VTNs and VENs, revealing all relation combinations between VTNs and VENs. VTNs and VENs are defined below. Virtual Top Node (VTN): This is an entity controlling demand-side resources and is responsible for delivering grid information (such as price, reliability, and events) to other entities (e.g., VENs). A VTN could simultaneously communicate with the grid and VEN equipment or systems. A VTN might also be a VEN simultaneously interacting with other VTNs. Figure 1: Relation diagram between OpenADR2.0 VTNs and VENs [16]. Virtual End Node (VEN): A VEN presents a set of resources and/or processes for operation and control and could respond to known smart grid information (e.g., DR signals). Such a VEN could be an energy producer or a consumer. A VEN could communicate with a VTN to receive and send smart grid messages. A VEN could also be a VTN and simultaneously interact with other devices. A utility or Independent System Operator (ISO) could send OpenADR commands to any user end site. The OpenADR device of an aggregator could be a VEN in the lower layer of hierarchical architecture to respond to the upper layer VTN server and a VTN in the upper layer to order the lower layer VENs. Figure 2 shows the application of OpenADR, in which a VTN (power company/service provider), with OpenADR protocol, transmits grid information (e.g., price and event) to a VEN in Home and Building Energy Management Systems through the Internet. The VEN then processes the demand control (on/off or adjusting power output) when receiving the event (e.g., unload control). Table 1 displays the detailed functions of OpenADR 2.0a and OpenADR 2.0b. The automated DRC developed in this paper is a VEN used for homes or office buildings and conforms to the OpenADR 2.0a protocol. A Raspberry Pi 3 is used as the VEN, and the demand response controller is developed with an Arduino to non-invasively measure current and voltage, control appliances (e.g., air conditioners) using infrared, and control switches using relays. The current measurement plays an important role in identifying whether the appliance receives infrared codes for actions after the automated DRC emits an infrared remote control command. Whether the appliance follows the command for actions could be judged by the current change. When there is an action, the current will change as well. For this reason, the function of current measurement is essential. Furthermore, the current sensor also allows the automated DRC to be able to calculate the energy consumption of the appliance and present the function of a smart meter (two-way communication). Regarding communication, PLC is utilized. Table 1 shows that the Simple Hypertext Transfer Protocol (Simple HTTP) or XMPP (XML Messaging and Presence Protocol) is used in VEN nodes for communication. Simple HTTP merely uses the HTTP standard POST and is divided into PUSH mode, which is induced by a VTN, and PULL mode, which is requested by the VEN to a VTN for exchanging a series of information. Both PUSH and PULL modes present different advantages and shortcomings.