Get time series data

GET/homes/{homeId}/smartModules/{moduleId}/timeSeries/{seriesId}/data

Base URL: https://api.tinkermode.com

Get the time series data specified by series ID. Use the begin and end parameters to fetch values by time range, with the proper time resolution automatically applied. Use the ts and limit parameters to fetch a specific number of data points before or after a point in time. When the optional param tsEnd is provided, the data points will be fetched from ts to tsEnd.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain a user, service account, or project API key.

Path parameters

NameTypeRequiredConstraintsDescription
homeIdintegerYesThe unique id for a home.
moduleIdstringYesThe unique id for a smart module.
seriesIdstringYesSeries ID. It must be unique per home.

Query parameters

NameTypeRequiredConstraintsDescription
aggregationstringNoAggregation function. The string must be either 'avg', 'min', 'max', 'sum' or 'count'. 'avg' is chosen if not provided.
beginstringNoThe beginning of the time series data. The format follows RFC3339.
endstringNoThe end of the time series data. The format follows RFC3339.
limitintegerNoIf positive, this is the maximum number of data points at and after ts to be returned. If negative, this is the maximum number of data points before ts to be returned. When tsEnd is specified, the positive limit should have ts before tsEnd and the negative limit should have ts after tsEnd.
resolutionstringNoThe resolution of time bucket. The string must be either '5sec', '15sec', '1min', '10min', '1hour', '1day', '1week', '1month'. Decided automatically based on the timespan between "begin" and "end" parameters if not provided.
skipNullRecordsbooleanNoIf true, skip any records whose values are all null. False by default.
tsstringNoThe point in time (in RFC3339) to fetch data points from.
tsEndstringNoThe point in time (in RFC3339) to fetch data points to.

Responses

200 The requested time series data points are returned.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
aggregationstringNoread-only (server-generated); one of: avg, min, max, sum, countAggregation method used.
beginstringNoread-only (server-generated)The beginning of the time series data. The format follows RFC3339.
dataarrayNoread-only (server-generated)Time series data. Each item is an array as tuple and the first item is timestamp of the value in RFC3339 format and the second is the value.
endstringNoread-only (server-generated)The end of the time series data. The format follows RFC3339.
limitintegerNoread-only (server-generated)The maximum number of data points to be fetched.
resolutionstringNoread-only (server-generated); one of: 1min, 10min, 1hour, 1day, 1week, 1monthAggregation bucket resolution. Its value depends on the time span of the query.
seriesIdstringNoread-only (server-generated); pattern: ^[a-zA-Z0-9]([a-zA-Z0-9\-_\:]*[a-zA-Z0-9])*$Time Series ID. Must be unique within each home. Must be 1 or more alphanumeric characters; dashes ('-'), underscores ('_'), and colons (':') may be used after the first character but must be followed by 1+ alphanumeric characters.
tsstringNoread-only (server-generated)The point in time (in RFC3339) from which data points were fetched.

Response example

{
  "aggregation": "avg",
  "begin": "2019-04-11T07:51:46.712Z",
  "data": [
    [
      "2019-04-11T00:00:00Z",
      22.97349639133924
    ],
    [
      "2019-04-12T00:00:00Z",
      22.916217542079057
    ],
    [
      "2019-04-13T00:00:00Z",
      21.939217256214157
    ],
    [
      "2019-04-14T00:00:00Z",
      21.668999574649146
    ],
    [
      "2019-04-15T00:00:00Z",
      23.01144695453247
    ],
    [
      "2019-04-16T00:00:00Z",
      23.877712361878466
    ],
    [
      "2019-04-17T00:00:00Z",
      24.251540345449843
    ],
    [
      "2019-04-18T00:00:00Z",
      23.900341664030382
    ],
    [
      "2019-04-19T00:00:00Z",
      23.579976112920807
    ]
  ],
  "end": "2020-01-29T01:26:08.101Z",
  "resolution": "1day",
  "seriesId": "room1-temperature"
}

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

404 The requested data does not exist or is not accessible.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.