Skip to content

Latest commit

 

History

History
69 lines (57 loc) · 2.49 KB

File metadata and controls

69 lines (57 loc) · 2.49 KB

Occupant Responsive Buildlings

API Overview

This is the source code for the Occupant Responsive Buildings API. This code is configured to run within the orb container defined in the docker-compose.yml file located in the root directory. This code is provided to demonstrate the use of open standards in API development to implement a relatively simple single-purpose API for integration between python applications and live deployments of Energy Management and Information Systems.

This application uses the FastAPI framework to implement asynchronous python applications. FastAPI is built upon the OpenAPI 3.1.0 Specification, providing robust input validation and automatically generated interactive documentation via the Swagger UI.

The API root is defined in main.py, which imports three router endpoints from analyze.py, models.py, and predict.py. Each endpoint is an independent application.

Docker container structure

Docker container structure

Endpoints

POST api/v1/analyze/json

TimeFinder Change Point Method

POST api/v1/models/{search_method}/{model}/json

img.png

POST api/v1/predict

Estimate future start/stop times based on historical data using the Prophet library

Not implemented.

Request body schema - Haystack Grid

{
  "_kind": "grid",
  "meta": {
    "hisStart": {
      "_kind": "dateTime",
      "tz": "Los_Angeles",
      "val": "2021-06-22T00:00:00-07:00"
    },
    "hisEnd": { ... }
  },
  "cols": [
    {
      "name": "ts",
      "meta": {
        "tz": "Los_Angeles"
      }
    },
    {
      "name": "v0",
      "meta": { ... }
    }
  ],
  "rows": [
    {
      "ts": {
        "_kind": "dateTime",
        "tz": "Los_Angeles",
        "val": "2021-06-21T23:55:00-07:00"
      },
      "v0": {
        "_kind": "number",
        "val": 67.01000213623047,
        "unit": "°F"
      }
    },
    {
      "ts": { ... },
      "v0": { ... }
    }
  ]
}