View Source PorscheConnEx.Struct.Emobility.Timer (porsche_conn_ex v0.1.0)
Structure describing a vehicle timer.
Timers are used to schedule charging, and/or to climatise (preheat/cool) the vehicle, e.g. in preparation for an upcoming trip.
API calls
- To create or update a timer, use
PorscheConnEx.Client.put_timer/4
. - To delete a timer, use
PorscheConnEx.Client.delete_timer/4
.
Fields
id
(integer) — the ID (slot number) of the timer (1 to 5)enabled?
(boolean) — whether the timer can trigger or notdepart_time
(NaiveDateTime
) — the local time the user intends to depart- For repeating timers, this will be the next upcoming occurrence.
repeating?
(boolean) — whether the event is a one-off (false
) or repeats (true
)weekdays
(list of integers, ornil
) — a list indicating ISO weekday numbers- Repeating timers will occur at
NaiveDateTime.to_time(depart_time)
on every listed day. - Non-repeating timers will have this set to
nil
.
- Repeating timers will occur at
climate?
(boolean) — whether the timer will engage preheating / coolingcharge?
(boolean) — whether the timer will charge the vehicletarget_charge
(integer) — the target charge percentage (0 to 100)- The official UIs limit you to 5% increments, but the API allows any value.
Note that depart_time
is the end time of charging / climatisation, and
not the start time. All activity will occur in the minutes prior to
depart_time
, on the assumption that this is when the user will actually want
a fully charged / climatised vehicle.
The actual start time will depend on several factors, including current battery charge, current temperature, etc. In particular, testing so far seems to indicates that climatisation timers will start sooner (i.e. preheat/cool for longer) if the vehicle is plugged in, since the vehicle is more willing to spend wall power than battery power. (It may even charge the battery while doing so, ignoring any charge targets or preferred charging hours.)
Charging behaviour
For timers with charge?
set to true
, if the vehicle current charge level
is below target_charge
percent, it will attempt to bring the vehicle up to
target_charge
in time for depart_time
.
The actual timing of the charge depends on the current charging profile, but in general, the vehicle will wait until as late as possible to charge.
This means that if you have preferred charging hours set in your profile, and
the timer is outside of those hours, then charging will occur at the tail end
of the those hours (for the block of hours immediately prior to
depart_time
).
Otherwise, charging will occur immediately before depart_time
. (This may
also occur if you use the car and drain the battery between the preferred
charging hours and the timer, but I have not confirmed this.)
Summary
Types
@type id() :: 1..5
@type weekday() :: 1..7