Blockchain-based self-consumption optimization and energy trading in Renewable Energy Communities

Energy Communities will be an essential element of the future energy system. Especially Renewable Energy Communities are gaining high attention in many European countries and their implementation, characteristics and use cases are elaborated in many research and development activities all around the world. Within the Austrian research project Blockchain Grid, a Blockchain-based Renewable Energy Community is implemented and field-tested in Heimschuh, Styria. It supports different technical applications like self-consumption optimization and peer-to-peer energy trading for customers, and a novel approach for grid capacity management supporting distribution system operators. These use cases have been implemented and validated in simulative studies showing promising potential for total energy costs for energy community members.


Introduction
As part of European Union's 'Clean Energy of All Europeans Package', the Directive on Renewable Energy (RED II) introduces Renewable Energy Communities (RECs) aiming to produce, consume, store, and share energy and to increase self-consumption of locally generated energy.Within the Austrian research project Blockchain Grid 1 , a REC is implemented in a low voltage grid in Heimschuh, Styria.Different use cases are defined and implemented; they will be validated in simulation models and within a 12-months proofof-concept field test.The technical architecture is based on Blockchain technology: Each customer is equipped with measurement and embedded computational devices as Blockchain clients.Proof-of-Authority is used as consensus mechanism, whereas the Blockchain sealers are set-up at the different authorities.Furthermore, a battery storage is available at a dedicated branch within the low voltage grid and can be used by all community customers.This paper will provide an overview about the implementation of a Blockchain-based solution for energy communities including a detailed description of two dedicated use cases as well as their validation in simulation models and potential energy and cost savings.In particular, a community model for self-consumption optimization by using a common storage system as well as an approach for peer-to-peer energy trading is presented.Energy trading is a widely-researched topic and different concepts were already analysed in [1] with many more scientific publications afterwards (cf.[2,3,4]).

Energy Community & Use Cases
Based on the participation of low voltage grid customers, different user groups have been identified within the research project (see Figure 1).Local Grid Customers (LGC, grey): This group of customers is connected to the same transformer station but is not part of any energy community and thus, not able to participate in any community interaction such as energy trading, usage of the community storage, etc.
Renewable Energy Community (REC, green) customers: This subset of the LGC participates in common energy sharing concepts, they use the community storage system and get reduced grid fees.
Local Family Community (LFC, blue) customers: These customers are a subset of REC customers with additional constraints (e.g., special energy prices of family members within the community).
In the following, two energy community use cases are described in detail.Only REC customers are considered since other grid customers do not have any impact on the presented community use cases and family conditions are avoided due to simplicity.
In Blockchain Grid, each REC customer is equipped with additional hard-and software components and therefore, will be part of the community's Blockchain system.During operation each customer can choose an own configuration, focussing either on i) self-consumption optimization or ii) energy trading within the community.These two configurations differ mainly in their sequence but are implemented within a single smart contract on the Blockchain system.Further details about the architecture is provided in [5,6].All community customers can use the community energy storage system without any capacity restrictions beside the overall battery capacity.As limiting factor, an automated battery discharging process is implemented after a dedicated time (e.g., if the stored energy is not used by the customer within 36 hours, it is released and sold to other REC customers or to the retailer).Additionally, it is assumed that all customers will use the same energy price for transactions within the community which is between the feed-in price and the consumption price (see Section 3.3).

(B1):
The available energy within the battery (stored into the battery in previous time steps) from customer A is initially reserved for A, but released after a dedicated period (e.g., discharging has not happened within the previous 36 hours) to be bought and consumed by other community customers who currently have an energy demand.Due to the Blockchain system and the transparency of all energy transaction within the community, the timestep of creation, storage, and usage of each amount of energy is well documented within the system and can be used for settlement and the battery energy release process.

(B2):
The available energy within the battery from customer A is released after a dedicated period and will be sold to the retailer.

