Skip to content

SolarQuery API enumerated types

Matt Magoffin edited this page Nov 11, 2022 · 17 revisions

This page lists the enumerated types used throughout the SolarQuery API.

Datum types

Datum types represent the high-level types of data SolarNet collects.

  • Consumption
  • Day
  • HardwareControl
  • Power
  • Weather

Datum reading types

Datum reading types represent the ways SolarNetwork can calculate a "reading" between two datum in a stream.

Reading Type Description
Difference Find datum nearest to and not after the given start/end dates and compute the difference between them. Note the tolerance parameter is not used by this method, and the query can return datum far before the given start/end dates.
DifferenceWithin Find datum nearest to and within the given start/end dates and compute the difference between them. Note the tolerance parameter is not used by this method, and the query will never return datum before the given start date or after the given end date.
NearestDifference Find datum nearest to and not after the given start/end dates and compute the difference between them. Similar to the Difference type but the tolerance parameter is used to constrain the amount of distance in time from the start/end dates the query will consider.
CalculatedAt Derive a reading from the datum nearest before and after the given start date.
CalculatedAtDifference Derive readings like CalculatedAt for the given start and end dates and compute the difference between them.

Weather conditions

Normalized set of weather conditions.

  • Clear, ClearNight
  • FewClouds, FewCloudsNight
  • Fog
  • Overcast
  • SevereAlert
  • ShowersScattered
  • Showers
  • Snow
  • Storm

Aggregation types

  • FiveMinute
  • TenMinute
  • FifteenMinute
  • ThirtyMinute
  • Hour
  • HourOfDay
  • SeasonalHourOfDay
  • Day
  • DayOfWeek
  • SeasonalDayOfWeek
  • Week
  • Month
  • Year
  • RunningTotal

Hour of day

For the HourOfDay type, the timestamps in returned objects will not have any meaning other than providing the associated hour of the day the result represents (using a Gregorian calendar). For the SeasonalHourOfDay type, the timestamps in returned objects will be further qualified with a month representing the start of a season, with seasons defined as:

  1. Dec, Jan, Feb: northern hemisphere winter, southern summer
  2. Mar, Apr, May: northern hemisphere spring, southern autumn
  3. Jun, Jul, Aug: northern hemisphere summer, southern winter
  4. Sep, Oct, Nov: northern hemisphere autumn, southern spring

Day of week

For the DayOfWeek type, the dates in returned objects will not have any meaning other than providing the associated day of the week the result represents (using a Gregorian calendar). For the SeasonalDayOfWeek type, the dates in returned objects will be further qualified with a month representing the start of a season, with seasons as defined previously.

Week of year

For the WeekOfYear type, the dates in returned objects will not have any meaning other than providing the associated week of the year the result represents (using a Gregorian calendar), using Monday as the start of a week.

Running total

For the RunningTotal time, a single row will be returned with an aggregate of all data up to the specified end date. At least one source ID must be provided. A start date is not supported. If no end date is specified, the current time is used. The timestamps returned reflect the end date used.

Combining types

The combining type is used when combining node IDs or source IDs into virtual IDs. This type represents the aggregation style to perform on the combined values. If not specified and not otherwise noted, the Sum type is assumed.

  • Average
  • Difference
  • Sum

⚠️ Note that for the Difference type the order of the combined values is significant.

Clone this wiki locally