Usage

State

Average weekly distance

Declaration

getAverageWeeklyDistance()

Discussion

Average weekly distance

Example

val state:Usage.State
assertTrue(state.averageWeeklyDistance.value?.value == 666.6)
assertTrue(state.averageWeeklyDistance.value?.unit == Length.Unit.KILOMETERS)
// Average weekly distance is 666.6km

Average weekly distance long run

Declaration

getAverageWeeklyDistanceLongRun()

Discussion

Average weekyl distance over long term

Example

val state:Usage.State
assertTrue(state.averageWeeklyDistanceLongRun.value?.value == 777.7)
assertTrue(state.averageWeeklyDistanceLongRun.value?.unit == Length.Unit.KILOMETERS)
// Average weekly distance, over long term, is 777.7km

Acceleration evaluation

Declaration

getAccelerationEvaluation()

Discussion

Acceleration evaluation percentage

Example

val state:Usage.State
assertTrue(state.accelerationEvaluation.value == 0.7)
// Acceleration is evaluated at 70%

Driving style evaluation

Declaration

getDrivingStyleEvaluation()

Discussion

Driving style evaluation percentage

Example

val state:Usage.State
assertTrue(state.drivingStyleEvaluation.value == 0.88)
// Driving style is evaluated at 88%

Driving modes activation periods

Declaration

getDrivingModesActivationPeriods()

Example

val state:Usage.State
assertTrue(state.drivingModesActivationPeriods[0].value?.drivingMode == DrivingMode.REGULAR)
assertTrue(state.drivingModesActivationPeriods[0].value?.period == 0.2)
// Driving mode 'regular' is engaged 20% of the time

Driving modes energy consumptions

Declaration

getDrivingModesEnergyConsumptions()

Example

val state:Usage.State
assertTrue(state.drivingModesEnergyConsumptions[0].value?.drivingMode == DrivingMode.REGULAR)
assertTrue(state.drivingModesEnergyConsumptions[0].value?.consumption?.value == 20.2)
assertTrue(state.drivingModesEnergyConsumptions[0].value?.consumption?.unit == Energy.Unit.KILOWATT_HOURS)
// Driving mode 'regular' consumed 20.2kWh of electric energy

Last trip energy consumption

Declaration

getLastTripEnergyConsumption()

Discussion

Energy consumption in the last trip

Example

val state:Usage.State
assertTrue(state.lastTripEnergyConsumption.value?.value == 101.3)
assertTrue(state.lastTripEnergyConsumption.value?.unit == Energy.Unit.KILOWATT_HOURS)
// Last trip consumed 101.3kWh of electric energy

Last trip fuel consumption

Declaration

getLastTripFuelConsumption()

Discussion

Fuel consumption in the last trip

Example

val state:Usage.State
assertTrue(state.lastTripFuelConsumption.value?.value == 22.5)
assertTrue(state.lastTripFuelConsumption.value?.unit == Volume.Unit.LITERS)
// Last trip consumed 22.5L of fuel

Mileage after last trip

Declaration

getMileageAfterLastTrip()

Discussion

Mileage after the last trip

Example

val state:Usage.State
assertTrue(state.mileageAfterLastTrip.value?.value == 95632.0)
assertTrue(state.mileageAfterLastTrip.value?.unit == Length.Unit.KILOMETERS)
// Mileage is 95'632km after last trip

Last trip electric portion

Declaration

getLastTripElectricPortion()

Discussion

Portion of the last trip used in electric mode

Example

val state:Usage.State
assertTrue(state.lastTripElectricPortion.value == 0.7)
// Electric postion of the last trip is 70%

Last trip average energy recuperation

Declaration

getLastTripAverageEnergyRecuperation()

Discussion

Energy recuperation rate for last trip

Example

val state:Usage.State
assertTrue(state.lastTripAverageEnergyRecuperation.value?.value == 5.68)
assertTrue(state.lastTripAverageEnergyRecuperation.value?.unit == EnergyEfficiency.Unit.KWH_PER_100_KILOMETERS)
// 5.68kWh/100km of electric energy was recuperated during last trip

Last trip battery remaining

Declaration

getLastTripBatteryRemaining()

Discussion

Battery % remaining after last trip

Example

val state:Usage.State
assertTrue(state.lastTripBatteryRemaining.value == 0.5)
// Battery is at 50% after last trip

Last trip date

Declaration

getLastTripDate()

Discussion

The last trip date

Example

val state:Usage.State
assertTrue(dateIsSame(state.lastTripDate.value, "2018-10-17T12:34:58.000Z"))
// Last trip happened at 17 October 2018 at 12:34:58 UTC

Average fuel consumption

Declaration

getAverageFuelConsumption()

Discussion

Average fuel consumption for current trip

Example

val state:Usage.State
assertTrue(state.averageFuelConsumption.value?.value == 6.5)
assertTrue(state.averageFuelConsumption.value?.unit == FuelEfficiency.Unit.LITERS_PER_100_KILOMETERS)
// Average fuel consumption is 6.5L per 100km

