Skip to content
Matt Magoffin edited this page Aug 8, 2017 · 1 revision

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

Bulk upload XML datum

Note this endpoint is deprecated and will be removed at some point. The JSON variant should be used instead.

This endpoint accepts a simple XML payload using a root <bulkDatumUpload> element. Within that element can be any number of elements, each one representing a single supported datum type. Each data type element supports specific attributes representative of that type.

Request

POST /bulkCollector.do
Content-Type text/xml
Content-Encoding Optional; supports gzip.

An example XML document is:

<bulkDatumUpload>
	<PowerDatum watts="862" wattHourReading="109298309"/>
	<ConsumptionDatum created="2013-01-01 13:01:22.233Z" watts="862" wattHourReading="109298309"/>
	<InstructionStatus created="2013-01-01 13:01:22.233Z" instructionId="34982379" status="Completed"/>
</bulkDatumUpload>

Common attributes

The following table contains the attributes that are common to all datum elements:

created timestamp The creation date of the datum, generally representing the time and date the reading was taken.
locationId integer The ID of a SolarNetwork location, used to associate the datum with a place. Not all datums support this attribute.
sourceId string A node-unique value used to distinguish two elements of the same type. This allows a single node to collect `PowerDatum` readings from more than one device.

Consumption datum

A <ConsumptionDatum> element represents electric power consumption. The supported attributes are:

watts integer An instantaneous watt reading.
wattHourReading decimal A total cumulative watt hour reading.

Example element

<ConsumptionDatum created="2013-01-01 13:01:22.233Z" watts="862" wattHourReading="109298309"/>

Day datum

A <DayDatum> element represents daily conditions such as sunrise and sunset. The locationId attribute is required.

day date The date, in YYYY-MM-dd pattern, in the node's local time zone.
sunrise time The time of sunrise, in HH:mm pattern, in the node's local time zone.
sunset time The time of sunrise, in HH:mm pattern, in the node's local time zone.

Example element

<DayDatum day="2013-01-01" sunrise="06:10" sunset="20:23"/>

HardwareControl datum

A <HardwareControlDatum> element represents the value of a control on the node. The sourceId value is required. See also NodeControlInfo, which is mapped into this object.

integerValue integer An integer value of the control.
floatValue decimal A decimal value of the control.

Example element

<HardwareControlDatum created="2013-01-01 13:01:22.233Z" integerValue="1"/>

InstructionStatus

A <InstructionStatus> element is a special datum that is used to relay the status of an instruction previously requested by SolarNetwork.

instructionId integer The ID of the instruction.
status string The instruction status, one of Received, Executing, Completed, or Declined.

Example element

<InstructionStatus created="2013-01-01 13:01:22.233Z" instructionId="34982379" status="Completed"/>

NodeControlInfo

A <NodeControlInfo> element is a special datum that gets mapped into a HardwareControlDatum object by SolarIn.

controlId string The ID of the control. By convention these use path-like values, such as /power/switch/1. This is mapped into the sourceId attribute.
propertyName string If provided, this is appended to the controlId value after a semicolon when mapped to the sourceId attribute.
value string The value of the control. Depending on the type type attribute this will be mapped to the integerValue or floatValue attribute.
type string One of Boolean, Float, Integer, or Percent. Boolean values are mapped to the integerValue attribute using 1 for true or yes and 0 for all other values. Integer values are mapped directly to the integerValue attribute. Float and Percent values are mapped directly to the floatValue attribute.

Example element

<NodeControlInfo created="2013-01-01 13:01:22.233Z" controlId="/power/switch/1" value="true" type="Boolean"/>

Power datum

A <PowerDatum> element represents electric power generation. The supported attributes are:

watts integer An instantaneous watt reading.
batteryVolts decimal An instantaneous battery volt reading.
batteryAmpHours decimal An instantaneous battery amp-hours reading, for the available energy in the battery.
wattHourReading decimal A total cumulative watt hour reading.
KWattHoursToday decimal A daily cumulative watt hour reading. This is expected to reset to zero each day, and is an alternative to the `wattHourReading` attribute.

Example element

<PowerDatum created="2013-01-01 13:01:22.233Z" watts="862" wattHourReading="109298309"/>

Price datum

A <PriceDatum> element represents a monetary cost. The locationId attribute is required and represents a specific price location registered with SolarNetwork. The supported attributes are:

price decimal The price, for the associated price location.

Example element

<PriceDatum created="2013-01-01 13:01:22.233Z" price="12.57"/>

Weather datum

A <WeatherDatum> element represents weather conditions. The locationId attribute is required.

infoDate timestamp The date the weather is current of. In many cases weather readings might be from sources that do not update their data as frequently as samples are taken, so this date is used to identify when the data is valid for.
temperatureCelsius decimal The air temperature, in Celsius.
humidity decimal The relative humidity, as an integer percentage (0 - 100).
barometricPressure decimal The barometric pressure, in millibars.
barometerDelta decimal The barometric pressure, in millibars.
skyConditions string The sky conditions, using general text. For example clear or rain.
condition string The sky condition for the day, using normalized weather condition values.
dewPoint decimal The dew point.
uvIndex integer The UV index.
visibility decimal The visibility, in kilometers.

Example element

<WeatherDatum infoDate="2013-01-01 13:01:22.233Z" skyConditions="partly cloudy" temperatureCelsius="19.2"/>
Clone this wiki locally