Historical

getAvailability([, propertyNames])

Declaration

hmkit.commands.Historical.getAvailability()

Parameters

propertyNames

(optional) Array of names of the properties you want returned.

Example

// Get availability for all properties
hmkit.telematics.sendCommand(
  hmkit.commands.Historical.getAvailability(),
  accessCertificate
);
// Get availability for specific properties
hmkit.telematics.sendCommand(
  hmkit.commands.Historical.getAvailability(['states']),
  accessCertificate
);

Response

Parameters

availability(Object)
updateRate.value

(String) enum

rateLimit.value

(Number)

rateLimit.unit

(String)

appliesPer.value

(String)

Discussion

The response contains an availability object for each property, as shown in the example

Example

{
  "states": {
    "availability": {
      "updateRate": {
        "value": "trip_high"
      },
      "rateLimit": {
        "value": 64,
        "unit": "hertz"
      },
      "appliesPer": {
        "value": "vehicle"
      }
    }
  }
}

getChargingSessions({ endDate, startDate })

Parameters

endDate

(Date) (timestamp) End date for historical data query

startDate

(Date) (timestamp) Start date for historical data query

Example

hmkit.telematics.sendCommand(
  hmkit.commands.Historical.getChargingSessions({
    "endDate": "2019-09-27T08:42:30.000Z",
    "startDate": "2019-10-07T13:04:32.000Z"
  }),
  accessCertificate
);

getTrips({ endDate, startDate })

Parameters

endDate

(Date) (timestamp) End date for historical data query

startDate

(Date) (timestamp) Start date for historical data query

Example

hmkit.telematics.sendCommand(
  hmkit.commands.Historical.getTrips({
    "endDate": "2019-09-27T08:42:30.000Z",
    "startDate": "2019-10-07T13:04:32.000Z"
  }),
  accessCertificate
);

requestStates({ capabilityID, endDate, startDate })

Parameters

capabilityID

(Number) (uinteger) The identifier of the Capability

endDate

(Date) (timestamp) End date for historical data query

startDate

(Date) (timestamp) Start date for historical data query

Example

hmkit.telematics.sendCommand(
  hmkit.commands.Historical.requestStates({
    "capabilityID": 96,
    "endDate": "2019-09-27T08:42:30.000Z",
    "startDate": "2019-10-07T13:04:32.000Z"
  }),
  accessCertificate
);