This thesis presents a peak-shaving application for Boonrod Binson building (former electrical engineering building) at Chulalongkorn University where the CUBEMS (Chulalongkorn University Building Energy Management System) is installed along with grid-connected battery energy storage. In this system, there are 3 main components in the following: 1) the historical load data stored in the data storage, 2) the peak-shaving application and 3) Battery Energy Storage System (BESS). This thesis mainly focuses on 2 issues. The first one is concerned with the development of peak-shaving application for CUBEMS; the load forecasting and the commanded patterns of charging/discharging current for the inverter of BESS are provided. The second issue is the interoperability among various equipments with distinct standards in the CUBEMS where the IEEE1888 open standard is conducted to be the backbone. In this thesis, a forecast model; ARIMA (4,1,4)x(0,1,1)96, is created from the Box-Jenkins methodology by using historical load data. This model can fairly forecast the peak demand to some extent. Furthermore, the gateway is developed in order to connect between battery inverter (Modbus standard) and CUBEMS (IEEE1888 standard). The experiment with the existing CUBEMS shows the results that the peak-shaving application can be able to employ the historical load data to forecast the electricity demand. The profiles of discharge current are appropriately generated and sent to the inverter through the developed gateway. In addition, the interoperability with 5-kW 14.4-kWh-rating BESS is achieved and the developed application can successfully shave up to 4.06 kW of the peak demand of Boonrod Binson building.