###### Abstract
For HyDSMaaS, some web applications such as the payment monitoring and control system, real-time graphics to monitor energy traffic, and QoE, among others, should be unimplemented so that artificial intelligence (AI) services and other applications can act without the need for information to reach the EPC. For that, an architecture was modeled in this work and presented in the Figure 1, where these applications can be present in the infrastructure as a service to final consumers. Initially, for a LoRa network to act, there must be a network server to be responsible for the exchange of information in a secure and scalable way. The IoT hub will be a web application responsible for routing data to streaming data in real time, and, for this, used several frameworks can be used; the most widely used is The Things Network (TTN), which is a network server capable of collecting the data in the infrastructure and forwarding it in a secure and scalable way to an application server, which in this case can be the Microsoft Power BI [22; 23]. The data can then be represented on a dashboard that are interactive, and real-time graphics can be generated and analyzed directly in Power BI. AI algorithms, such as machine learning (ML), can act in this scenario as intelligent systems capable of predicting, indicating, and collaborating in decision making by both the EPC and the end consumer in an automated and intelligent way. Additionally, the consumer and EPC website can be a means of communication and consumption of this information through visual access via the Internet or via mobile applications. This is due to the implementation of the application programming interface (API), which will be responsible for providing communication between the database and external applications such as website and mobile applications, which will give greater flexibility to consumers and reduce implementation costs for the EPC. In this case TTN will be used to work with the LoRaWAN protocol, there may be other network servers to connect to other protocols, as well as a hybrid network server, but this work was limited to studying only the LoRaWAN and LoRaMESH protocols, so TTN was adopted. Besides using only one technology to provide the HyDSMaaS, there are other studies that seek to hybridize the networks, so that if a technology just can not meet these requirements, will be made a hybridization with another technology [24; 25], however, the studies are limited to the management on the EPC side. With this in mind, this work has as its main differential in relation to the state of the art, the proposal of a hybrid infrastructure for management on the demand side. Figure 1: Smart Grid Application Architecture as a Service. For DSM services to exist, HEM and SM technologies must be present in a scalable and secure way in an AMI [26]. However, the introduction of these technologies to provide HyDSMaaS also presents new operational and technical challenges [27], and the main one is which technology and communication topology to use to satisfy this data exchange between customers and the EPC, or vice versa. And with this, several communication technologies are able to be used in this infrastructure, among them are WiFi (Wireless Fidelity), BLE (Bluetooth Low Energy), IEEE 802.15.4 [28] and ZigBee [28] for indoor environments, i.e., within environments such as homes, buildings, condominiumus, businesses and industries. For the outdoor scenario, 5G (Fifth Generation) technologies, LTE (Long Term Evolution), GSM (Global System for Mobile), NB-IoT (Narrow Band in IoT), WiMAX (IEEE 802 standard) [29], PLC (Power Line Communication) [17] and SigFox [30] are available as possible candidates to provide this communication infrastructure, in this case the scenario is of external communication between final consumers through the SM to the EPC. However, in order to have a communication infrastructure using these technologies the investment must be higher, due to the cost of network equipment as well as the final equipment [31].