Charging

State

Estimated range

Declaration

getEstimatedRange()

Discussion

Estimated range

Example

val state:Charging.State
assertTrue(state.estimatedRange.value?.value == 432.1)
assertTrue(state.estimatedRange.value?.unit == Length.Unit.KILOMETERS)
// 432.1km estimated range

Battery level

Declaration

getBatteryLevel()

Discussion

Battery level percentage between 0.0-1.0

Example

val state:Charging.State
assertTrue(state.batteryLevel.value == 0.5)
// Battery level 50%

Battery current ac

Declaration

getBatteryCurrentAC()

Discussion

Battery alternating current

Example

val state:Charging.State
assertTrue(state.batteryCurrentAC.value?.value == -0.6)
assertTrue(state.batteryCurrentAC.value?.unit == ElectricCurrent.Unit.AMPERES)
// Battery alternating current is -0.6A

Battery current dc

Declaration

getBatteryCurrentDC()

Discussion

Battery direct current

Example

val state:Charging.State
assertTrue(state.batteryCurrentDC.value?.value == -0.6)
assertTrue(state.batteryCurrentDC.value?.unit == ElectricCurrent.Unit.AMPERES)
// Battery direct current is -0.6A

Charger voltage ac

Declaration

getChargerVoltageAC()

Discussion

Charger voltage for alternating current

Example

val state:Charging.State
assertTrue(state.chargerVoltageAC.value?.value == 400.0)
assertTrue(state.chargerVoltageAC.value?.unit == ElectricPotentialDifference.Unit.VOLTS)
// Charger voltage is 400.0V for alternating current

Charger voltage dc

Declaration

getChargerVoltageDC()

Discussion

Charger voltage for direct current

Example

val state:Charging.State
assertTrue(state.chargerVoltageDC.value?.value == 400.0)
assertTrue(state.chargerVoltageDC.value?.unit == ElectricPotentialDifference.Unit.VOLTS)
// Charger voltage is 400.0V for direct current

Charge limit

Declaration

getChargeLimit()

Discussion

Charge limit percentage between 0.0-1.0

Example

val state:Charging.State
assertTrue(state.chargeLimit.value == 0.9)
// Charge limit is set to 90%

Time to complete charge

Declaration

getTimeToCompleteCharge()

Discussion

Time until charging completed

Example

val state:Charging.State
assertTrue(state.timeToCompleteCharge.value?.value == 60.0)
assertTrue(state.timeToCompleteCharge.value?.unit == Duration.Unit.MINUTES)
// Time to complete charge is 60.0 minutes

Charging rate kw

Declaration

getChargingRateKW()

Discussion

Charging rate

Example

val state:Charging.State
assertTrue(state.chargingRateKW.value?.value == 3.5)
assertTrue(state.chargingRateKW.value?.unit == Power.Unit.KILOWATTS)
// Charging rate is 3.5kW

Charge port state

Declaration

getChargePortState()

Example

val state:Charging.State
assertTrue(state.chargePortState.value == Position.OPEN)
// Charge port is open

Charge mode

Declaration

getChargeMode()

Example

val state:Charging.State
assertTrue(state.chargeMode.value == Charging.ChargeMode.TIMER_BASED)
// Charging is 'timer based'

Max charging current

Declaration

getMaxChargingCurrent()

Discussion

Maximum charging current

Example

val state:Charging.State
assertTrue(state.maxChargingCurrent.value?.value == 25.0)
assertTrue(state.maxChargingCurrent.value?.unit == ElectricCurrent.Unit.AMPERES)
// Maximum charging current is 25.0A

Plug type

Declaration

getPlugType()

Example

val state:Charging.State
assertTrue(state.plugType.value == Charging.PlugType.TYPE_2)
// Electric plug type is 'Type 2'

Charging window chosen

Declaration

getChargingWindowChosen()

Example

val state:Charging.State
assertTrue(state.chargingWindowChosen.value == Charging.ChargingWindowChosen.NOT_CHOSEN)
// Charging window is not chosen

