Skip to content

SolarQuery API legacy

Matt Magoffin edited this page Aug 16, 2017 · 1 revision

This document describes the legacy SolarQuery API endpoints that are still supported by SolarNet, but will be removed at some point in the future. Refer to the supported SolarQuery API documentation for more information.

Response formats

SolarQuery supports different response data formats, which are based on the Accept HTTP header used in the request. The supported formats, and their associated Accept header values, are:

  • JSON - application/json
  • XML - text/xml
  • CSV - text/csv

Aggregated datum query

This method returns time-aggregated datum values. Note this endpoint is deprecated in favor of the Datum list endpoint, and will be removed at some point.

See Aggregation types for possible aggregate types.

Request

GET /api/v1/{pub,sec}/datum/query
nodeId The ID of the SolarNode
sourceIds An optional list of source IDs to restrict the results to. This parameter may be provided multiple times to filter the results to multiple source IDs. If omitted, data for all available sources will be returned.
type The datum type to query for.
startDate The inclusive starting date to use in the query, in YYYY-MM-dd or YYYY-MM-ddTHH:mm patterns. The date must be provided in the UTC time zone.
endDate The exclusive ending date to use in the query, in YYYY-MM-dd or YYYY-MM-ddTHH:mm patterns. The date must be provided in the UTC time zone.
aggregate The aggregation type. SolarNet may or may not honor the requested aggregation type. If the requested time span is very large, for example, SolarNet might restrict the aggregate type to Month.

Example response

{
  "success": true,
  "data": [
    {
      "sourceId": "Main",
      "watts": 397,
      "wattHours": 9420,
      "cost": 0.28233625036682947,
      "currency": "NZD",
      "localDate": "2013-01-01",
      "localTime": "00:00"
    },
    {
      "sourceId": "Main",
      "watts": 398,
      "wattHours": 9434,
      "cost": 0.3785878495508431,
      "currency": "NZD",
      "localDate": "2013-01-02",
      "localTime": "00:00"
    }
  ]
}

Response object

The response contains an array of aggregated datum objects. All datum objects contain the following properties:

sourceId string The datum source ID.
localDate string The date of the datum, in a YYYY-MM-dd pattern in the node's time zone.
localTime string The time of the datum, in a HH:mm pattern in the node's time zone.

Consumption response object

The following additional properties will be returned:

watts number The average instantaneous watts for the aggregated datum.
wattHours number The overall watt hours for the aggregated datum.

Power response object

The following additional properties will be returned:

watts number The average instantaneous watts for the aggregated datum.
wattHours number The overall watt hours for the aggregated datum.
Clone this wiki locally