Calculate a route with a minimum arrival charge
There are situations where adding a reserve charge at the destination is required. The reasons may include the following:
- The consumption model doesn't compute energy consumption precisely and user wants to ensure the destination can be reached.
- It's not possible to charge at the destination. The reserve is needed for the next journey.
These are three optional parameters you can use to calculate a route with charging reserve:
ev[minChargeAtDestination]is used only for the destination waypoint. Default value:0.ev[minChargeAtFirstChargingStation]is used for first charging station waypoint. Default value:0.ev[minChargeAtChargingStation]is used for all charging station waypoints, except for the first one, ifev[minChargeAtFirstChargingStation]is specified. Default value:0.
Waypoints that are neither charging stops nor the destination don't support the corresponding parameter, as there is no use-case for them to have a reserve.
The following example describes a scenario specifying 10% of the maximum charge (8kWh) as minimum charge at a charging station. Additionally, it specifies 50kWh as minimum required charge at the destination. Because of this, there is now an additional charging station close to the destination. The response has three sections.
curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'departureTime=any&'\
'origin=52.533959,13.404780&'\
'ev[connectorTypes]=iec62196Type2Combo&'\
'transportMode=car&'\
'destination=51.741505,14.352413&'\
'return=summary&'\
'ev[freeFlowSpeedTable]=10,0.130,20,0.132,30,0.136,40,0.142,50,0.151,60,0.161,70,0.176,80,0.194,90,0.214,100,0.237,110,0.264,120,0.290,130,0.321,140,0.354,150,0.389,160,0.426,170,0.466,180,0.509,190,0.554,200,0.601&'\
'ev[trafficSpeedTable]=0,0.349,27,0.319,45,0.329,60,0.266,75,0.287,90,0.318,100,0.33,110,0.335,120,0.35,130,0.36,250,0.36&'\
'ev[auxiliaryConsumption]=1.8&'\
'ev[ascent]=9&'\
'ev[descent]=4.3&'\
'ev[makeReachable]=true&'\
'ev[initialCharge]=48&'\
'ev[maxCharge]=80&'\
'ev[chargingCurve]=0,96,8,193,16,200,32,190,48,96,64,48,80,5&'\
'ev[maxChargeAfterChargingStation]=72&'\
'ev[minChargeAtChargingStation]=8&'\
'ev[minChargeAtDestination]=50&'\
'apiKey=YOUR_API_KEY'{
"routes": [
{
"id": "b30cf55f-fee2-4669-afa6-1c9dbaff5ec4",
"sections": [
{
"id": "87f5d58d-b57e-4441-a56a-581c1f7c4f09",
"type": "vehicle",
"postActions": [
{
"action": "charging",
"duration": 1521,
"consumablePower": 300,
"arrivalCharge": 18.6044,
"targetCharge": 66.9999
}
],
"departure": {
"place": {
"type": "place",
"location": {
"lat": 52.5338755,
"lng": 13.4050137,
"elv": 92
},
"originalLocation": {
"lat": 52.5339589,
"lng": 13.4047799
}
},
"charge": 48
},
"arrival": {
"place": {
"type": "chargingStation",
"location": {
"lat": 51.8887524,
"lng": 13.8374168,
"elv": 105
},
"displayLocation": {
"lat": 51.888672,
"lng": 13.8373939
},
"id": "evcp0-ODE3ODJjZmUtMmFlNy0xMWVmLWJhMTUtNDIwMTBhYTQwMDQz",
"name": "EV Charging Station",
"attributes": {
"power": 300,
"current": 375,
"voltage": 800,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
}
},
"charge": 18.6044
},
"summary": {
"duration": 5234,
"length": 85293,
"consumption": -18.9999,
"baseDuration": 5234
},
"transport": {
"mode": "car"
},
"consumptionType": "electric"
},
{
"id": "2e6898fe-2e8e-4d6a-9a6b-cbc920d3bf87",
"type": "vehicle",
"departure": {
"place": {
"type": "chargingStation",
"location": {
"lat": 51.8887524,
"lng": 13.8374168,
"elv": 105
},
"displayLocation": {
"lat": 51.888672,
"lng": 13.8373939
},
"id": "evcp0-ODE3ODJjZmUtMmFlNy0xMWVmLWJhMTUtNDIwMTBhYTQwMDQz",
"name": "EV Charging Station",
"attributes": {
"power": 300,
"current": 375,
"voltage": 800,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
}
},
"charge": 66.9999
},
"arrival": {
"place": {
"type": "place",
"location": {
"lat": 51.7412356,
"lng": 14.3525337,
"elv": 115
},
"originalLocation": {
"lat": 51.741505,
"lng": 14.3524129
}
},
"charge": 50.0564
},
"summary": {
"duration": 1823,
"length": 47497,
"consumption": 16.9435,
"baseDuration": 1823
},
"transport": {
"mode": "car"
},
"consumptionType": "electric"
}
]
}
]
}If the initial charge is too low, no charging station might be reachable with the ev[minChargeAtChargingStation] limitation.
One option would be to reduce this number, but this would have one undesired effect, as all charging station will be reached with low charge.
Instead of this, ev[minChargeAtFirstChargingStation] can be specified. This will allow vehicle to reach the nearest charging station, but it will not affect the rest of the route.
The following example describes a scenario where initial charge is low (10kWh) and no station is reachable with ev[minChargeAtChargingStation] set to 8kWh. ev[minChargeAtFirstChargingStation] is set to 2kWh to solve the issue.
curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=52.853812,13.010695&'\
'destination=51.741505,14.352413&'\
'return=summary&'\
'transportMode=car&'\
'departureTime=any&'\
'ev[freeFlowSpeedTable]=10,0.130,20,0.132,30,0.136,40,0.142,50,0.151,60,0.161,70,0.176,80,0.194,90,0.214,100,0.237,110,0.264,120,0.290,130,0.321,140,0.354,150,0.389,160,0.426,170,0.466,180,0.509,190,0.554,200,0.601&'\
'ev[trafficSpeedTable]=0,0.349,27,0.319,45,0.329,60,0.266,75,0.287,90,0.318,100,0.33,110,0.335,120,0.35,130,0.36,250,0.36&'\
'ev[auxiliaryConsumption]=1.8&'\
'ev[ascent]=9&'\
'ev[descent]=4.3&'\
'ev[initialCharge]=10&'\
'ev[maxCharge]=80&'\
'ev[chargingCurve]=0,96,8,193,16,200,32,190,48,96,64,48,80,5&'\
'ev[maxChargeAfterChargingStation]=72&'\
'ev[minChargeAtChargingStation]=8&'\
'ev[makeReachable]=true&'\
'ev[connectorTypes]=iec62196Type2Combo&'\
'ev[minChargeAtFirstChargingStation]=2&'\
'apiKey=YOUR_API_KEY'{
"routes": [
{
"id": "50b23cd6-d6dc-42f8-87e0-927403f2efc2",
"sections": [
{
"id": "aad8590f-e100-4fb0-80a5-a847cb12f48d",
"type": "vehicle",
"postActions": [
{
"action": "charging",
"duration": 1390,
"consumablePower": 225,
"arrivalCharge": 3.3848,
"targetCharge": 56.9997
}
],
"departure": {
"place": {
"type": "place",
"location": {
"lat": 52.8538096,
"lng": 13.0113434,
"elv": 88
},
"originalLocation": {
"lat": 52.8538119,
"lng": 13.010695
}
},
"charge": 10
},
"arrival": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.7463799,
"lng": 13.188652,
"elv": 76
},
"displayLocation": {
"lat": 52.746375,
"lng": 13.188554
},
"id": "evcp0-ZjZmMGU2MmEtM2I1ZC0xMWVmLWFhMjQtNDIwMTBhYTQwMDQz",
"name": "Pfalzwerke",
"attributes": {
"power": 225,
"current": 450,
"voltage": 500,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
},
"brand": {
"hrn": "7f8c54edcfcf6ab4cdb6a64ecc612fd7",
"name": "Pfalzwerke"
},
"chargePointOperator": {
"id": "e5e55d2a-48d2-11ef-a172-42010aa40019",
"name": "Pfalzwerke"
}
},
"charge": 3.3848
},
"summary": {
"duration": 2743,
"length": 23267,
"consumption": -46.9997,
"baseDuration": 2743
},
"transport": {
"mode": "car"
},
"consumptionType": "electric"
},
{
"id": "470a04ee-178f-4d26-9ff9-c3b168a2fb9e",
"type": "vehicle",
"departure": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.7463799,
"lng": 13.188652,
"elv": 76
},
"displayLocation": {
"lat": 52.746375,
"lng": 13.188554
},
"id": "evcp0-ZjZmMGU2MmEtM2I1ZC0xMWVmLWFhMjQtNDIwMTBhYTQwMDQz",
"name": "Pfalzwerke",
"attributes": {
"power": 225,
"current": 450,
"voltage": 500,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
},
"brand": {
"hrn": "7f8c54edcfcf6ab4cdb6a64ecc612fd7",
"name": "Pfalzwerke"
},
"chargePointOperator": {
"id": "e5e55d2a-48d2-11ef-a172-42010aa40019",
"name": "Pfalzwerke"
}
},
"charge": 56.9997
},
"arrival": {
"place": {
"type": "place",
"location": {
"lat": 51.7412356,
"lng": 14.3525337,
"elv": 115
},
"originalLocation": {
"lat": 51.741505,
"lng": 14.3524129
}
},
"charge": 0.1927
},
"summary": {
"duration": 6267,
"length": 167638,
"consumption": 56.807,
"baseDuration": 6267
},
"transport": {
"mode": "car"
},
"consumptionType": "electric"
}
]
}
]
}Updated 28 days ago