Departure times

Declaration

getDepartureTimes()

Example

val state:Charging.State
assertTrue(state.departureTimes[0].value?.state == ActiveState.ACTIVE)
assertTrue(state.departureTimes[0].value?.time?.hour == 16)
assertTrue(state.departureTimes[0].value?.time?.minute == 32)
// Departure time 16:32 is active

Reduction times

Declaration

getReductionTimes()

Example

val state:Charging.State
assertTrue(state.reductionTimes[0].value?.startStop == StartStop.START)
assertTrue(state.reductionTimes[0].value?.time?.hour == 17)
assertTrue(state.reductionTimes[0].value?.time?.minute == 33)
// Start reduction of charging at 17:33

Battery temperature

Declaration

getBatteryTemperature()

Discussion

Battery temperature

Example

val state:Charging.State
assertTrue(state.batteryTemperature.value?.value == 38.4)
assertTrue(state.batteryTemperature.value?.unit == Temperature.Unit.CELSIUS)
// The battery temperature is 38.4°C

Timers

Declaration

getTimers()

Example

val state:Charging.State
assertTrue(state.timers[0].value?.timerType == Timer.TimerType.PREFERRED_START_TIME)
assertTrue(dateIsSame(state.timers[0].value?.date, "2017-01-10T16:32:05.000Z"))
// Preferred start time is 10 January 2017 at 16:32:05 UTC

Plugged in

Declaration

getPluggedIn()

Example

val state:Charging.State
assertTrue(state.pluggedIn.value == Charging.PluggedIn.PLUGGED_IN)
// The charger is plugged in

Status

Declaration

getStatus()

Example

val state:Charging.State
assertTrue(state.status.value == Charging.Status.CHARGING)
// The vehicle is charging

Charging rate

Declaration

getChargingRate()

Discussion

Charge rate when charging

Example

val state:Charging.State
assertTrue(state.chargingRate.value?.value == 150.0)
assertTrue(state.chargingRate.value?.unit == Power.Unit.KILOWATTS)
// Charging rate is 150.0kW

Battery current

Declaration

getBatteryCurrent()

Discussion

Battery current

Example

val state:Charging.State
assertTrue(state.batteryCurrent.value?.value == -0.6)
assertTrue(state.batteryCurrent.value?.unit == ElectricCurrent.Unit.AMPERES)
// Battery current is -0.6A

Charger voltage

Declaration

getChargerVoltage()

Discussion

Charger voltage

Example

val state:Charging.State
assertTrue(state.chargerVoltage.value?.value == 400.0)
assertTrue(state.chargerVoltage.value?.unit == ElectricPotentialDifference.Unit.VOLTS)
// Charger voltage is 400.0V

Current type

Declaration

getCurrentType()

Discussion

Type of current in use

Example

val state:Charging.State
assertTrue(state.currentType.value == Charging.CurrentType.ALTERNATING_CURRENT)
// Alternating current is used

Max range

Declaration

getMaxRange()

Discussion

Maximum electric range with 100% of battery

Example

val state:Charging.State
assertTrue(state.maxRange.value?.value == 555.0)
assertTrue(state.maxRange.value?.unit == Length.Unit.KILOMETERS)
// Maximum electric range is 555.0km

Starter battery state

Declaration

getStarterBatteryState()

Discussion

State of the starter battery

Example

val state:Charging.State
assertTrue(state.starterBatteryState.value == Charging.StarterBatteryState.GREEN)
// Starter battery status is green

Smart charging status

Declaration

getSmartChargingStatus()

Discussion

Status of optimized/intelligent charging

Example

val state:Charging.State
assertTrue(state.smartChargingStatus.value == Charging.SmartChargingStatus.SCC_IS_ACTIVE)
// Smart Charge Communication is active

Battery level at departure

Declaration

getBatteryLevelAtDeparture()

Discussion

Battery charge level expected at time of departure

