SolarQuery API enumerated types - SolarNetwork/solarnetwork GitHub Wiki
This page lists the enumerated types used throughout the SolarQuery API.
Datum types represent the high-level types of data SolarNet collects.
Consumption
Day
HardwareControl
Power
Weather
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. |
Normalized set of weather conditions.
-
Clear
,ClearNight
-
FewClouds
,FewCloudsNight
Fog
Overcast
SevereAlert
ShowersScattered
Showers
Snow
Storm
FiveMinute
TenMinute
FifteenMinute
ThirtyMinute
Hour
HourOfDay
SeasonalHourOfDay
HourOfYear
Day
DayOfWeek
SeasonalDayOfWeek
DayOfYear
Week
WeekOfYear
Month
Year
RunningTotal
The various X of Y style aggregation types like HourOfDay
or DayOfWeek
all return dates whose
components are in the UTC time zone, but represent the local time zone of the datum stream. For
example here is a datum returned from an HourOfYear
query:
{
"created": "1996-01-11 17:00:00Z",
"nodeId": 179,
"sourceId": "/meter/1",
"localDate": "1996-01-11",
"localTime": "17:00",
"watts": 6476.71428,
"current": -2.27423,
"voltage": 230.20171,
"frequency": 49.9926,
"powerFactor": 0.9999,
"apparentPower": 6245.6428,
"reactivePower": 2.2857,
"wattHours": 1931,
}
The created
date is encoded as 1996-01-11 @ 17:00 in UTC which means the datum represents the
aggregate value for 11 Jan @ 17:00 in the stream local time zone across all years in the query
range.
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) in the
UTC time zone. 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:
- Dec, Jan, Feb: northern hemisphere winter, southern summer
- Mar, Apr, May: northern hemisphere spring, southern autumn
- Jun, Jul, Aug: northern hemisphere summer, southern winter
- Sep, Oct, Nov: northern hemisphere autumn, southern spring
For the HourOfYear
type, the dates in returned objects will not have any meaning other than
providing the associated month of the year, day of the month, and hour of the day the result
represents (using a Gregorian calendar) in the UTC time zone.
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) in the
UTC time zone. 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 for
HourOfDay
.
For the DayOfYear
type, the dates in returned objects will not have any meaning other than
providing the associated month of the year and day of the month the result represents (using a
Gregorian calendar) in the UTC time zone.
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) in
the UTC time zone, using Monday as the start of a week.
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.
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 theDifference
type the order of the combined values is significant.