Documentation

← Back to site

Fetch usage data

Last updated on May 18, 2015 11:26

This method allows you to fetch detailed usage information for a device at various resolutions.

URL

/api/v1/subdevices/get_data

Parameters

  • id - the ID of the subdevice
  • data_type - The type of data to fetch, for example 'watts' or 'reported_temperature'
  • resolution - The required resolution. See below for further information
  • start_time - The start of the time period to search for data
  • end_time - The end of the time period to search for data
  • limit - The maximum number of data points to return, starting with the most recent

It is worth noting that the most recent data point can always be retrieved by setting resolution to "instant", end_time to the current time, and limit to 1.

Resolution

For the following data types, data is available at 3 resolutions - instant, hourly, daily - each being an average of that period:

  • watts
  • reported_temperature

To reduce data transfer requirements, an additional resolution of "monthly" is available. Unlike other resolutions, this is aggregated on the server and represents a sum of daily data.

Response

The server will respond with an array of arrays, ordered by date/time with the most recent items first. Within each array item, the first item is a timestamp and the second is the data.