Charging
Table of Contents
getState([, propertyNames])
Declaration
hmkit.commands.Charging.getState()
Parameters
propertyNames | (optional) Array of names of the properties you want returned. |
Returns
ChargingResponse
Example
hmkit.telematics.sendCommand(
hmkit.commands.Charging.getState(),
accessCertificate
);
ChargingResponse
Parameters
estimatedRange | (Object) |
data.value | (Number) (length) Estimated range |
timestamp | (Date) |
batteryLevel | (Object) |
data.value | (Number) (double) Battery level percentage between 0.0-1.0 |
timestamp | (Date) |
chargeLimit | (Object) |
data.value | (Number) (double) Charge limit percentage between 0.0-1.0 |
timestamp | (Date) |
timeToCompleteCharge | (Object) |
data.value | (Number) (duration) Time until charging completed |
timestamp | (Date) |
chargePortState | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
chargeMode | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
maxChargingCurrent | (Object) |
data.value | (Number) (electric_current) Maximum charging current |
timestamp | (Date) |
plugType | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
chargingWindowChosen | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
departureTimes | (Object) |
data.value | (Array |
timestamp | (Date) |
reductionTimes | (Object) |
data.value | (Array |
timestamp | (Date) |
batteryTemperature | (Object) |
data.value | (Number) (temperature) Battery temperature |
timestamp | (Date) |
timers | (Object) |
data.value | (Array |
timestamp | (Date) |
pluggedIn | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
status | (Object) |
data.value | (String) (enum) |
timestamp | (Date) |
chargingRate | (Object) |
data.value | (Number) (power) Charge rate when charging |
timestamp | (Date) |
batteryCurrent | (Object) |
data.value | (Number) (electric_current) Battery current |
timestamp | (Date) |
chargerVoltage | (Object) |
data.value | (Number) (electric_potential_difference) Charger voltage |
timestamp | (Date) |
currentType | (Object) |
data.value | (String) (enum) Type of current in use |
timestamp | (Date) |
maxRange | (Object) |
data.value | (Number) (length) Maximum electric range with 100% of battery |
timestamp | (Date) |
starterBatteryState | (Object) |
data.value | (String) (enum) State of the starter battery |
timestamp | (Date) |
smartChargingStatus | (Object) |
data.value | (String) (enum) Status of optimized/intelligent charging |
timestamp | (Date) |
batteryLevelAtDeparture | (Object) |
data.value | (Number) (double) Battery charge level expected at time of departure |
timestamp | (Date) |
preconditioningDepartureStatus | (Object) |
data.value | (String) (enum) Status of preconditioning at departure time |
timestamp | (Date) |
preconditioningImmediateStatus | (Object) |
data.value | (String) (enum) Status of immediate preconditioning |
timestamp | (Date) |
preconditioningDepartureEnabled | (Object) |
data.value | (String) (enum) Preconditioning activation status at departure |
timestamp | (Date) |
preconditioningError | (Object) |
data.value | (String) (enum) Preconditioning error if one is encountered |
timestamp | (Date) |
batteryCapacity | (Object) |
data.value | (Number) (energy) Indicates the battery capacity |
timestamp | (Date) |
Example
{
"estimatedRange": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 432.1,
"unit": "kilometers"
}
},
"batteryLevel": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 0.5
}
},
"chargeLimit": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 0.9
}
},
"timeToCompleteCharge": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 60,
"unit": "minutes"
}
},
"chargePortState": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "open"
}
},
"chargeMode": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "timer_based"
}
},
"maxChargingCurrent": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 25,
"unit": "amperes"
}
},
"plugType": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "type_2"
}
},
"chargingWindowChosen": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "not_chosen"
}
},
"departureTimes": [
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"state": {
"value": "active"
},
"time": {
"hour": {
"value": 16
},
"minute": {
"value": 32
}
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"state": {
"value": "inactive"
},
"time": {
"hour": {
"value": 11
},
"minute": {
"value": 51
}
}
}
}
],
"reductionTimes": [
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"startStop": {
"value": "start"
},
"time": {
"hour": {
"value": 17
},
"minute": {
"value": 33
}
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"startStop": {
"value": "stop"
},
"time": {
"hour": {
"value": 12
},
"minute": {
"value": 52
}
}
}
}
],
"batteryTemperature": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 38.4,
"unit": "celsius"
}
},
"timers": [
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"timerType": {
"value": "preferred_start_time"
},
"date": {
"value": "2017-01-10T16:32:05.000Z"
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"timerType": {
"value": "preferred_end_time"
},
"date": {
"value": "2017-01-10T16:36:05.000Z"
}
}
},
{
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"timerType": {
"value": "departure_date"
},
"date": {
"value": "2017-01-10T16:36:05.000Z"
}
}
}
],
"pluggedIn": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "plugged_in"
}
},
"status": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "charging"
}
},
"chargingRate": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 150,
"unit": "kilowatts"
}
},
"batteryCurrent": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": -0.6,
"unit": "amperes"
}
},
"chargerVoltage": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 400,
"unit": "volts"
}
},
"currentType": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "alternating_current"
}
},
"maxRange": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 555,
"unit": "kilometers"
}
},
"starterBatteryState": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "green"
}
},
"smartChargingStatus": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "scc_is_active"
}
},
"batteryLevelAtDeparture": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 0.9
}
},
"preconditioningDepartureStatus": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "active"
}
},
"preconditioningImmediateStatus": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "active"
}
},
"preconditioningDepartureEnabled": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "enabled"
}
},
"preconditioningError": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": "not_possible_low"
}
},
"batteryCapacity": {
"timestamp": "2021-06-01T15:48:04.887Z",
"data": {
"value": 70,
"unit": "kilowatt_hours"
}
}
}
getAvailability([, propertyNames])
Declaration
hmkit.commands.Charging.getAvailability()
Parameters
propertyNames | (optional) Array of names of the properties you want returned. |
Example
// Get availability for all properties
hmkit.telematics.sendCommand(
hmkit.commands.Charging.getAvailability(),
accessCertificate
);
// Get availability for specific properties
hmkit.telematics.sendCommand(
hmkit.commands.Charging.getAvailability(['estimatedRange']),
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
{
"estimatedRange": {
"availability": {
"updateRate": {
"value": "trip_high"
},
"rateLimit": {
"value": 64,
"unit": "hertz"
},
"appliesPer": {
"value": "vehicle"
}
}
}
}
startStopCharging({ status })
Parameters
status | (String) (enum) |
Example
hmkit.telematics.sendCommand(
hmkit.commands.Charging.startStopCharging({
"status": "charging"
}),
accessCertificate
);
setChargeLimit({ chargeLimit })
Parameters
chargeLimit | (Number) (double) Charge limit percentage between 0.0-1.0 |
Example
hmkit.telematics.sendCommand(
hmkit.commands.Charging.setChargeLimit({
"chargeLimit": 0.9
}),
accessCertificate
);
openCloseChargingPort({ chargePortState })
Parameters
chargePortState | (String) (enum) |
Example
hmkit.telematics.sendCommand(
hmkit.commands.Charging.openCloseChargingPort({
"chargePortState": "open"
}),
accessCertificate
);
setChargeMode({ chargeMode })
Parameters
chargeMode | (String) (enum) |
Example
hmkit.telematics.sendCommand(
hmkit.commands.Charging.setChargeMode({
"chargeMode": "timer_based"
}),
accessCertificate
);
setChargingTimers({ timers })
Parameters
timers | (Array |
Example
hmkit.telematics.sendCommand(
hmkit.commands.Charging.setChargingTimers({
"timers": [
{
"timerType": {
"value": "preferred_start_time"
},
"date": {
"value": "2017-01-10T16:32:05.000Z"
}
},
{
"timerType": {
"value": "preferred_end_time"
},
"date": {
"value": "2017-01-10T16:36:05.000Z"
}
},
{
"timerType": {
"value": "departure_date"
},
"date": {
"value": "2017-01-10T16:36:05.000Z"
}
}
]
}),
accessCertificate
);
setReductionOfChargingCurrentTimes({ reductionTimes })
Parameters
reductionTimes | (Array |
Example
hmkit.telematics.sendCommand(
hmkit.commands.Charging.setReductionOfChargingCurrentTimes({
"reductionTimes": [
{
"startStop": {
"value": "start"
},
"time": {
"hour": {
"value": 17
},
"minute": {
"value": 33
}
}
},
{
"startStop": {
"value": "stop"
},
"time": {
"hour": {
"value": 12
},
"minute": {
"value": 52
}
}
}
]
}),
accessCertificate
);