Example

val state:Charging.State
assertTrue(state.batteryLevelAtDeparture.value == 0.9)
// Battery level is expected to be 90% at time of departure

Preconditioning departure status

Declaration

getPreconditioningDepartureStatus()

Discussion

Status of preconditioning at departure time

Example

val state:Charging.State
assertTrue(state.preconditioningDepartureStatus.value == ActiveState.ACTIVE)
// Preconditioning is active for departure time

Preconditioning immediate status

Declaration

getPreconditioningImmediateStatus()

Discussion

Status of immediate preconditioning

Example

val state:Charging.State
assertTrue(state.preconditioningImmediateStatus.value == ActiveState.ACTIVE)
// Immediate preconditioning is active

Preconditioning departure enabled

Declaration

getPreconditioningDepartureEnabled()

Discussion

Preconditioning activation status at departure

Example

val state:Charging.State
assertTrue(state.preconditioningDepartureEnabled.value == EnabledState.ENABLED)
// Preconditioning is enabled for departure

Preconditioning error

Declaration

getPreconditioningError()

Discussion

Preconditioning error if one is encountered

Example

val state:Charging.State
assertTrue(state.preconditioningError.value == Charging.PreconditioningError.NOT_POSSIBLE_LOW)
// Preconditioning not possible because battery or fuel is low

Battery capacity

Declaration

getBatteryCapacity()

Discussion

Indicates the battery capacity

Example

val state:Charging.State
assertTrue(state.batteryCapacity.value?.value == 70.0)
assertTrue(state.batteryCapacity.value?.unit == Energy.Unit.KILOWATT_HOURS)
// Battery capacity is 70.0Kwh

Setters

Start stop charging

Declaration

public StartStopCharging(Status status)

Example

val startStopCharging = Charging.StartStopCharging(Charging.Status.CHARGING)    

Set charge limit

Declaration

public SetChargeLimit(Double chargeLimit)

Example

val setChargeLimit = Charging.SetChargeLimit(0.9)    

Open close charging port

Declaration

public OpenCloseChargingPort(Position chargePortState)

Example

val openCloseChargingPort = Charging.OpenCloseChargingPort(Position.OPEN)    

Set charge mode

Declaration

public SetChargeMode(ChargeMode chargeMode)

Example

val setChargeMode = Charging.SetChargeMode(Charging.ChargeMode.TIMER_BASED)    

Set charging timers

Declaration

public SetChargingTimers(List<Timer> timers)

Example

val setChargingTimers = Charging.SetChargingTimers(arrayListOf(
        Timer(Timer.TimerType.PREFERRED_START_TIME, getCalendar("2017-01-10T16:32:05.000Z")), 
        Timer(Timer.TimerType.PREFERRED_END_TIME, getCalendar("2017-01-10T16:36:05.000Z")), 
        Timer(Timer.TimerType.DEPARTURE_DATE, getCalendar("2017-01-10T16:36:05.000Z")))
    )    

Set reduction of charging current times

Declaration

public SetReductionOfChargingCurrentTimes(List<ReductionTime> reductionTimes)

Example

val setReductionOfChargingCurrentTimes = Charging.SetReductionOfChargingCurrentTimes(arrayListOf(
        ReductionTime(StartStop.START, Time(17, 33)), 
        ReductionTime(StartStop.STOP, Time(12, 52)))
    )    

Getters

Get Charging property availability information

Declaration

public GetStateAvailability()
public GetStateAvailability(byte... propertyIdentifiers)

Example

// get all property availabilities
val getAvailability = GetStateAvailability()
// get estimatedRange and batteryLevel property availabilities
val getAvailabilityProperties = GetStateAvailability(0x02, 0x03)

Get Charging properties

Declaration

public GetState()
public GetState(byte... propertyIdentifiers)            

Example

// get all properties
val getState = GetState()
// get estimatedRange and batteryLevel properties
val getStateProperties = GetState(0x02, 0x03)