Demand Response Enrollment and Event Issue Guide

This is an example process of enrolling a device into a program and executing a Demand Response Event on that device.

Enrollment

This guide assumes you've been through the OAuth2 Authorization Code flow with a Lyric account, and you've been able to obtain an OAuth2 Client Credentials Token.

Enrolling a user into a program.

Use your OAuth2 Client Credentials token in the Authorization header. Request:

curl -X PUT -H "Authorization: Bearer accessTokenHere" -H "userId: 123456" -H "Content-Type: application/json" -d "{"DeviceId": "LCC-00D02D64FC14", "DeviceMac": "00D02D64FC14", "LocationId": "1" }" api.honeywell.com/v1/demandresponse/enrollment?apikey={apikey}

Response snippet:

{
	"Id": "c4029bb9-4549-43c2-9f42-b3e3bbba61ce",
	"uri": "/Enrollment/c4029bb9-4549-43c2-9f42-b3e3bbba61ce"
}

Issue Event

Issue an event for list of devices

Request:

curl -X POST -H "Authorization: Bearer accessTokenHere" -H "Content-Type: application/json" -d "{  "startTime": "2017-01-19T09:48:02.9558319Z",  "isOptOutable": true,  "isLocallyOptOutable": true,  "randomizationInterval": 0,  "phase1": {    "duration": "00:01:00",    "heatDelta": 1.0  },"devices": [ "LCC-00D02D64FC14"  ]}" api.honeywell.com/v1/demandresponse/event/{eventId}?apikey={apikey}

Request body example:

    {
  "startTime": "2017-01-19T09:48:02.9558319Z",
  "isOptOutable": true,
  "isLocallyOptOutable": true,
  "randomizationInterval": 0,
  "phase1": {
    "duration": "00:01:00",
    "heatDelta": 1.0
  },
  "devices": [
    "LCC-00D02D64FC14"
  ]
}

This will run a Duty Cycle event for one minute for the DeviceIDs listed.

A successful response will look like:

    {
    	"issuerId": "[your client id here]",
    	"eventId": "[your event id here]"
    }