Current fuel consumption

Declaration

getCurrentFuelConsumption()

Discussion

Current fuel consumption

Example

val state:Usage.State
assertTrue(state.currentFuelConsumption.value?.value == 7.5)
assertTrue(state.currentFuelConsumption.value?.unit == FuelEfficiency.Unit.LITERS_PER_100_KILOMETERS)
// Current fuel consumption is 7.5L per 100km

Odometer after last trip

Declaration

getOdometerAfterLastTrip()

Discussion

Odometer after the last trip

Example

val state:Usage.State
assertTrue(state.odometerAfterLastTrip.value?.value == 95632.0)
assertTrue(state.odometerAfterLastTrip.value?.unit == Length.Unit.KILOMETERS)
// Odometer is 95'632km after last trip

Safety driving score

Declaration

getSafetyDrivingScore()

Discussion

Safety driving score as percentage

Example

val state:Usage.State
assertTrue(state.safetyDrivingScore.value == 0.7)
// Safety driving score is evaluated at 70%

Rapid acceleration grade

Declaration

getRapidAccelerationGrade()

Discussion

Grade given for rapid acceleration over time

Example

val state:Usage.State
assertTrue(state.rapidAccelerationGrade.value == Grade.EXCELLENT)
// Rapid acceleration is graded as excellent

Rapid deceleration grade

Declaration

getRapidDecelerationGrade()

Discussion

Grade given for rapid deceleration over time

Example

val state:Usage.State
assertTrue(state.rapidDecelerationGrade.value == Grade.NORMAL)
// Rapid deceleration is graded as normal

Late night grade

Declaration

getLateNightGrade()

Discussion

Grade given for late night driving over time

Example

val state:Usage.State
assertTrue(state.lateNightGrade.value == Grade.EXCELLENT)
// Late night driving is graded as excellent

Distance over time

Declaration

getDistanceOverTime()

Discussion

Distance driven over a given time period

Example

val state:Usage.State
assertTrue(state.distanceOverTime.value?.distance?.value == 1500.88)
assertTrue(state.distanceOverTime.value?.distance?.unit == Length.Unit.KILOMETERS)
assertTrue(state.distanceOverTime.value?.time?.value == 10.0)
assertTrue(state.distanceOverTime.value?.time?.unit == Duration.Unit.WEEKS)
// During the last 10.0 weeks the vehicle travelled 1500.88km

Electric consumption rate since start

Declaration

getElectricConsumptionRateSinceStart()

Discussion

Electric energy consumption rate since the start of a trip

Example

val state:Usage.State
assertTrue(state.electricConsumptionRateSinceStart.value?.value == 11.22)
assertTrue(state.electricConsumptionRateSinceStart.value?.unit == EnergyEfficiency.Unit.KWH_PER_100_KILOMETERS)
// Consumed 11.22kWh/100km since the start of a trip

Electric consumption rate since reset

Declaration

getElectricConsumptionRateSinceReset()

Discussion

Electric energy consumption rate since a reset

Example

val state:Usage.State
assertTrue(state.electricConsumptionRateSinceReset.value?.value == 22.33)
assertTrue(state.electricConsumptionRateSinceReset.value?.unit == EnergyEfficiency.Unit.KWH_PER_100_KILOMETERS)
// Consumed 22.33kWh/100km since a reset

Electric distance last trip

Declaration

getElectricDistanceLastTrip()

Discussion

Distance travelled with electricity in last trip

Example

val state:Usage.State
assertTrue(state.electricDistanceLastTrip.value?.value == 111000.0)
assertTrue(state.electricDistanceLastTrip.value?.unit == Length.Unit.METERS)
// Vehicle travelled 111000.0m using electricity during the last trip

Electric distance since reset

Declaration

getElectricDistanceSinceReset()

Discussion

Distance travelled with electricity since reset

Example

val state:Usage.State
assertTrue(state.electricDistanceSinceReset.value?.value == 222000.0)
assertTrue(state.electricDistanceSinceReset.value?.unit == Length.Unit.METERS)
// Vehicle travelled 222000.0m using electricity since last reset

Electric duration last trip

Declaration

getElectricDurationLastTrip()

Discussion

Duration of travelling using electricity during last trip

Example

val state:Usage.State
assertTrue(state.electricDurationLastTrip.value?.value == 77.0)
assertTrue(state.electricDurationLastTrip.value?.unit == Duration.Unit.MINUTES)
// Vehicle travelled 77.0min using electricity during last trip

Electric duration since reset

Declaration

getElectricDurationSinceReset()

Discussion

Duration of travelling using electricity since reset

Example

val state:Usage.State
assertTrue(state.electricDurationSinceReset.value?.value == 88.0)
assertTrue(state.electricDurationSinceReset.value?.unit == Duration.Unit.MINUTES)
// Vehicle travelled 88.0min using electricity since last reset

Fuel consumption rate last trip

Declaration

