*4.1. Site Description*

The SPO has been deployed in a convenience store/gas station in Blue Lake, California, United States at the Blue Lake Rancheria. Being located at the edge of the utility service territory and in a generation-constrained area of Humboldt County in California, this site is at a strategic point for supporting grid reliability. The refueling and cold storage services provided by the store are recognized as critical community needs by the operators, particularly during blackouts or natural disasters, which drives their interest in energy resiliency at the site. Strongly tied to this motivation is the requirement for network resilience, that is, being able to operate in an Internet-disconnected mode as well. A unique aspect about this particular building is that it is attached to a casino complex and hence the store also contains gaming machines. The presence of these machines within the convenience store means there are regulatory requirements for network and firewall restrictions that prevent any control signals from originating outside their local network. The site has a unique combination of a real need for resilience and a site with professional IT network staff who require robust cybersecurity.

The store is typically open 24 h a day, 7 days a week and serves frequent customers throughout a day. The space inside the store is conditioned by two separate two-stage roof top units (RTUs), virtually (but not physically) dividing the store into an "east zone" and a "west zone". These RTUs are controlled by individual thermostats that have been installed in the corresponding zones. The store also has a walk-in refrigerator for storing and displaying beverages through a set of glass reach-through doors and a walk-in freezer for storing and displaying ice-cream and frozen food. The site has 60 kW of local solar power generation capacity along with a battery with 174 kWh of energy storage (and power capacity of 109 kW). As seen in Figure 5, the solar panels are installed on the gas station canopy and the energy storage unit is a Tesla Powerpack.

(**a**) 60 kW local solar power capacity

(**b**) 174 kWh local energy storage capacity with a peak output of 109 kW

**Figure 5.** Distributed Energy Resources installed on site.

The typical daily energy consumption is about 800 kWh (or 33 kW average demand), with an hourly average load profile illustrated in Figure 6. However, the gaming machines in the store contribute a significant portion of the total electrical load, and only about 15 kW of the electrical

demand is for the thermal systems (i.e., the two RTUs, the refrigerator and the freezer), which are controllable by SPO. The remaining uncontrolled demand is primarily from gaming machines that are located in the store. The building exhibits peak demand in the early morning and early evening periods—both prime targets for thermal load shifting to alleviate system stress around sunrise and sunset. It currently operates on the E19S electricity tariff offered by Redwood Coast Energy Authority, a community-choice aggregator that provides retail options to customers in Humboldt County who could otherwise be served by the distribution utility, Pacific Gas and Electric Company [84]. The site soon plans on moving to the B19 tariff [85]. Both these tariffs contain time-of-use energy charges (\$/kWh) and time-of-use demand charges (\$/kW), with the key difference being the timing of the peak prices. In B19, the peak prices occur later in the day, between 16:00 and 21:00 daily to account for the growing duck-curve problem in California [86], while E19S is a legacy tariff with the peak prices during the 12:00–18:00 period that historically included coincident peak demand. The building operators are motivated to reduce their overall energy costs by reducing energy consumption and by effective managemen<sup>t</sup> of the peak loads on the grid.

**Figure 6.** Daily load profile of the convenience store across different seasons.

#### *4.2. Hardware and Software Set Up*

Given the cybersecurity requirements at the site, the SPO system uses local drivers with local storage and an MPC-based optimization engine. The local SPO server with a WAVEMQ site router has been hosted on an Intel NUC computer with an Intel i7 processor and 2TB of internal disk capacity [87] at the site. The designated WAVEMQ router is hosted on a cloud server, which is also attached to a persistent data store, also in the cloud. InfluxDB [88] is utilized as the timeseries database, both in the cloud and on the local server. The local server has been configured with a retention policy to only store the most recent two weeks of data that might be relevant for the optimization engine. The local server also hosts the drivers that communicate with each of the devices and/or services (over the protocols mentioned) listed below, reading data once every minute and publishing to the WAVEMQ message bus. There are data ingester services set up both at the site router and the designated router to store these published messages in the local and the cloud-based InfluxDB databases, respectively. The drivers for the controllers also subscribe to the 'optimal setpoints' being published by the optimization engine so that they can change the setpoints of the controllers.

The list of data sources and/or controllers, with their respective communication protocols are given below:


Table 2 provides a list of data and their respective sources that are required for the optimization engine. A summary of the controllers and the variables that can be controlled, with the default values and lower and upper bounds, is given in Table 3. These limits were provided by the convenience store operators after considering the requirements for indoor air conditioning and food storage. The limits have been encoded into the respective drivers so that even if the optimization engine produces a setpoint outside the limits, the drivers can ensure that those values are not set on the actual device. It is to be noted that the list of variables in Tables 2 and 3 are a subset of variables that can be read from or written to each of the devices.


**Table 2.** List of data sources and relevant variables (Inputs to the optimization engine).

**Table 3.** List of Controllers and their relevant variables (Outputs of the optimization engine).


## *4.3. Optimization Engine Set Up*