Peer-to-Peer Energy Trading
Figure 3 shows an overview about the process of peer-to-peer energy trading, with the same actors as already described for Figure 2.

Customers
Within the research project Blockchain Grid, measured power profiles from different customers were available and used for simulative studies: • One commercial customer with significant higher load than the other customers and a photovoltaic system with low peak power (prosumer).• Five residential customers with well-dimensioned photovoltaic systems (prosumer).• One residential customer without a photovoltaic system (consumer).Only the residual active power profiles of the customers are used as main input for the developed rule-based energy allocation simulation.

Scenarios
The simulation was set-up for a period of one year with a time resolution of 15 minutes.In addition to the customers, a community battery storage system with a capacity of 100 kWh was modelled and used in the simulation.The time period for automated discharge of the battery was set to 36 hours.The following simulation scenarios have been defined to investigate the impact on energy consumption and total costs for all customers, based on different settings and the availability of a community storage system and energy trading: • Scenario I (baseline): In this scenario, only energy transfer from/to the retailer is possible.No battery or peer-to-peer energy trading is supported.

Energy price and grid tariffs
As shown in previous work, a financial promotion such as the reduction of grid costs, taxes and fees is an important aspect to foster the acceptance and adoption of the energy community concept [7].In order to ensure realistic assumptions for the settlement of energy costs (to and from retailer and within the community), grid costs (with reduced tariffs for energy transfer within the community), tax and others, the following prices and tariffs were used (in total for each case): • Peer-to-peer energy trading (seller): 6.08 ct/kWh (including energy price and tax) • Peer-to-peer energy trading (buyer): 13.01 ct/kWh (including energy price, tax, reduced grid fee and other fees) • Battery charging: 0.385 ct/kWh (including grid fee and grid loss fee) • Battery discharging: 2.654 ct/kWh (including grid fee and grid loss fee)

Results
Figure 4 shows an overview of the resulting behaviour (battery to customer, customer to battery, etc.) of a single customers (top), the residential profiles of all community customers (middle) and the state-of-charge (bottom) within a period of three days in June.The forced discharge of the algorithm results in a decline of the individual and hence, in the overall state-of-charge.The energy to be freed in a first step is distributed to other customers (bright red colour), if they have demand.Otherwise, it is sold to the retailer (dark red colour).Within Blockchain Grid, several Key Performance Indicators (KPIs) have been evaluated in the simulative studies.Some of them are related to transferred energy savings, peak power reduction, or to any kind of (reduced) costs.As total energy costs are one of the main drivers of energy communities [7], this paper will mainly refer to total cost results.The one involved commercial customer with high energy demand and thus, with relatively high total costs, is not considered in the following average values.The total costs are aggregated costs of energy costs, grid use fee, grid loss fee, tax, and other fees and are presented for the different scenarios in Figure 5, This result is based on the assumption that only grid fees and grid loss fees have to be paid when using the storage; thus, selling as well as buying energy within the community (considering energy price, tax, and fees) is relatively unattractive compared to using the battery.Nevertheless, this share of about 10 % total cost savings can vary, dependent on the size of the battery, the release time, and the number of participants and their characteristics.Further simulations with a higher number of different customers and thus, several characteristics of power profiles, and other battery release times are going to be simulated within the second period of the project.In parallel, a comprehensive field validation of the presented Blockchain-based approach is going to be performed.

Consideration of legal aspects
Besides RECs, the RED II legally introduces the term 'peerto-peer trading of renewable energy' as the 'sale of renewable energy between market participants by means of a contract with pre-determined conditions'.Also mentioned within this definition is an 'automated execution and settlement of the transaction' which appears to legally consider smart contracts in an environment utilizing Blockchain technology [6].However, smart contracts are not considered as contracts in a legal sense, but the executed code may nevertheless produce legal effects [8].Various legal disciplines (e.g., civil law, consumer protection law, tax law, e-commerce law) need to be considered when utilizing smart contracts [6].Their use may be critical in terms of privacy law; those issues, however, have not been considered much yet [6,8].After contained in the directive's legal definitions, later-on the term 'peer-to-peer trading' appears only once more in regulations on 'renewables self-consumers'.The Union's member states are thus entitled to ensure those consumers to generate renewable energy, and to store and sell excess production by using renewables power purchase agreements, electricity suppliers and peer-to-peer trading arrangements.National adoptions of the directive are due in Mid of 2021; an Austrian draft is not yet available.

