Cost & Consumption for Single Device

/connect/user/{user-id}/account/{account-id}/location/{location-id}/device/{device-id}/consumption/{resolution}

Returns cost and consumption information about a single device in a user's Home Area Network (HAN).

Given the id of a HAN device that can measure consumption data, such as the Tendril Load Control Switch (30 AMP relay), the ThinkEco Modlet SE, or the Jetlun Panel Meter and Jetlun Current Transducer devices, this call returns the cost and consumption data captured by the user's device. Returns a 404 response code if the user has no HAN devices. Note: In the Try It section, select a sample user who has HAN devices: andrew.wood@tendril.com, kim.deal@tendril.com, or nash.kato@tendril.com.

GET

Given the id of a HAN device that can measure consumption data, such as the Tendril Load Control Switch (30 AMP relay), the ThinkEco Modlet SE, or the Jetlun Panel Meter and Jetlun Current Transducer devices, this call returns the cost and consumption data captured by the user's device.

→ Request

/connect/user//account//location//device//consumption/;from=;to=;limit-to-latest=;include-submetering-devices=
GET Reset

→ Request

GET /connect/user/current-user/account/default-account/location/default-location/device/804f58aaaaaa0010/consumption/MONTHLY;from=2011-11-01T00:00:00-07:00;to=2012-01-01T00:00:00-07:00

← Response
200 OK

