View Source PorscheConnEx.Struct.Emobility.ChargeStatus (porsche_conn_ex v0.1.0)

Structure containing information about the electric charging status of a particular vehicle.

Fields

  • mode (atom) — the current charging mode — :off, :ac, :dc, or :unknown
    • :dc is currently speculative; I have not tested the API while hooked up to a DC Fast Charger.
  • plug (atom) — the status of the physical charging plug — :connected or :disconnected
  • plug_lock (atom) — the lock status of the charging plug — :locked or :unlocked
  • state (atom) — the current charging state — :off, :charging, :completed, or :error
  • reason (atom or tuple) — the reason for the current charging state
    • :immediate if charging due to "direct charge" / user request / etc
    • {:timer, n} if charging due to an upcoming timer in slot n
    • :invalid if there is no reason to charge / charging negotiation is in progess / etc
    • Note that if there is no immediate charging / climatisation activity, this value is unreliable — the API tends to return {:timer, 4}, regardless of whether timer #4 is the next timer or not.
  • external_power (atom) — the status of the external power connection
    • :station_connected when connected to a charging station but not actively drawing power
    • :available when actively drawing power from a charging station
    • :unavailable when not connected to a charging station
  • led_color (atom) — the charging LED colour — :white, :green, :blue, :red, or :off
  • led_state (atom) — the charging LED state — :flash, :blink, :pulse, :solid, or :off
  • percent (integer) — the current percentage of charge (0 to 100)
  • minutes_to_full (integer) — the estimated number of minutes until target charge is reached
    • Note that the API appears to calculate this value only when charging parameters change, meaning it will be valid at the start of a charge, but will remain the same (and become quite out of date) until suddenly dropping to zero when charging is complete.
  • remaining_electric_range (Distance) — the estimated remaining electric travel range
  • remaining_conventional_range (Distance) — the estimated remaining conventional travel range
  • rate (ChargeRate) — the current charge rate, in terms of range increase over time
  • kilowatts (float) — the current charge rate, in kilowatts
  • dc_mode? (boolean) — whether the vehicle is charging in DC mode
    • This appears to refer to DC power, not Direct Charging.  More research needed.
    • If this is redundant due to mode above, then I'll remove it.
  • target_time (NaiveDateTime) — the local time that the vehicle intends to complete its next charge
  • target_time_opl_enforced (unknown) — has always been nil in testing
    • Sounds like it may be a boolean?

Summary

Types

@type external_power() :: :station_connected | :available | :unavailable
@type led_color() :: :white | :green | :blue | :red | nil
@type led_state() :: :flashing | :blinking | :pulsing | :solid | :off
@type mode() :: :off | :ac | :dc | :unknown
@type plug() :: :connected | :disconnected
@type plug_lock() :: :locked | :unlocked
@type reason() ::
  :immediate | :invalid | {:timer, PorscheConnEx.Struct.Emobility.Timer.id()}
@type state() :: :off | :charging | :completed | :error
@type t() :: %PorscheConnEx.Struct.Emobility.ChargeStatus{
  dc_mode?: boolean(),
  external_power: external_power(),
  kilowatts: float(),
  led_color: led_color(),
  led_state: led_state(),
  minutes_to_full: integer(),
  mode: mode(),
  percent: 0..100,
  plug: plug(),
  plug_lock: plug_lock(),
  rate: PorscheConnEx.Struct.Unit.ChargeRate.t(),
  reason: reason(),
  remaining_conventional_range: PorscheConnEx.Struct.Unit.Distance.t(),
  remaining_electric_range: PorscheConnEx.Struct.Unit.Distance.t(),
  state: state(),
  target_time: NaiveDateTime.t(),
  target_time_opl_enforced: any()
}