Conclusion and Outlook
We presented a Blockchain-based solution for customers in Renewable Energy Communities to enable an extended selfconsumption optimization and peer-to-peer energy trading within the community.First simulation models showed a potential of about 10 % total cost savings on average.Since the most beneficial operation scenario very much depends on the community setup, further simulations with larger communities and with different customers will be simulated and analysed regarding the potential of total cost savings, amount of energy transfer within communities, etc.
Comprehensive field validations will show the stability and usability of the system.

Figure 1 :
Figure 1: Overview of different customer groups in low voltage networks.

Figure 2
Figure 2 shows an overview about the process of selfconsumption optimization from the view of customer A. Customer B on the right side of the figure represents all other REC customers, the symbol on the left illustrates the public grid and the retailer, respectively.The battery symbol at the bottom of the figure illustrates the community battery.

Figure 2 :
Figure 2: Self-consumption optimization.Si, Di, Bi represent surplus, demand, and automated battery discharge after a dedicated time (e.g., after 36 hours).Index i represents a time step.
3. (S1): Surplus from customer A is fed into the community battery for later re-use (if the battery is not fully charged yet).4. (S2): Surplus from customer A is sold to other community customers if the battery cannot be further used.5. (S3): Surplus is sold to the retailer if the battery cannot be further used and there is currently no further demand within the community.6. (D1): Stored energy is taken from the battery to serve the own consumption of customer A. 7 (D2): Surplus energy from other community customers is bought to serve the own-consumption of customer A if the battery cannot provide enough energy.8. (D3): Energy is bought from the retailer if there is not enough energy available from the battery and within the community.

Figure 3 :
Figure 3: Peer-to-Peer energy trading.Si, Di, Bi represent surplus, demand, and automated battery discharge after a dedicated time (e.g., after 36 hours).Index i represents a time step.This second use case is based on the similar algorithm as described in Section 2.1.Only steps 3 and 4 as well as 6 and 7 are changed in the sequence: 1. (B1): Available energy within the battery from customer A is released after a dedicated period to be bought and consumed by other community customers who currently have an energy demand.2. (B2): Available energy within the battery from customer A is released after a dedicated period and will be sold to the retailer.3. (S1): Surplus from customer A is sold to other community customers.4. (S2): Surplus from customer A is fed into the community battery for later re-use.5. (S3): Surplus is sold to the retailer if the battery cannot be further used and there is no further demand within the community.

Figure 4 :
Figure 4: Resulting transactions (top) of a single customer, overview about residual power profiles of all customers (middle) and overview about the total state-ofcharge and the customer-related state-of-charge (bottom).

Figure 5 :
Figure 5: Averaged total costs (energy price, grid fee, grid use fee, tax and other fees) for the six different scenarios Obviously, scenario III (focus on self-consumption optimization without automated battery discharge) achieves the highest cost savings compared to the baseline scenario.This result is based on the assumption that only grid fees and grid loss fees have to be paid when using the storage; thus, selling as well as buying energy within the community (considering energy price, tax, and fees) is relatively unattractive compared to using the battery.Nevertheless, this share of about 10 % total cost savings can vary, dependent on the size of the battery, the release time, and the number of participants and their characteristics.Further simulations with a higher number of different customers and thus, several characteristics of power profiles, and other battery release times are going to be simulated within the second period of the project.In parallel, a comprehensive field validation of the presented Blockchain-based approach is going to be performed.