Usage

getUsage([, propertyNames])

Declaration

hmkit.commands.Usage.getUsage()

Parameters

propertyNames

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

Returns

UsageResponse

Example

hmkit.telematics.sendCommand(
  hmkit.commands.Usage.getUsage(),
  accessCertificate
);

UsageResponse

Parameters

averageWeeklyDistance(Object)
data.value

(Number) (length) Average weekly distance

timestamp

(Date)

averageWeeklyDistanceLongRun(Object)
data.value

(Number) (length) Average weekyl distance over long term

timestamp

(Date)

accelerationEvaluation(Object)
data.value

(Number) (double) Acceleration evaluation percentage

timestamp

(Date)

drivingStyleEvaluation(Object)
data.value

(Number) (double) Driving style evaluation percentage

timestamp

(Date)

drivingModesActivationPeriods(Object)
data.value

(Array)

timestamp

(Date)

drivingModesEnergyConsumptions(Object)
data.value

(Array)

timestamp

(Date)

lastTripEnergyConsumption(Object)
data.value

(Number) (energy) Energy consumption in the last trip

timestamp

(Date)

lastTripFuelConsumption(Object)
data.value

(Number) (volume) Fuel consumption in the last trip

timestamp

(Date)

lastTripElectricPortion(Object)
data.value

(Number) (double) Portion of the last trip used in electric mode

timestamp

(Date)

lastTripAverageEnergyRecuperation(Object)
data.value

(Number) (energy_efficiency) Energy recuperation rate for last trip

timestamp

(Date)

lastTripBatteryRemaining(Object)
data.value

(Number) (double) Battery % remaining after last trip

timestamp

(Date)

lastTripDate(Object)
data.value

(Date) (timestamp) The last trip date

timestamp

(Date)

averageFuelConsumption(Object)
data.value

(Number) (fuel_efficiency) Average fuel consumption for current trip

timestamp

(Date)

currentFuelConsumption(Object)
data.value

(Number) (fuel_efficiency) Current fuel consumption

timestamp

(Date)

odometerAfterLastTrip(Object)
data.value

(Number) (length) Odometer after the last trip

timestamp

(Date)

safetyDrivingScore(Object)
data.value

(Number) (double) Safety driving score as percentage

timestamp

(Date)

rapidAccelerationGrade(Object)
data.value

(String) (enum) Grade given for rapid acceleration over time

timestamp

(Date)

rapidDecelerationGrade(Object)
data.value

(String) (enum) Grade given for rapid deceleration over time

timestamp

(Date)

lateNightGrade(Object)
data.value

(String) (enum) Grade given for late night driving over time

timestamp

(Date)

distanceOverTime(Object)
data.value

(Object) Distance driven over a given time period

timestamp

(Date)

electricConsumptionRateSinceStart(Object)
data.value

(Number) (energy_efficiency) Electric energy consumption rate since the start of a trip

timestamp

(Date)

electricConsumptionRateSinceReset(Object)
data.value

(Number) (energy_efficiency) Electric energy consumption rate since a reset

timestamp

(Date)

electricDistanceLastTrip(Object)
data.value

(Number) (length) Distance travelled with electricity in last trip

timestamp

(Date)

electricDistanceSinceReset(Object)
data.value

(Number) (length) Distance travelled with electricity since reset

timestamp

(Date)

electricDurationLastTrip(Object)
data.value

(Number) (duration) Duration of travelling using electricity during last trip

timestamp

(Date)

electricDurationSinceReset(Object)
data.value

(Number) (duration) Duration of travelling using electricity since reset

timestamp

(Date)

fuelConsumptionRateLastTrip(Object)
data.value

(Number) (fuel_efficiency) Liquid fuel consumption rate during last trip

timestamp

(Date)

fuelConsumptionRateSinceReset(Object)
data.value

(Number) (fuel_efficiency) Liquid fuel consumption rate since reset

timestamp

(Date)

averageSpeedLastTrip(Object)
data.value

(Number) (speed) Average speed during last trip

timestamp

(Date)

averageSpeedSinceReset(Object)
data.value

(Number) (speed) Average speed since reset

timestamp

(Date)

fuelDistanceLastTrip(Object)
data.value

(Number) (length) Distance travelled with (liquid) fuel during last trip

timestamp

(Date)

fuelDistanceSinceReset(Object)
data.value

(Number) (length) Distance travelled with (liquid) fuel since reset

timestamp

(Date)

drivingDurationLastTrip(Object)
data.value

(Number) (duration) Duration of last trip

timestamp

(Date)

drivingDurationSinceReset(Object)
data.value

(Number) (duration) Duration of travelling since reset

timestamp

(Date)

ecoScoreTotal(Object)
data.value

(Number) (double) Overall eco-score rating

timestamp

(Date)

ecoScoreFreeWheel(Object)
data.value

(Number) (double) Eco-score rating for free-wheeling

timestamp

(Date)

ecoScoreConstant(Object)
data.value

(Number) (double) Eco-score rating constant

timestamp

(Date)

ecoScoreBonusRange(Object)
data.value

(Number) (length) Eco-score bonus range

timestamp

(Date)

tripMeters(Object)
data.value

(Array) Independent meter that can be reset at any time by the driver

timestamp

(Date)

Example

