## 1 Introduction
### Services in Smart Buildings  
In this work, we propose some basic services for our study-case smart-building (SB), based on the added value that they provide to its users and other actors. We tackle the problem of proposing some EMS strategies targeted to provide those services. The services proposed are: grid-commitment, grid-peak-power, energy-cost, and carbon-footprint. The definition of these services is explained in detail in Section 2.4.  
In the domain of MGs, services, like grid-commitment or grid-peak-power (introduced in the current work), are not common. This is mostly due to the scale and current penetration of MGs, which is not significant respect to utility grids. However, if we imagine a penetration scenario of IRES, which, for 2050, could achieve more than 60% according to some studies [24; 25] (being distributed generation a non-negligible percentage of it), the capacity to deliver those services could have an important added value, in terms of operational, economic and environmental benefits [26; 27]. This is one of the driving motivations of the present work.  
However, as the EM strategy usually targets a particular service, a MG can under-perform regarding the non-targeted services, which is one of the main conclusions of this work. Quantile forecasting proved to be an interesting solution not only to customize and optimize performance when targeting a particular service during the EM, but also as a mean to deal with the uncertainty of IRES by providing some degree of certainty regarding the bias of the forecasts. This proved to be beneficial when targeting some services during the EM that are also dependant on different seasonal conditions.  
The main contributions of this work can be summarized, as follows:  
1. Proposing a service (i.e., grid-commitment), intended to decrease (and serve as a measure of) the degree of uncertainty posed by a microgrid using IRES to the utility grid, regarding its daily power requirements.
2. Acknowleding that some services (e.g., grid-commitment) are more favored by eccentric (i.e., pessimistic) forecasts rather than unbiased forecasts.  
The use of quantiles as eccentric (deterministic) forecasts, obtained from an analogs ensembles method, with low computational burdens/time and good performance with respect to benchmark probabilistic forecasting methods.
4. Proposing an energy management framework for microgrids, which allow the maximization of the grid-commitment service by means of an underlying rule-based layer, preceded by a day-ahead scheduling optimization-based layer, where another service (i.e., energy cost, carbon footprint, or grid peak power) can be also favored. In this way, the interests of both, microgrid users and distribution system operator, are taken into account during the energy management process.
5. Acknowleding that also some external (seasonal) conditions change the forecasting requirements when optimizing for a given service, which again highlights the usefulness of quantile forecasts for customizing optimization/energy management strategies.  
In Section 2, a description of the study-case microgrid, the data used and the definition of the services proposed as performance indicators are presented. The Analogs Ensembles method (where the quantile forecasts are obtained) is explained here, which constitutes one of the main contributions of this work regarding the uncertainty challenge. The energy management system framework proposed as well as the reference strategies used to benchmark the performance are also presented in this section. In Section 3, the main results and analysis are presented and discussed, while, in Section 4, the main conclusions of the work are pointed out.