{
  "@toDate": "2011-12-31T00:00:00.000+00:00",
  "@fromDate": "2011-11-01T00:00:00.000+00:00",
  "@deviceId": "804f58aaaaaa0010",
  "cost": "7.36",
  "consumption": 81.82654,
  "componentList": {
    "component": [
      {
        "@actualReadingsCount": 24,
        "@toDate": "2011-11-01T06:00:00.000+00:00",
        "@fromDate": "2011-11-01T00:00:00.000+00:00",
        "cost": "0.05",
        "consumption": 0.57609,
        "componentList": {
          "component": [
            {
              "@peak": false,
              "@rateKey": "A",
              "cost": "0.03",
              "consumption": 0.40823
            },
            {
              "@peak": true,
              "@rateKey": "B",
              "cost": "0.02",
              "consumption": 0.16786
            }
          ]
        }
      },
      {
        "@actualReadingsCount": 2717,
        "@toDate": "2011-12-01T07:00:00.000+00:00",
        "@fromDate": "2011-11-01T06:00:00.000+00:00",
        "cost": "4.07",
        "consumption": 44.73632,
        "componentList": {
          "component": [
            {
              "@peak": false,
              "@rateKey": "A",
              "cost": "2.66",
              "consumption": 33.36507
            },
            {
              "@peak": true,
              "@rateKey": "B",
              "cost": "0.74",
              "consumption": 6.65634
            },
            {
              "@peak": true,
              "@rateKey": "C",
              "cost": "0.67",
              "consumption": 4.71491
            }
          ]
        }
      },
      {
        "@actualReadingsCount": 2841,
        "@toDate": "2011-12-31T00:00:00.000+00:00",
        "@fromDate": "2011-12-01T07:00:00.000+00:00",
        "cost": "3.24",
        "consumption": 36.51413,
        "componentList": {
          "component": [
            {
              "@peak": false,
              "@rateKey": "A",
              "cost": "2.22",
              "consumption": 27.8952
            },
            {
              "@peak": true,
              "@rateKey": "B",
              "cost": "0.54",
              "consumption": 5.17171
            },
            {
              "@peak": true,
              "@rateKey": "C",
              "cost": "0.48",
              "consumption": 3.44721
            }
          ]
        }
      }
    ]
  }
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<deviceCostAndConsumption xmlns="http://platform.tendrilinc.com/tnop/extension/ems" 
  xmlns:ns2="http://iec.ch/TC57/2009/MeterReadings#" 
  xmlns:ns3="http://platform.tendrilinc.com/tnop/extension/ems/logicalgroup" 
  xmlns:ns4="http://platform.tendrilinc.com/tnop/extension/ems/buildingmodel" 
  toDate="2011-12-31T00:00:00.000+00:00" fromDate="2011-11-01T00:00:00.000+00:00" deviceId="804f58aaaaaa0010">
  <cost>7.36</cost>
  <consumption>81.82654</consumption>
  <component actualReadingsCount="24" toDate="2011-11-01T06:00:00.000+00:00" fromDate="2011-11-01T00:00:00.000+00:00">
    <cost>0.05</cost>
    <consumption>0.57609</consumption>
    <component peak="false" rateKey="A">
      <cost>0.03</cost>
      <consumption>0.40823</consumption>
    </component>
    <component peak="true" rateKey="B">
      <cost>0.02</cost>
      <consumption>0.16786</consumption>
    </component>
  </component>
  <component actualReadingsCount="2717" toDate="2011-12-01T07:00:00.000+00:00" fromDate="2011-11-01T06:00:00.000+00:00">
    <cost>4.07</cost>
    <consumption>44.73632</consumption>
    <component peak="false" rateKey="A">
      <cost>2.66</cost>
      <consumption>33.36507</consumption>
    </component>
    <component peak="true" rateKey="B">
      <cost>0.74</cost>
      <consumption>6.65634</consumption>
    </component>
    <component peak="true" rateKey="C">
      <cost>0.67</cost>
      <consumption>4.71491</consumption>
    </component>
  </component>
  <component actualReadingsCount="2841" toDate="2011-12-31T00:00:00.000+00:00" fromDate="2011-12-01T07:00:00.000+00:00">
    <cost>3.24</cost>
    <consumption>36.51413</consumption>
    <component peak="false" rateKey="A">
      <cost>2.22</cost>
      <consumption>27.89520</consumption>
    </component>
    <component peak="true" rateKey="B">
      <cost>0.54</cost>
      <consumption>5.17171</consumption>
    </component>
    <component peak="true" rateKey="C">
      <cost>0.48</cost>
      <consumption>3.44721</consumption>
    </component>
  </component>
</deviceCostAndConsumption>
ParamSummaryValuesDefault
user-id
Type: string
Style: template
Required

The user's ID, which was generated by Tendril Connect when the user record was added to the database.
For example, user id 647 was assigned to the 647th user added.

A valid value is current-user, which is the user that you used for authorization in the header of the REST call. See the Notes tab for information about which HAN user to select on the Try It form.

account-id
Type: string
Style: template
Required

The user's account ID. Intended for future use when each consumer may have more than one account.

A valid value is default-account, which is associated with the currently authenticated user.

location-id
Type: string
Style: template
Required

The user's location ID. Intended for future use when each consumer may have more than one location.

A valid value is default-location, which is associated with the currently authenticated user.

device-id
Type: string
Style: template
Required

The unique, 16-character EUI-64 identifier assigned to the device for which you want to retrieve its consumption data. If you do not know whether a user has HAN devices and the id for a specific device, use the call described in the List User Devices topic.

For andrew.wood, 804f58aaaaaa0358
For kim.deal, 804f58aaaaaa0370
For nash.kato, 804f58aaaaaa0360

resolution
Type: string
Style: template
Required

The resolution of the consumption data to return.

QUARTER_HOURLY, HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY and RANGE. The provided value must be upper-case.

No default value.
from
Type: datetime
Style: matrix

The start date and time for the returned data.

Date and time in this format: YYYY-MM-DD"T"hh:mm:ssZ, where Z is the time zone designator.

The first available record.
to
Type: datetime
Style: matrix

The end date and time for the returned data.

Date and time in this format: YYYY-MM-DD"T"hh:mm:ssZ, where Z is the time zone designator.

The last available record.
limit-to-latest
Type: string
Style: matrix

The total number of records to be returned.

Integers greater than zero.

All records in the date range, up to the system limit.
include-submetering-devices
Type: boolean
Style: matrix

Whether to include the data for each submetering device found in the HAN, such as a ThinkEco Modlet SE smart outlet, or a Tendril Load Control Switch.

true or false

false
deviceCostAndConsumptionroot element

Top level element. Attributes include the date range and the deviceId.

cost  floatchild of deviceCostAndConsumption

Total cost for the entire range.

consumption  floatchild of deviceCostAndConsumption

Total consumption for the entire range in kWh.

componentchild of deviceCostAndConsumption

Cost and consumption data point.

cost  floatchild of component

Cost for this range.

consumption  floatchild of component

Consumption for this range in kWh.

component  floatchild of component

Cost and consumption broken down by rates.

cost  floatchild of component

Cost for this rate.

consumption  floatchild of component

Consumption for this rate.

subMeteringDetailschild of deviceCostAndConsumption

Information about submetering devices, if requested.

deviceCostAndConsumptionchild of subMeteringDetails

Device cost and consumption data.

cost  floatchild of deviceCostAndConsumption

Total cost for this device and range.

consumption  floatchild of deviceCostAndConsumption

Total consumption for this device and range.

componentchild of deviceCostAndConsumption

Cost and consumption data point.

cost  floatchild of component

Cost for this device and rate.

consumption  floatchild of component

Consumption for device and rate.

Returns a 404 response code if the user has no HAN devices. On the Try It form, select a sample user who has HAN devices, and use one of the following device IDs:
andrew.wood@tendril.com: 804f58aaaaaa0358
kim.deal@tendril.com: 804f58aaaaaa0370
nash.kato@tendril.com: 804f58aaaaaa0360