{
  "averageWeeklyDistance": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 666.6,
      "unit": "kilometers"
    }
  },
  "averageWeeklyDistanceLongRun": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 777.7,
      "unit": "kilometers"
    }
  },
  "accelerationEvaluation": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.7
    }
  },
  "drivingStyleEvaluation": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.88
    }
  },
  "drivingModesActivationPeriods": [
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "regular"
        },
        "period": {
          "value": 0.2
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "eco"
        },
        "period": {
          "value": 0.3
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "sport"
        },
        "period": {
          "value": 0.1
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "sport_plus"
        },
        "period": {
          "value": 0.1
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "ecoPlus"
        },
        "period": {
          "value": 0.3
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "comfort"
        },
        "period": {
          "value": 0
        }
      }
    }
  ],
  "drivingModesEnergyConsumptions": [
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "regular"
        },
        "consumption": {
          "value": 20.2,
          "unit": "kilowatt_hours"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "eco"
        },
        "consumption": {
          "value": 33.2,
          "unit": "kilowatt_hours"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "sport"
        },
        "consumption": {
          "value": 54.3,
          "unit": "kilowatt_hours"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "sport_plus"
        },
        "consumption": {
          "value": 64.8,
          "unit": "kilowatt_hours"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "ecoPlus"
        },
        "consumption": {
          "value": 18,
          "unit": "kilowatt_hours"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "drivingMode": {
          "value": "comfort"
        },
        "consumption": {
          "value": 33.7,
          "unit": "kilowatt_hours"
        }
      }
    }
  ],
  "lastTripEnergyConsumption": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 101.3,
      "unit": "kilowatt_hours"
    }
  },
  "lastTripFuelConsumption": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 22.5,
      "unit": "liters"
    }
  },
  "lastTripElectricPortion": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.7
    }
  },
  "lastTripAverageEnergyRecuperation": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 5.68,
      "unit": "kwh_per_100_kilometers"
    }
  },
  "lastTripBatteryRemaining": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.5
    }
  },
  "lastTripDate": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "2018-10-17T12:34:58.000Z"
    }
  },
  "averageFuelConsumption": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 6.5,
      "unit": "liters_per_100_kilometers"
    }
  },
  "currentFuelConsumption": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 7.5,
      "unit": "liters_per_100_kilometers"
    }
  },
  "odometerAfterLastTrip": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 95632,
      "unit": "kilometers"
    }
  },
  "safetyDrivingScore": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.7
    }
  },
  "rapidAccelerationGrade": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "excellent"
    }
  },
  "rapidDecelerationGrade": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "normal"
    }
  },
  "lateNightGrade": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "excellent"
    }
  },
  "distanceOverTime": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "distance": {
        "value": 1500.88,
        "unit": "kilometers"
      },
      "time": {
        "value": 10,
        "unit": "weeks"
      }
    }
  },
  "electricConsumptionRateSinceStart": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 11.22,
      "unit": "kwh_per_100_kilometers"
    }
  },
  "electricConsumptionRateSinceReset": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 22.33,
      "unit": "kwh_per_100_kilometers"
    }
  },
  "electricDistanceLastTrip": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 111000,
      "unit": "meters"
    }
  },
  "electricDistanceSinceReset": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 222000,
      "unit": "meters"
    }
  },
  "electricDurationLastTrip": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 77,
      "unit": "minutes"
    }
  },
  "electricDurationSinceReset": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 88,
      "unit": "minutes"
    }
  },
  "fuelConsumptionRateLastTrip": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 5.4,
      "unit": "liters_per_100_kilometers"
    }
  },
  "fuelConsumptionRateSinceReset": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 5.3,
      "unit": "liters_per_100_kilometers"
    }
  },
  "averageSpeedLastTrip": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 44.2,
      "unit": "kilometers_per_hour"
    }
  },
  "averageSpeedSinceReset": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 44.2,
      "unit": "kilometers_per_hour"
    }
  },
  "fuelDistanceLastTrip": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 111000,
      "unit": "meters"
    }
  },
  "fuelDistanceSinceReset": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 222000,
      "unit": "meters"
    }
  },
  "drivingDurationLastTrip": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 77,
      "unit": "minutes"
    }
  },
  "drivingDurationSinceReset": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 88,
      "unit": "minutes"
    }
  },
  "ecoScoreTotal": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.7
    }
  },
  "ecoScoreFreeWheel": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.7
    }
  },
  "ecoScoreConstant": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.7
    }
  },
  "ecoScoreBonusRange": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.7,
      "unit": "kilometers"
    }
  },
  "tripMeters": [
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "id": {
          "value": 1
        },
        "distance": {
          "value": 456.2,
          "unit": "kilometers"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "id": {
          "value": 2
        },
        "distance": {
          "value": 2489.3,
          "unit": "kilometers"
        }
      }
    }
  ]
}

getAvailability([, propertyNames])

Declaration

hmkit.commands.Usage.getAvailability()

Parameters

propertyNames

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

Example

// Get availability for all properties
hmkit.telematics.sendCommand(
  hmkit.commands.Usage.getAvailability(),
  accessCertificate
);
// Get availability for specific properties
hmkit.telematics.sendCommand(
  hmkit.commands.Usage.getAvailability(['average_weekly_distance']),
  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

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