CMMS Integration Developer Guide

Introduction to Clockworks Analytics

Clockworks is a cloud-based fault detection and diagnostics (FDD) platform, with a global analysis engine built on 30 person-years of research and development. The comprehensive library of root-cause diagnostics is curated and updated continuously to cover all HVAC equipment and systems.

Clockworks has the ability to run in-depth diagnostics to quantify the avoidable energy costs of each identified performance issue and prioritize by impacts to energy, comfort, and maintenance on a 0-10 scale. Diagnostics can be sorted by portfolio or individual building, as well as equipment class and type of analyses. This allows a user to drill into a specific building, piece of equipment, or type of analysis.

The main goal of Clockworks is to motivate users to create and complete Tasks to resolve performance issues identified by the Diagnostic Reports.

Integrating Clockworks with a CMMS

Why we do it?

When an organization deploys Clockworks, the goal of the program is to prioritize the highest impact work which improves energy performance, comfort compliance, and equipment reliability. Integrating to the Computerized Maintenance Management System (CMMS) allows the organization to automatically create Work Orders from performance issues identified by Clockworks.

Integrating Clockworks to the CMMS results in many benefits:

  • Very little change management and training required for personnel completing the work orders

  • A large reduction of reactive work orders

  • Less effort when reactive work orders are carried out

  • Live results of performance of equipment

  • High value, proactive work order generation

  • Implement a data-driven maintenance program

  • Enrich the asset information within your CMMS

How do we do it?

Clockworks provides a comprehensive Application Programming Interface (API) which allows the CMMS to communicate with Clockworks to transfer Task data required for the integration.

The integration requires the CMMS to call the Clockworks API to retrieve new task records and create a corresponding work order. Updates to the work order should simultaneously update the Clockworks task until the work order is completed.

Creating and Updating Task Records

To begin familiarizing yourself with the task records contained within Clockworks it is helpful to login to Clockworks and understand how tasks are created and updated by users. To get started read through the Clockworks User Manual walkthrough of the Tasks feature.

Creating New Task Records

All tasks within Clockworks are created from, and associated with, a Diagnostic record. It is important to understand how the “Create Work Order” checkbox is used when creating a new task. This checkbox allows the user to optionally indicate the task record should trigger the creation of a work order within the CMMS. When calling for task records in the API, this will result in the “HasGenerateWorkOrder” field to be TRUE:

Viewing and Updating Existing Task Records

The Tasks feature within Clockworks will display all task records for the selected client organization(s). The columns displayed within the Task feature can be adjusted via the “Select Columns” option from the drop-down menu in the upper right of the table. The “Work Order ID” and “Task ID” columns should be selected to help test the integration.

Client Task ID versus Task ID