getFuelConsumptionRateLastTrip()

Discussion

Liquid fuel consumption rate during last trip

Example

val state:Usage.State
assertTrue(state.fuelConsumptionRateLastTrip.value?.value == 5.4)
assertTrue(state.fuelConsumptionRateLastTrip.value?.unit == FuelEfficiency.Unit.LITERS_PER_100_KILOMETERS)
// Consumed 5.4 L/100km during last trip

Fuel consumption rate since reset

Declaration

getFuelConsumptionRateSinceReset()

Discussion

Liquid fuel consumption rate since reset

Example

val state:Usage.State
assertTrue(state.fuelConsumptionRateSinceReset.value?.value == 5.3)
assertTrue(state.fuelConsumptionRateSinceReset.value?.unit == FuelEfficiency.Unit.LITERS_PER_100_KILOMETERS)
// Consumed 5.3 L/100km since reset

Average speed last trip

Declaration

getAverageSpeedLastTrip()

Discussion

Average speed during last trip

Example

val state:Usage.State
assertTrue(state.averageSpeedLastTrip.value?.value == 44.2)
assertTrue(state.averageSpeedLastTrip.value?.unit == Speed.Unit.KILOMETERS_PER_HOUR)
// Average speed was 44.2km/h during last trip

Average speed since reset

Declaration

getAverageSpeedSinceReset()

Discussion

Average speed since reset

Example

val state:Usage.State
assertTrue(state.averageSpeedSinceReset.value?.value == 44.2)
assertTrue(state.averageSpeedSinceReset.value?.unit == Speed.Unit.KILOMETERS_PER_HOUR)
// Average speed was 44.2km/h since reset

Fuel distance last trip

Declaration

getFuelDistanceLastTrip()

Discussion

Distance travelled with (liquid) fuel during last trip

Example

val state:Usage.State
assertTrue(state.fuelDistanceLastTrip.value?.value == 111000.0)
assertTrue(state.fuelDistanceLastTrip.value?.unit == Length.Unit.METERS)
// Vehicle travelled 111000.0m using fuel during the last trip

Fuel distance since reset

Declaration

getFuelDistanceSinceReset()

Discussion

Distance travelled with (liquid) fuel since reset

Example

val state:Usage.State
assertTrue(state.fuelDistanceSinceReset.value?.value == 222000.0)
assertTrue(state.fuelDistanceSinceReset.value?.unit == Length.Unit.METERS)
// Vehicle travelled 222000.0m using fuel since last reset

Driving duration last trip

Declaration

getDrivingDurationLastTrip()

Discussion

Duration of last trip

Example

val state:Usage.State
assertTrue(state.drivingDurationLastTrip.value?.value == 77.0)
assertTrue(state.drivingDurationLastTrip.value?.unit == Duration.Unit.MINUTES)
// Vehicle travelled 77.0min during last trip

Driving duration since reset

Declaration

getDrivingDurationSinceReset()

Discussion

Duration of travelling since reset

Example

val state:Usage.State
assertTrue(state.drivingDurationSinceReset.value?.value == 88.0)
assertTrue(state.drivingDurationSinceReset.value?.unit == Duration.Unit.MINUTES)
// Vehicle travelled 88.0min since last reset

Eco score total

Declaration

getEcoScoreTotal()

Discussion

Overall eco-score rating

Example

val state:Usage.State
assertTrue(state.ecoScoreTotal.value == 0.7)
// Total eco-score rating is 70%

Eco score free wheel

Declaration

getEcoScoreFreeWheel()

Discussion

Eco-score rating for free-wheeling

Example

val state:Usage.State
assertTrue(state.ecoScoreFreeWheel.value == 0.7)
// Eco-score free-wheeling rating is 70%

Eco score constant

Declaration

getEcoScoreConstant()

Discussion

Eco-score rating constant

Example

val state:Usage.State
assertTrue(state.ecoScoreConstant.value == 0.7)
// Eco-score constant is 70%

Eco score bonus range

Declaration

getEcoScoreBonusRange()

Discussion

Eco-score bonus range

Example

val state:Usage.State
assertTrue(state.ecoScoreBonusRange.value?.value == 0.7)
assertTrue(state.ecoScoreBonusRange.value?.unit == Length.Unit.KILOMETERS)
// Eco-score bonus range is 0.7km

Getters

Get Usage property availability information

Declaration

public GetUsageAvailability()
public GetUsageAvailability(byte... propertyIdentifiers)

Example

// get all property availabilities
val getAvailability = GetUsageAvailability()
// get averageWeeklyDistance and averageWeeklyDistanceLongRun property availabilities
val getAvailabilityProperties = GetUsageAvailability(0x01, 0x02)

Get usage

Declaration

public GetUsage()
public GetUsage(byte... propertyIdentifiers)            

Example

// get all properties
val getState = GetUsage()
// get averageWeeklyDistance and averageWeeklyDistanceLongRun properties
val getStateProperties = GetUsage(0x01, 0x02)