|
5 | 5 | // |
6 | 6 | // # Taxonomy |
7 | 7 | // |
8 | | -// Every event carries {id, ts, type, layer, vehicle_id, ref_kind, |
9 | | -// ref_id, payload}. Timestamps are UTC (RFC3339); ts values are the |
10 | | -// source row's event time, never synthesised. Titles are NOT served |
11 | | -// by this API: the frontend localises by type so i18n stays complete. |
| 8 | +// Every event carries {id, ts, type, layer, vehicle_id, source, |
| 9 | +// ref_kind, ref_id, payload}. Timestamps are UTC (RFC3339); ts values |
| 10 | +// are the source row's event time, never synthesised. Titles are NOT |
| 11 | +// served by this API: the frontend localises by type so i18n stays |
| 12 | +// complete. Transitions report previous → new in payload from/to; |
| 13 | +// absent states are omitted, never invented. |
| 14 | +// |
| 15 | +// The default view is the COMPLETE history: an omitted ?layers= |
| 16 | +// enables every optional layer. An explicit CSV narrows to a subset. |
12 | 17 | // |
13 | 18 | // Default layer (always on): |
14 | 19 | // |
|
19 | 24 | // charge_start charging_sessions started_at start_place, start_soc_pct /charging/:id |
20 | 25 | // charge_end charging_sessions ended_at energy_added_wh, duration_s, /charging/:id |
21 | 26 | // end_soc_pct |
22 | | -// parked fsm_transitions ts from_state — |
23 | | -// online fsm_transitions ts from_state — |
24 | | -// asleep fsm_transitions ts from_state — |
25 | | -// offline fsm_transitions ts from_state — |
26 | | -// state_change fsm_transitions ts from_state, to_state (unknown target) — |
27 | | -// locked security_events ts (locked=true) — — |
28 | | -// unlocked security_events ts (locked=false)— — |
29 | | -// lock_unknown security_events ts state (unparseable to_state) — |
30 | | -// sentry_on security_events ts state (proto token, e.g. Armed) — |
31 | | -// sentry_off security_events ts state (Off/Unknown token) — |
32 | | -// sentry_unknown security_events ts state (missing to_state) — |
33 | | -// remote_start_on signal_log ts — — |
34 | | -// remote_start_off signal_log ts — — |
| 27 | +// parked fsm_transitions ts from, to — |
| 28 | +// online fsm_transitions ts from, to — |
| 29 | +// asleep fsm_transitions ts from, to — |
| 30 | +// offline fsm_transitions ts from, to — |
| 31 | +// state_change fsm_transitions ts from, to (unknown target) — |
| 32 | +// locked security_events ts (locked=true) from, to (bool) — |
| 33 | +// unlocked security_events ts (locked=false) from, to (bool) — |
| 34 | +// lock_unknown security_events ts from, to (raw) — |
| 35 | +// sentry_on security_events ts from, to (full proto tokens) — |
| 36 | +// sentry_off security_events ts from, to (full proto tokens) — |
| 37 | +// sentry_unknown security_events ts from, to (raw) — |
| 38 | +// valet_on/off security_events ts from, to (bool) — |
| 39 | +// security security_events ts event_type, from, to (unrecognized) — |
| 40 | +// remote_start_on signal_log ts from, to (bool) — |
| 41 | +// remote_start_off signal_log ts from, to (bool) — |
35 | 42 | // sw_update software_updates created_at version, status — |
36 | 43 | // sw_update_installed software_updates installed_at version — |
37 | 44 | // |
38 | | -// Optional layers (off by default, enabled via ?layers=): |
| 45 | +// Optional layers (on by default; narrowed via ?layers=): |
| 46 | +// |
| 47 | +// layer type(s) signal field(s) |
| 48 | +// turn_signals turn_signal {component, from, to, from/to_value} LightsTurnSignal (direction IS in the enum) |
| 49 | +// lights hazards_on/off, high_beams_on/off {from, to} LightsHazardsActive, LightsHighBeams |
| 50 | +// doors_windows door_open/closed {door, from, to}, DoorState* (bool), Fd/Fp/Rd/RpWindow |
| 51 | +// window {window, from, to, from/to_value} (WindowState enum) |
| 52 | +// hvac hvac_on/off {from, to, from/to_value} HvacPower (HvacPowerState enum, not watts) |
| 53 | +// gear gear {from, to, from/to_raw} drive_telemetry.gear ("ShiftStateD"/"D") |
| 54 | +// homelink homelink_nearby_on/off, arrived/left_{home, HomelinkNearby, LocatedAtHome, |
| 55 | +// work,favorite} {from, to} LocatedAtWork, LocatedAtFavorite |
| 56 | +// |
| 57 | +// Unmapped signal fields surface as generic signal events |
| 58 | +// {field, from, to} on the layer that queried them. |
| 59 | +// |
| 60 | +// # Enum display labels |
39 | 61 | // |
40 | | -// layer type(s) signal field(s) |
41 | | -// turn_signals turn_signal {value} LightsTurnSignal (enum number, no label map) |
42 | | -// lights hazards_on/off, high_beams_on/off LightsHazardsActive, LightsHighBeams |
43 | | -// doors_windows door_open/closed {door}, window {window, value} DoorState*, Fd/Fp/Rd/RpWindow |
44 | | -// hvac hvac_on {power_w} / hvac_off HvacPower (on = watts != 0) |
45 | | -// gear gear {gear} drive_telemetry.gear (P/R/N/D) |
46 | | -// homelink homelink_nearby_on/off, arrived/left_{home, HomelinkNearby, LocatedAtHome, |
47 | | -// work,favorite} LocatedAtWork, LocatedAtFavorite |
| 62 | +// signal_log stores proto enum NUMBERS. The timeline labels them with |
| 63 | +// read-side display maps (turnSignalShort, windowShort, hvacShort, |
| 64 | +// gearShortForm) that cite their generated sources |
| 65 | +// (internal/tesla/protomodel/enum_parsers_gen.go + the proto). These |
| 66 | +// maps do not import proto bindings and do not re-run the codec's |
| 67 | +// prefix-trim; the parity test asserts every entry against the |
| 68 | +// generated String() output. Unknown numbers render raw, never guessed. |
48 | 69 | // |
49 | 70 | // # Source-of-truth decisions |
50 | 71 | // |
|
65 | 86 | // scope and intentionally not mapped. |
66 | 87 | // - Summary sums skip NULL measures; a sum with zero contributors is |
67 | 88 | // null (unknown), never a fake 0 — except that counts are exact. |
| 89 | +// - Previous states come from stored data only: the prior row of the |
| 90 | +// same series (in-window chain seeded by a pre-window lookup for |
| 91 | +// security_events, whose writer leaves from_state NULL). |
68 | 92 | // |
69 | 93 | // # Bounds |
70 | 94 | // |
71 | | -// Output is hard-capped at dayLogEventCap events (truncated=true when |
72 | | -// over). signal_log and drive_telemetry inputs are fetched with LIMITs; |
73 | | -// hitting an input cap also sets truncated because edges may be lost. |
| 95 | +// Events page with limit (default 500, max 2000) + offset; |
| 96 | +// total_events counts every assembled event so callers page until |
| 97 | +// complete. truncated=true reports data LOSS (a signal/gear input cap |
| 98 | +// was hit), never paging: a partial page is not truncation. |
74 | 99 | package daylog |
0 commit comments