> For the complete documentation index, see [llms.txt](https://adatrack.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adatrack.gitbook.io/docs/documentation/features/travel-log.md).

# Travel Log

The Travel Log automatically detects and records trips for every GPS-equipped device — no configuration required. As your devices send telemetry, AdaTrack segments continuous location streams into discrete journeys, capturing distance, duration, speed, and every stop along the way.

***

## How It Works

AdaTrack's trip detector runs in real time alongside the telemetry ingestion pipeline. A per-device state machine monitors incoming location readings and applies three conditions before marking a trip as started:

* Speed exceeds **1.5 m/s (≈ 5.4 km/h)**
* That speed is sustained for at least **60 seconds**
* The device has moved at least **100 metres** during that window

This triple-condition check prevents GPS jitter, brief traffic-light stops, or slow parking-lot creep from creating spurious trips. A trip ends only after the device remains stationary for **5 continuous minutes**, so short stops at traffic lights or drive-throughs are folded into the ongoing trip as stops rather than treated as trip endings.

> Devices without a GPS location field in their decoded payload are silently skipped. No trip records are created for non-GPS devices.

***

## The Travel Log Page

Navigate to **Travel Log** in the sidebar to view all recorded trips.

### Trip List

The left panel shows a sortable, filterable table of all trips:

| Column     | Description                        |
| ---------- | ---------------------------------- |
| Device     | The device that made the trip      |
| Start Time | When the trip began                |
| Duration   | Total elapsed time                 |
| Distance   | Total distance travelled           |
| Stops      | Number of mid-trip pauses          |
| Max Speed  | Peak speed recorded                |
| Avg Speed  | Mean speed over the moving portion |
| Status     | Completed or Active                |

**Active trips** appear at the top with a live badge and updating distance/duration counters.

**Filtering:** Use the filter panel to narrow by device, date range, minimum distance, or trip status.

**Bulk actions:** Select multiple trips to export (CSV or GPX) or delete them in one action.

***

## Trip Detail

Click any trip row to navigate to the full trip detail page at `/travel-log/<trip-id>`. A breadcrumb bar at the top returns you to the trip list; the header shows the device name, trip date, duration, distance, and buttons for playback and export.

### Map and Timeline

On desktop, the map (65% width) and the trip timeline (35% width) appear side by side and fill the viewport height. On mobile, they stack vertically.

The map shows the full route as a **speed-gradient polyline** — green below 30 km/h, yellow below 60 km/h, orange below 100 km/h, and red above. Flag icons mark the start and end; pin icons mark each stop.

The timeline lists every event in the trip: departure, each stop with its timestamp and dwell time (and address if reverse-geocoding is available), and arrival. Timeline segment colours match the average speed of that leg.

### Stats

Below the map and timeline, summary cards show total distance, total duration, stop count, maximum speed, average speed, and idle time — plus a speed-over-time chart showing the peak speed recorded within each one-minute bucket across the journey.

***

## Trip Playback

The **Playback** button in the trip detail animates the device icon along the route at a rate proportional to its real-world speed.

| Control                | Description                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| Play / Pause / Restart | Standard transport controls                                                                |
| Speed multiplier       | 1×, 2×, 4×, 8×, 16×, 32×                                                                   |
| Timeline scrubber      | Drag to jump to any moment in the trip                                                     |
| Live data panel        | Shows current speed, heading, timestamp, and decoded payload fields at the playback cursor |

Stop events are marked on the scrubber so you can jump directly to each pause.

If the replaying device uses Codec8 TCP ingestion, a **Codec8 Telemetry Panel** appears alongside the timeline. It displays decoded IO element values (battery voltage, engine temperature, digital I/Os, event IO ID) at the current playback position and updates as you scrub.

***

## Export

Export individual trips in three formats from the export menu on any trip row or detail view:

| Format  | Contents                                                                           |
| ------- | ---------------------------------------------------------------------------------- |
| **CSV** | Header row with trip stats, then one row per stop                                  |
| **GPX** | Standards-compliant GPX 1.1 — `<trkpt>` for every GPS point, `<wpt>` for each stop |
| **PDF** | Map image, trip stats table, and stop list (uses the built-in reporting engine)    |

**Bulk export** (up to 1,000 trips): select trips in the list and choose CSV or GPX. The archive is prepared in the background and a download link is delivered via in-app notification or email.

***

## Manual Trip Editing

Auto-detected boundaries can be corrected when needed:

* **Split:** Select a point on the timeline to divide one trip into two at that timestamp.
* **Merge:** Combine two consecutive trips for the same device into one (allowed when the gap between them is under 60 minutes).
* **Delete:** Soft-deletes the trip so it disappears from the list but can be recovered by an admin if needed.

***

## Dashboard Widgets

Six Travel Log widgets are available in the Dashboard builder:

| Widget              | Description                                            |
| ------------------- | ------------------------------------------------------ |
| Trips Today         | Count of trips completed today across all your devices |
| Distance Today      | Total kilometres travelled today                       |
| Idle Time Today     | Total idle time today (hh:mm)                          |
| Last Trip Summary   | Card with the most recent completed trip's key stats   |
| Device Trip History | Sparkline of daily trip count for a selected device    |
| Active Trips        | Live list of devices currently on a trip               |

***

## Workflow Integration

Travel Log exposes two trigger nodes in **AdaTrack Flow**:

* **Trip Started** — fires the moment a new trip is detected; provides `device_name`, `started_at`, `start_lat`, `start_lng`.
* **Trip Completed** — fires when the trip ends; provides full trip stats including `distance_meters`, `duration_seconds`, `max_speed_ms`, `stop_count`, and start/end coordinates.

**Example:** Send a Slack notification whenever a vehicle travels more than 50 km in a single trip:

> `Trip Completed` → `IF distance_meters > 50000` → `Send Slack Message "{{device_name}} completed a {{distance_meters / 1000 | round}} km trip"`

***

## Report Blocks

Two Travel Log blocks are available in the **Report Designer**:

* **Trip Summary Table** — a structured table of trips for the report's scope and date range, configurable by column selection, grouping (by device or by day), and sort order.
* **Trip Map** — a static map image of all trip traces for the period, coloured by device or by speed gradient.

***

## Quotas & Tier Limits

| Limit                    | Community | Standard | Enterprise |
| ------------------------ | --------- | -------- | ---------- |
| Trip history retention   | 30 days   | 1 year   | Unlimited  |
| Trace points per trip    | 500       | 5,000    | Unlimited  |
| Bulk export max trips    | 100       | 1,000    | Unlimited  |
| Custom detector settings | —         | ✓        | ✓          |

Community tier devices use the system-default detection thresholds. Standard and Enterprise users can configure per-device thresholds (speed, distance, stop duration) from the device settings page.

***

## Detector Configuration (Standard & Enterprise)

Fine-tune how the trip detector behaves for each device under **Device Settings → Trip Detection**:

| Setting               | Default | Description                                                                                            |
| --------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| Min start speed       | 1.5 m/s | Speed that must be sustained to begin a trip                                                           |
| Min start duration    | 60 s    | How long the speed must be sustained                                                                   |
| Min start distance    | 100 m   | Cumulative distance required before trip starts                                                        |
| Min stop duration     | 30 s    | How long a pause must last before it counts as a stop (filters out brief slow-downs at traffic lights) |
| Stop confirm duration | 300 s   | How long a device must be stationary to end a trip                                                     |

Adjusting these thresholds is useful for low-speed assets (forklifts, golf carts) or high-speed assets where the defaults may be too conservative.
