View Source PorscheConnEx.Struct.Emobility.ChargingProfile.ChargingOptions (porsche_conn_ex v0.1.0)

Structure containing desired charging behaviour for a particular profile.

Fields

  • minimum_charge (integer) — charge immediately if below this charge percentage (0 to 100)
  • mode (atom) — determines how the profile decides when to charge
    • when set to :smart, the vehicle will negotiate the best charging time with the charger
    • when set to :preferred_time, the vehicle will try to charge between the hours below
  • preferred_time_start (Time) — the start of the preferred hours (each day)
  • preferred_time_end (Time) — the end of the preferred hours (each day)

If preferred_time_end is later in the day than preferred_time_start, then charging will occur between the two times.

If preferred_time_end is earlier in the day than preferred_time_start, then this indicates an overnight charging period, and the preferred hours will be any time later than preferred_start_end or earlier than preferred_time_start.

Charging behaviour

When plugged in, if the vehicle charge is below minimum_charge, charging will begin immediately. (This also occurs if minimum_charge is ever raised above the vehicle's current charge.)

Once the minimum charge is reached, the vehicle will choose when (and how much) to charge based on the preferred hours and the next upcoming timer that has charge? set to true. This timer will define the target charge level and the time at which that charge should be achieved, while the preferred hours help define when the actual charging will occur.

If the next timer occurs during the preferred hours, then the timer will execute normally — charging will start some time before the depart_time, based on how long the vehicle expects charging to take.

If the next timer occurs outside of the preferred hours, then the vehicle will start charging some time before preferred_time_end, and attempt to reach target_charge by the time preferred hours end.

Current unknowns (more testing needed):

  • If the vehicle is used after the end of preferred hours, but before a timer, and the vehicle no longer meets the requested target_charge, will the vehicle "top up" outside of preferred hours, or just fail to meet the charge target?
  • If preferred hours end at 6am, and you have a timer at 8am that requests 70% charge, and a timer at 10am that requests 80% charge, will it "look ahead" and charge to 80% by 6am, or just 70%?

Summary

Types

@type mode() :: :smart | :preferred_time
@type t() :: %PorscheConnEx.Struct.Emobility.ChargingProfile.ChargingOptions{
  minimum_charge: 0..100,
  mode: mode(),
  preferred_time_end: Time.t(),
  preferred_time_start: Time.t()
}