**1. Introduction**

Preparation for the transition from conventional power grids to next generation, so-called "smart" grids, is a worldwide trend nowadays. The goal for stakeholders in the domains of operations, generation, transmission, distribution, and service provision [1] is to offer more and higher quality services while improving operational capabilities, flexibility, and energy efficiency. In this context, a higher-level utilisation of smart grid resources is targeted by grid modernisation and enhanced dispersed dynamic measurements at local, regional, and wider levels. Various forms of communication equipment and protocols allow smart metering, monitoring, and controls in an interoperable unified system often described as Advanced Metering Infrastructure (AMI).

Smart metering and AMI are widely recognized as a necessity for the reliable and fast exchange of data in smart grids [2]. It is expected that nodal analysis of power measurements in the power

grid will provide valuable information for utilities to control multi-directional flows of energy and improve dispatching, addressing vulnerabilities and constraints. In this sense, it is foreseen that a variety of technological solutions will emerge to balance the high volatility and power quality issues of the miscellaneous intermittent loads and renewable energy sources.

On the market side, reforms are required to leverage innovation in services and new business models which will upgrade existing operations. In this context, Demand Response constitutes a variety of services which have transformed the electric grid and energy markets operations during the past decades. Significant progress has been made in the US, where DR programs have been designed and implemented for years, and span across the full range of dispatchable (reliability, economic) and non-dispatchable (time sensitive pricing; ToU, CPP, RTP) demand side management options [3]. Demand side management is a valuable prospect for consumers and utilities—if used properly—for the use of assets and to decrease losses in transmission and distribution, as well as reducing avoidable costs. In this context, DR, along with the demand-side management of distributed energy resources, expand the boundaries for near future scientific and technological advances.

In the European Union, the Energy Efficiency Directive (EED), 2012/27/EU foresees the elimination of barriers for Demand Response (DR) in balancing and ancillary services markets [4]. Among the EU Member States (MS), considering the progress in DR, Belgium, France, Ireland, and UK, are in the leading group. Significant steps have also been taken in this direction by Germany, the Nordic countries, the Netherlands, and Austria. Generally, DR programs are differentiated (a) explicitly, i.e., where DR participants transact directly in the energy market, and (b) implicitly, i.e., where participation through a third party is facilitated [5].

Furthermore, Open Automated Demand Response (OpenADR) is a well-established protocol defining various deployment scenarios for facilitating DR programs and measures [6]. The overall framework of smart grids with regards to DR is presented and analyzed by Siano in [7]. Important aspects are defined, and a description of the possibilities created by DR for utilities and customers are analyzed. Load curtailment, shifting energy consumption, and using onsite energy generation, thus reducing the dependence on the main grid, are the main mechanisms for customers to participate in DR. Customer participation in wholesale markets via intermediaries, such as curtailment service providers (CSP), aggregators, or retail customers (ARC), demand response providers (DRPs), or local distribution companies, is documented in [7]. Moreover, a review of DR and smart grids with respect to the potential benefits and enabling technologies is provided. Considering system operation, contingency issues can be dealt with through DR implementation, resulting in a reduction of electrical consumption at critical hours, and avoiding serious impacts due to failure of power services provision. Considering energy efficiency, it is ascertained that effective management of aggregated loads can lead to a reduction of the overall cost of energy, due to the reduction and operating-time-shortening of conventional power generation equipment. Avoiding network upgrades at the local level, or postponing investments in new capacity, reserves or peaking units at system level, is another important potential benefit linked to high level implementation of DR. Modelling of incentive-based DR focusing on interruptible/curtailable service and capacity market programs is investigated by Aalami et al. in [8]. Price elasticity of demand, and a customer benefit function, are used to develop an economic model. Several scenarios are simulated and evaluated based on their value according to different strategies and performance with respect to improvement of the load curve (peak reduction, load factor, peak to valley), benefit of customers, and reduction of energy consumption.

Wholesale electricity market design considerations with regards to major challenges, aiming at increasing renewable energy penetration, are explored in [9]. Various dynamic energy pricing models have been proposed to compensate for market uncertainty and risks [10,11]. A residential DR based on adaptive consumption pricing is proposed by Haider [12], allowing utilities to manage aggregate load, and customers to lower their energy consumption. The proposed pricing scheme adapts energy costs to customers' consumption levels, thus encouraging active enrolment in the DR program. Cost and comfort optimisation of load scheduling under different pricing schemes has been investigated using

various techniques including linear, convex, PSO, MINLP [13]. Furthermore, technology readiness, opportunities, and requirements for the deployment of DR in buildings and blocks of buildings is addressed by Crosbie et al. in [14,15].

On the other hand, buildings worldwide are responsible for over 40% of total energy consumption, gas emissions, and global warming [16]. The role of smart grids for near- and zero-energy building communities is investigated by researchers to test new approaches, identify critical aspects, and tackle challenges emerging when dealing with design and operational problems [17,18]. On the demand side, a wide variety of developed scientific tools influence the dynamics of advances in energy performance and energy management in buildings [19–22]. Such tools are embedded in data monitoring applications, such as innovative web-based energy management platforms [23,24] to enable improved analysis, decision making, and dynamic controls. Moving from Building Energy Management Systems (BEMS) [25,26] to District Energy Management Systems (DEMS) [27] entails the dynamic exchange and hierarchical processing of data streams between various components and systems, as in the Internet of Things (IoT) paradigm [28,29]. Various techniques and tools have been investigated for dealing with challenges in various fields pertaining to smart grids: smart metering data analysis and dynamic processing [30], power demand forecasting [31,32], Distributed Energy Resources (DER) management optimisation [33], users' engagement [34], etc.