The Client Task ID is unique within a client organization, but could be duplicated across multiple clients (e.g. Task #12 could exist in many client organizations). The Task ID is unique globally across the Clockworks system and should be used to isolate task records when configuring API calls.

Introduction to the Clockworks API

The Clockworks REST API contains a rich dataset providing access to everything from interval data collected from a building’s BMS to Diagnostic records produced from the Clockworks analysis.

Review the complete Clockworks API documentation at: cw.clockworksanalytics.com/APIDocumentation

The REST API is comprised of “containers” which provide access to various resources within the API. Each container must be called upon with a unique URL when performing API calls. The CMMS integration will require accessing the following API containers:

Container Name and URL

Description

Base

https://rest.buildingsapi.net/core-base

The Base API container contains static information about the building and equipment assets contained within Clockworks.

Work Orders

https://rest.buildingsapi.net/workorders

The Work Orders API container contains Task records which are created by Clockworks users and will need to be synchronized to work orders within the CMMS.

Clockworks Asset Identifiers

When retrieving a task record from the API the first objective is to understand which equipment is impacted. The task record will contain the following unique identifiers of the equipment along with the building and client the equipment is contained within.

API Response Key

Description

CID

A unique ID for the client organization. A client organization can contain many buildings and equipment.

BID

A unique ID for the building. A building can contain many equipment.

EID

A unique ID for the equipment. A task will always be associated to a single unique equipment.

CMMS Asset Identifiers

In addition to the Clockworks unique IDs, the Task record contains several CMMS identifiers which can be utilized during the integration. All of the fields listed below are by default NULL but can be populated with the CMMS IDs during the integration and leveraged when configuring API calls.

API Response Key

Description

CMMSSiteID

A unique ID for the CMMS Site, which typically represents a campus with multiple buildings.

CMMSLocationID

A unique ID for the CMMS Location, which typically maps 1:1 to a Building in Clockworks.

CMMSAssetID

A unique ID for the CMMS Asset, which typically maps 1:1 to an Equipment in Clockworks.

Task Fields

The Task contains many fields which will map to the Work Order being created. Certain fields, especially the “Status” of the task, should be updated as the work order progresses. This is an abbreviated list of the most commonly used task fields, the full list of available fields can be found in the API Documentation.

API Response Key

Description

ID

The unique ID of the Clockworks task across the entire application. This ID will always be unique and never duplicated across any client organization.

ClientTaskID

The ID of the Clockworks task within the client organization. This ID is what the end-user will see in Clockworks and could be duplicated across different client organizations (e.g. Task #12 could be present across many client organizations).

WorkOrderID

The unique ID of the CMMS work order. This field is default NULL and must be updated by the CMMS when the work order is created.

Reporter

The email of the person that created the task.

Assignee

The email of the person the task was assigned to.

Status

The status of the task: Open, In Process, Completed, On Hold, or Cancelled.

Summary

A required text field which provides a summary of the identified performance issue. This field is auto-populated from the Clockworks diagnostic report, but can be modified by the user.

Description

An optional text field to describe the issue in more detail.

Recommendations

An optional text field to recommend corrective actions.

Actions

An optional text field to document the corrective actions that occurred.

Date Created

DateTime the task record was created within Clockworks.

Date Modified

DateTime the task record was modified within Clockworks.

Date Completed

DateTime the task record was completed within Clockworks.

HasGenerateWorkOrder

A boolean TRUE/FALSE field which indicates the user which created the task wants to also create a Work Order within the CMMS system.

HasWorkOrderID

A boolean TRUE/FALSE field which defaults to FALSE for a newly created task. When the WorkOrderID field is populated, it automatically updates to TRUE to indicate the task record is now associated to a work order.

Steps to Perform the Integration

1. Setup Your Clockworks User Account and Obtain an API Subscriber Key

The first step toward integrating Clockworks to a CMMS is setting up a user within Clockworks with a subscriber key to the REST API. This will be required to authenticate all API calls.

To request a new user account and subscriber key send an email to support@clockworksanalytics.com with the following information:

  • User’s First Name, Last Name, and Email

  • The client organization name the user will need access to

A Clockworks representative will respond and provide the following:

  1. Invitation email to setup your user account in Clockworks

  2. A 32-digit API subscriber key unique to the newly created user

  3. A 32-digit “CMMS Code” which is unique to the integration being pursued. This CMMS Code can be leverage in API calls to simplify the integration (as detailed below).

2. Setup and Test Your First API Call

Once your user account and API subscriber key have been provided you will be able to perform an API call against the buildings and equipment your user account was granted access to.

To setup your first API call ensure the following parameters are provided in the API call header:

Header Name

Header Value

Ocp-Apim-Subscription-Key

{Users’s Subscription Key}

Accept

application/vnd.api+json

Content-Type

application/json

 A simple test to confirm you’ve configured your API header’s correctly is to perform a GET call for the buildings you have access to:

API Call Example:  GET Buildings

GET

https://rest.buildingsapi.net/core-base/buildings

3. Map the CMMS Assets to Clockworks Equipment

While not technically required, the CMMS Asset Identifiers described above are available to support the mapping of the CMMS Assets to Clockworks. When performing a new integration to existing buildings and equipment in Clockworks, these fields will be initially NULL until a value is provided. All fields can be populated with any type of identifier which aligns with the format and naming conventions utilized within the CMMS.

To begin the mapping exercise, obtain a complete list of Equipment contained within Clockworks by calling the Base API container. Equipment details can be obtained via the following API call. Within the response, you will see the Equipment ID, Building ID, Equipment Name, and CMMS references available for the mapping:

API Call Example:  GET Equipment

GET

https://rest.buildingsapi.net/core-base/equipment

{

    "data": [

        {

            "type": "Equipment",

            "id": 122655,

            "links": {

                "self": "https://rest.buildingsapi.net/core-base/Equipment/122655/"

            },

            "attributes": {

                "BID": 6065,

                "EquipmentName": "Chiller-4",

                "EquipmentLocation": null,

                "SerialNumber": null,

                "Description": null,

                "EquipmentTypeID": 95,

                "IsActive": true,

                "IsVisible": true,

                "IsConfigurationComplete": true,

                "DateCreated": "2016-12-21T20:46:04.08",

                "DateModified": "2023-09-07T16:48:41.49",

                "ExternalEquipmentTypeName": null,

                "EquipmentNotes": "",

                "ManufacturerModelID": 1,

                "CMMSReferenceID": null,

                "CMMSLink": null,

                "CMMSLocationID": null,

                "CMMSSiteID": null

            },

Any number of CMMS Asset Identifiers can be used to support the integration. The most commonly leveraged field is the CMMSReferenceID, which should align 1:1 to the Clockworks equipment. Any CMMS field can be populated via a PATCH call to the Work Order API container. The response will show the updated CMMS value which was provided in the body of the API call, as shown below:

API Call Example:  PATCH Equipment

PATCH

https://rest.buildingsapi.net/core-base/equipment

Body

{

  "Resource" : {

    "EID" : "122655",

    "Update" :{

      "CMMSReferenceID" : 1234

    }

  }

}

{

    "data": [

        {

            "type": "Equipment",

            "id": 122655,

            "links": {

                "self": "https://rest.buildingsapi.net/core-base/Equipment/122655/"

            },

            "attributes": {

                "BID": 6065,

                "EquipmentName": "Chiller-4",

                "EquipmentLocation": null,

                "SerialNumber": null,

                "Description": null,

                "EquipmentTypeID": 95,

                "IsActive": true,

                "IsVisible": true,

                "IsConfigurationComplete": true,

                "DateCreated": "2016-12-21T20:46:04.08",

                "DateModified": "2023-09-07T16:48:41.49",

                "ExternalEquipmentTypeName": null,

                "EquipmentNotes": "",

                "ManufacturerModelID": 1,

                "CMMSReferenceID": "1234",

                "CMMSLink": null,

                "CMMSLocationID": null,

                "CMMSSiteID": null

            },

4. Schedule the Retrieval of New Tasks

Once the equipment mapping is complete the API calls can be configured to retrieve new task records which do NOT currently have a work order. A POST call can be leveraged to specifically target task records which should generate a new work order within the CMMS.

This call should be scheduled to run on a recurring basis to ensure newly created tasks are generating new work orders. Each client organization may have different requirements for how frequently the task records should be retrieved, but generally speaking the work orders created from a Clockworks task are not considered critical in nature and can be retrieved on an hourly or daily basis.

API Call Example:  POST Task Records

POST

https://rest.buildingsapi.net/workorders/taskrecords

Body

{

    "HasGenerateWorkOrder": "true",

    "HasWorkOrderID": "false"

}

{

    "data": [

        {

            "type": "TaskRecords",

            "id": 177030

            },

            "attributes": {

                "AEID": 17975,

                "Summary": "AHU-7 leaking valve”

                "CID": 79,

                "BID": 181,

                "EID": 21352,

                "AID": 30,

                "AnalysisStartDate": "2023-08-16T00:00:00",

                "ClientTaskID": 777,

                "CMMSSiteID": null,

                "CMMSLocationID": null,

                "CMMSAssetID": "9921352",

                "WorkOrderID": null,

                "HasGenerateWorkOrder": true,

                "HasWorkOrderID": false,

            }

        },

5. Update Task Record with Work Order ID from the CMMS

Once a work order has been created it is necessary to update the Clockworks task record with the work order ID to indicate the task record now has a corresponding work order in the CMMS. Providing the work order ID will also automatically update the “HasWorkOrderID” field to TRUE so the task record won’t be returned when rerunning the API call outlined in step 4 above.

API Call Example:  PATCH Task Records

PATCH

https://rest.buildingsapi.net/workorders/taskrecords

Body

{

  "Resource" : {

    "TaskID" : "177030",

    "Update" :{

      "WorkOrderID" : "12345"

    }

  }

}

{

    "data": [

        {

            "type": "TaskRecords",

            "id": 177030

            },

            "attributes": {

                "AEID": 17975,

                "Summary": "AHU-7 leaking valve”

                "CID": 79,

                "BID": 181,

                "EID": 21352,

                "AID": 30,

                "AnalysisStartDate": "2023-08-16T00:00:00",

                "ClientTaskID": 777,

                "CMMSSiteID": null,

                "CMMSLocationID": null,

                "CMMSAssetID": "9921352",

                "WorkOrderID": "12345",

                "HasGenerateWorkOrder": true,

                "HasWorkOrderID": true,

            }

        },

6. Update a Task Record as the Work Order Progresses

The final step is to configure updates to the task record to ensure it aligns with the latest state of the work order within the CMMS. All subsequent API calls can be performed with the CMMS code provided in step 1 and the CMMS Work Order ID applied to the task from step 5.

The example below shows a PATCH call which simultaneously updates the task status to “Completed” and populates the Action field with “Repaired Valve” to summarize the corrective actions.

API Call Example:  PATCH Task Records

PATCH

https://rest.buildingsapi.net/workorders/taskrecords

Body

{

"CMMSCode" : "dea836ff-b15b-4ecc-8d1f-XXXXXXXXXXXX",

  "Resource" : {

    "WorkOrderID" : "1234",

    "Update" :{

      "Status" : "Completed",

      "Actions" : "Repaired valve"

    }

  }

}

{

    "data": [

        {

            "type": "TaskRecords",

            "id": 177030

            },

            "attributes": {

                "AEID": 17975,

                "Summary": "AHU-7 leaking valve”

                "CID": 79,

                "BID": 181,

                "EID": 21352,

                "AID": 30,

                "AnalysisStartDate": "2023-08-16T00:00:00",

                "ClientTaskID": 777,

                "CMMSSiteID": null,

                "CMMSLocationID": null,

                "CMMSAssetID": "9921352",

                "WorkOrderID": "1234",

                "HasGenerateWorkOrder": true,

                "HasWorkOrderID": true,

                "Status": "Completed",

                "Description": null,

                "Recommendations": null,

                "Actions": "Repaired Valve",                          

            }

        },