Follow

GET data/graph

Returns historical data for graphing.

URL

http://application.deckmonitoring.com/data/graph

Request

Required parameters

target_type: node|location
target_id: The id of the system node or location.
range: day|multiday*|week|month|year|lifetime|custom**
data_types: A comma delimited list of data types (eg: "power", "cumulative_generation").
token: A security token supplied by DECK.

* A range of "multiday" requires the "num_days" parameter below.
** A "custom" range requires the "range_start" and "range_end" parameters below.

Optional parameters

raw: If true, returns the data in "as reported" time intervals. False by default.
num_days: Number of days to include in the request (only use if range is "multiday").
range_start: The beginning date/time of a custom range request.
range_end: The end date/time of a custom range request.

Response

An object with the following parameters:

interval: none|hour|day|year
data_sets: An array of data set objects.

The data set objects have the following parameters:

data_type_id: Id of the data type. 
data_type_label: A display name for the data type.
data_type_unit: A display name for the data type unit.
node_id: The id of the node that the data originated from.
target_node_id: The id of the requested node.
reported_as: cumulative|average|maximum|minimum
series: An array of points. Each point is an array where the first value is a date/time string and the second is the value (eg: ["2010-04-02", 100.82]).

Example Usage

http://application.deckmonitoring.com/data/graph.json?range=week&target_type=node&target_id=1&data_types=generation,power,irradiance&token=12345678901234567890

Example Response (truncated)

{
"interval": "day",
"data_sets": [
   {
       "data_type_label": "generation",
       "data_type_unit": "kWh",
       "target_node_id": 1,
       "node_id": 1,
       "reported_as": "cumulative",
       "series": [
           [
               "2010-04-02",
               100.82
           ],
           ...
           [
               "2010-04-08",
               103.79
           ]
       ],
       "data_type_id": 1
   },
   {
       "data_type_label": "power",
       "data_type_unit": "kW",
       "target_node_id": 1,
       "node_id": 1,
       "reported_as": "average",
       "series": [
           [
               "2010-04-02",
               3.95070833333333
           ],
           ...
           [
               "2010-04-08",
               5.83735
           ]
       ],
       "data_type_id": 2
   }
]
}
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk