Hack Davis 2020 & OSIsoft - Analytics for a Smarter Energy Aware Campus



Welcome all who are attending this year's hackathon at the University of California--Davis (for more detail and the event schedule, see https://hackdavis.io/). OSIsoft is the data sponsor of this event and this year our focus is data analytics using the facilities information systems at UC Davis. We have consolidated everything you need for a successful project here on the OSIsoft Academic Hub.


OSIsoft and UC Davis Energy & Data Group Challenge



On OSIsoft Cloud Services (OCS) we host time-series data from many meters on campus that measure building electricity, heating (steam), cooling (chilled water), and gas. We also have meta data on buildings (square footage, building type, construction date) and outside air temperature. The dataset is comprised of a large set of time-series data. One example of use is here: UC Davis CEED site: http://ceed.ucdavis.edu/.


The data is hosted on and made available to students through OSIsoft Cloud Services (https://www.osisoft.com/Solutions/OSIsoft-Cloud-Services/). Data for the years of 2017, 2018, and 2019 are available to you.


For your project, you may wish to combine the data from OSIsoft Cloud Services with data from other sources. For example, you may wish to consider the time-dependent cost of electricity. This dataset is available here (unit is $/MWh): https://apimgmtstelkv30lahnuj362.blob.core.windows.net/content/MediaLibrary/hackdavis/RealTimeMarketRate.csv

Also available is the building Wifi access for 2 years: https://apimgmtstelkv30lahnuj362.blob.core.windows.net/content/MediaLibrary/hackdavis/ucdavis_wifi_data.csv








What is OSIsoft Cloud Services (OCS)


Industrial digitalization and globalization is generating more data and new opportunities to leverage data.  Data that can be shared and used to power new applications that deliver increased operational efficiency and support new business models. At the same time the cloud offers a scalable, elastic and centralized environment to aggregate data for reporting, advanced analytics and third party applications. OSIsoft's Cloud Services are designed to meet today's digital transformation needs by connecting in real-time data from PI Systems, to people, analytics and applications for enterprises and communities to realize the value of their data.

Real-time data is stored in OSIsoft Cloud Services, enhanced, and delivered to business applications. Data may be seamlessly delivered to many analytical tools and applications.

For Hack Davis 2020, we have made a Python Jupyter Notebook available to you. This "Starter Notebook"contains examples and convenience libraries that will help you access utility and related meta data from OCS. The Starter Notebook can be accessed here: https://github.com/cfoisy-osisoft/nasa_bearing/blob/master/hackdavis/HackDavis_SDS_final.ipynb. Please see the Getting Started with the Hack section of this page for more information. [OCS credentials here]


UC Davis has developed visualization of the data (e.g. the CEED Dashboards) and is seeking deeper analysis or visualizations of the data to get more value and meaning out of the data. Example questions of interest:


        • Can predictive models be developed as a function of relevant parameters (ie, air temperatures, building properties, time-based parameters)?

        • Can insight be gained on potential energy savings from usage patterns at the buildings as a function of time?

        • Are buildings using energy when they should not be?

        • How should the buildings be categorized? Are there several unique usage profiles? Are there opportunities for optimization based on real time electricity pricing?

        • How can we automate assessment of data quality, detection of outliers, and cleaning of data?





Prizes will be handed out to 1st, and 2nd, and 3rd place teams for the best use of OSIsoft Cloud Services and the UC Davis CEED dataset. Prize money to be divided up as follows:


• 1st - $500 Amazon Gift Cards

• 2nd - $300 Amazon Gift Cards

• Other -$200 Amazon Gift Cards

Good luck! 😊



Also: We're Hiring!


We are presently hiring Product Support Engineers, IT Support Engineers, and Software Engineers. You can apply online to OSIsoft and submit your resume to: https://www.osisoft.com/about-osisoft/careers/.



Requirements for the OSIsoft Hack


The OSIsoft challenge for Hack Davis 2020 uses a Python library to access UC Davis facility data from OSIsoft Cloud Service (OCS). To complete the challenge, you need to be comfortable in programming with Python. You will also need to have a local installation of Jupyter with Anaconda with Python 3.6 or better (https://www.anaconda.com/distribution/#download-section).



Getting Started with the Hack


1.     Make sure that your local development environment meets the requirements specified above.

2.     Begin working with the example Python scripts via a web browser.

a.      For Hack Davis 2020, we have made a Python Jupyter Notebook available to you via binder. This "Starter Notebook" contains examples and convenience libraries that will help you access UC Davis utility data streams and related meta data from OCS. The Notebook can be accessed here: https://github.com/cfoisy-osisoft/nasa_bearing/blob/master/hackdavis/HackDavis_SDS_final.ipynb. You can run this Starter Notebook in a web browser; however, you should not make significant changes to the code unless you are working with a local copy. Note that the Notebook will revert back to its original state whenever the web session is terminated (or lost due to inactivity).

b.     Authentication of the Python code to OCS is accomplished using a Client ID and a Client Secret. These keys are not saved in the publicly available notebook. You will need to obtain the ClientID and ClientSecret keys for Hack Davis 2020 from a website and then input these into the notebook. Please ask OSIsoft representatives for a link to the website where the keys can be obtained.

The section of the notebook that you will need to edit is shown below. Replace the REPLACE_ME placeholders with the keys.

3.     Save the Python notebook locally before making additional changes to the code.

4.     Open the notebook using Jupyter to begin working on the challenge.

5.     Have fun!



Starter Notebook data access examples and clarification


The Starter Notebook contains examples of data access. Note that data access is done on a stream-by-stream basis, and that the max interval for the data access is one month. If you would like to access data for a longer period, you will need to make multiple requests and then append the results. Please see the "Getting a full year of data" example in the Starter Notebook.

You will access data using the ocs_stream_interpolated_data() function. Inputs include start and end timestamps (UTC) and the sampling interval. The interpolated data function will return an object that includes a list of timestamps and values. The timestamps will be evenly spaced, and the interpolation window defines the spacing of the timestamps, e.g.:


Getting interpolated data from a stream


Helper functions include:

       • ucdavis_buildings(), which returns a list of all UC Davis buildings for which we have data

       • ucdavis_ceeds_of(building), which returns a list of available CEEDsassociated with a building. For example, we have electricity data for the Academic Surge Building; this is a CEED.

       • ucdavis_streams_of(building,utility), which returns all available data streams (stream name and stream ID) that are associated with the specified CEED. If no utility is specified, the data streams associated with the Electricity utility will be returned by default.

       • ucdavis_streams_of(building)[data_stream_name], which returns the data stream ID for the specified stream and building.

       • ucdavis_outside_temperature(ocs_client, namespace_id, start_date, end_date, interval), which returns interpolated data for the outside air temperature.

       • ucdavis_building_metadata(ocs_client, namespace_id, building), which returns meta data associate with the specified building. Here is an example response:

{'Annual Cost': 151156.0,

'BuildingName': 'ARC',

'kWh Rate': 0.0687,

'Prefix': 'Activities_and_Recreation_Center_MSB',

'Rollover': 10000000.0,

'CAAN': 4799.0,

'Construction Date': '04/15/2002',

'Display Name': 'Activities and Recreation Center',

'Latitude': 38.5428969596,

'Longitude': -121.759644393,

'Maintained Gross Sq. Ft.': 158120.0,

'Primary Usage (Type)': 'REC - Athletics & Recreation'}