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"
      }
    }
  }
}

requestStates({ capabilityID, startDate, endDate })

Parameters

capabilityID

(Number) (uinteger) The identifier of the Capability

startDate

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

endDate

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

Example

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

getTrips({ startDate, endDate })

Parameters

startDate

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

endDate

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

Example

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

getChargingSessions({ startDate, endDate })

Parameters

startDate

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

endDate

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

Example

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