In addition, Hybrid Renewable Energy Systems (HRES) have been implemented in various configurations to combine two or more renewable and non-renewable sources in order to deal with the intermittency of renewable energy sources, such as solar or wind. HRES have important attributes which make them increasingly attractive as alternatives to conventional fossil fuel energy sources in numerous applications [35–38]. Aligned with HRES, the concept of the microgrid as a semi-autonomous system of increased flexibility and manageable energy resources, such as renewable energy generation, storage, backup systems and flexible demand, is of particular importance when it comes to supporting grid stability and decentralized control [39]. A comprehensive critical review on the energy management systems of microgrids is conducted by Zia et al. in [40], with reference to the level of maturity of real world applications. Communication issues, control technologies and architectures, deployment costs, energy management strategies, optimisation, objectives and limitations, are addressed. An auto-configuration function using a multi-agent approach is proposed in [41] to establish automatic connection or disconnection of DER at microgrid level, capable of dealing with system faults and re-optimising the new configuration as necessary. Unsymmetrical and ground faults analysis in microgrids distribution systems is proposed by Ou in [42,43]. Hirsch et al. in [44] surveyed technologies and key drivers of microgrid implementation and research, at international level. Reported drivers in this context include extreme weather related concerns, cascading outages, cyber and physical attacks, deferral of infrastructure expansion costs, reduced line losses, efficiency improvements, savings, responsiveness, balancing loads, RE generation, etc. In [45], the authors present a residential microgrid day-ahead planning approach to accommodate appliance scheduling by modelling, among other things, inter-phase delay duration and time preference, in order to take advantage of shiftable loads and energy storage charging/discharging time. In [46], multi-microgrid configurations are presented and analyzed by means of the power line technology (AC, DC), layout (series, parallel, mixed), and interconnection technology (transformer, converter). A comparison of architectures based on cost, scalability, protection, reliability, stability, communications and business models is performed. Energy management and DR of multi-microgrids based on hierarchical multi-agent approach by introducing adjustable power is proposed by Bui et al. in [47]. Different operation modes are evaluated according to a two-level management cooperative multi-microgrid MILP-based model for day-ahead scheduling. Towards the application of state of the art, a microgrid energy management a Genetic Algorithm (GA) approach is applied in [48] to optimize cost strategies for scheduling distributed energy resources. The Quasi-static Artificial Bee Colony approach is used to optimize a multi-objective DR problem, based on the cost of energy and peak demand at the building level [49], including PV, Combined Heat and Power (CHP), batteries, electrical energy from the grid, and natural gas. Particle Swarm Optimisation is used in [50] to solve a bi-level problem modelling the interaction between the retailer and consumers. The energy hub is explored in [51] to develop a multi-carrier Demand-Side Management Time of Use (DSM ToU) optimization balancing energy import, conversion, and storage. Furthermore, a GA approach using present and day-ahead data was tested by Ferrari et al. [52] with respect to the management of loads of an experimental plant case study in Italy. The analysis involves PV, wind generation, a micro-CHP with a gas boiler, and an absorption chiller coupled with thermal storage.

In addition, Artificial Neural Networks (ANN)-based short term power forecasting is practiced to estimate day-ahead loads and renewable energy production. ANN models are designed to imitate biological nervous system information processing and evolution. They have been used for years in different areas of engineering, science, and business to deal with highly complex and nonlinear data sets. The ANN models assimilate the natural bonds of neurons and their high level interconnection to model complex systems. In the case of short-term predictions, the ANN models can be more effective compared to statistical, linear, or non-linear programming techniques. They encompass capabilities such as adaptive learning, self-organization, real time operation, fault tolerance, and the approximation of complex nonlinear functions. Kalaitzakis et al. in [53] tested advanced neural network short-term load forecasting using data from the electric power grid of the island of Crete in Greece. Various structures and configurations were assessed, and a parallel processing approach for a 24 h-ahead prediction was demonstrated. ANN architectures for forecasting demand in electric power systems are presented in [54] by Tsekouras et al. A case study of the Greek electric power grid is used to explore the performance of different ANN configurations and factors, including period length and inputs for training, confidence interval, and more. Moreover, short term power forecasting is of particular value for prosumers to model, understand, and predict their consumption profiles, as well as to apply effective scheduling and control. A framework for district-level energy management and ANN forecasting at the building level was investigated by Hu et al. in [55], evaluating the performance for 6 buildings of different occupancy routines. Hybrid Short Term Load Forecasting ANN combined with techniques such as Fuzzy Logic, GA, and Particle Swarm Optimisation are briefly discussed in [31]. Furthermore, a 24 h-ahead prediction of excess power at microgrid level is proposed by Mavrigiannaki et al. [56], testing 3 different configurations with respect to possible exploitation potentials from an energy management perspective. Finally, an overview of load forecasting, dynamic pricing, and demand side management techniques in smart grid research applications reveals the potential for operational cost reductions between 5–25% [57].

The aim of the research work presented here is the development and testing of a DR energy management GA-based optimisation approach based on day ahead ANN generated prediction models. The developed GA algorithm incorporates load shifting for the day ahead (24 h period), and evaluates possible alternatives based on cost and assumptions related to the practicality of the obtained solutions. The practical benefits of the proposed approach are linked to the development of a valuable tool for the evaluation of the potential rewards and risks of engagement in DR. In the case study that follows, a Time of Use pricing scheme is compared to a flat tariff.

The paper is organised as follows. In Section 2, the infrastructure and the applied methodology are presented. The proposed day-ahead GA approach for cost of energy and load shifting optimization based on ANN hourly power predictions is analyzed in Section 3. Results and considerations on ANN power predictions and GA optimisation solutions are provided in Section 4. Finally, in Section 5, conclusions and recommendations for future work are summarised.
