Skip to content

angoikon/byd-trip-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

242 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Screenshot 2026-03-08 at 18 04 08

BYD Trip Stats

Trip Analytics & Telemetry Dashboard for BYD DiLink Vehicles

Android Kotlin Architecture License Changelog GitHub release GitHub downloads Unit Tests Integration Tests

๐Ÿš€ Getting Started โ€ข โœจ Features โ€ข ๐Ÿ–ผ๏ธ Screenshots โ€ข ๐Ÿ› ๏ธ Technical Stack โ€ข ๐Ÿ—บ๏ธ Integration Roadmap โ€ข ๐Ÿ”’ Privacy โ€ข ๐Ÿ“ž Contact


BYD Trip Stats is a feature-complete Android analytics dashboard for BYD DiLink vehicles โ€” built by a BYD Seal owner and running on production hardware. It now uses the BYD SDK and operates as a standalone in-car analytics app without relying on an external companion bridge.


๐Ÿš€ Getting Started

Requirements

  • A BYD vehicle with DiLink 3.0 (BEV as well as PHEV are supported)
  • Android 10 or higher on the DiLink head unit

Installation

  1. Download the latest signed APK from the Releases tab
  2. On your DiLink unit, run the app - enable installation from unknown sources and follow the on-screen prompt to install
  3. Launch BYD Trip Stats, grant permissions for saving data to your car's internal storage
  4. On first launch, select your BYD model and allow the app to finish initial setup

No Electro setup, MQTT broker, or topic configuration is required for normal operation.

Known Limitations

  • Some fields are still inferred or unresolved. SoH is currently shown as an estimate, there is no cabin temperature present in the SDK.
  • Background persistence depends on DiLink firmware behaviour. The app uses a foreground service, wake lock, boot receiver, and watchdog, but some BYD firmware builds are still aggressive about killing third-party apps while the car is off.

โœจ Feature Overview

Driving Intelligence

  • Fully autonomous trip detection via gear position events (D/R โ†’ P) โ€” zero driver input required
  • Session distance tracking independent of trip recording state
  • Short engine-off breaks can continue the same trip, with current segment and cumulative trip distance shown separately
  • Drive and regen modes are recorded for trip timelines and mode-efficiency analysis
  • Manual override with confirmation safeguards

Real-Time Telemetry

  • Live motor RPM per driven axle and estimated power split (AWD only: front 160 kW / rear 230 kW proportional to total output)
  • Battery SoH, cell voltage range, thermal min/max delta
  • HV and 12V bus voltage, tyre pressures per wheel (bar / PSI / kPa) and tyre temperatures (ร—4) where the car exposes them
  • Gear state, speed, engine power, regen detection
  • Environmentals card with ambient temperature and PM2.5 in/out readings where available

Range Projection Engine

  • Consumption model (Wh/km) fed from the BMS total-discharge counter โ€” the same source as the live consumption readout โ€” computed over a rolling 10 km window, with engine-power integration as a fallback
  • EMA smoothing with a 3 km stabilisation window for the live-trip tier
  • Three-tier model: live trip โ†’ historical speed bins โ†’ WLTP baseline, with the speed-bin tier engaging within ~0.2 km of starting to drive so the projection leaves the catalog baseline almost immediately
  • WLTP upper bound prevents implausible projections during low-speed urban starts
  • Compared continuously against BMS estimate with signed delta display

Trip Management

  • Multi-field filtering: date range, distance, energy, duration, efficiency
  • Six sort criteria with ascending/descending toggle
  • Configurable engine-off trip timeout and a minimum-trip-distance filter (Settings โ†’ Preferences)
  • Per-trip export as CSV, JSON, or a single self-contained HTML viewer โ€” saved locally or sent straight to a Telegram bot

Analytics & History

  • Full per-trip storage: route, telemetry timeseries, computed statistics
  • Daily / weekly / monthly / annual energy consumption views
  • Up to 14 heatmap dimensions with crosshair bin-range interaction (13 universal + 1 AWD-exclusive torque-split map)
  • OpenStreetMap route overlay with energy event markers, fully offline
  • Physics-based energy breakdown per trip: rolling resistance, aerodynamic drag, gradient (climb/descent), and auxiliary losses โ€” scaled to always sum to actual consumed energy
  • Drive and regen mode visualisation woven into existing charts: faint colour-coded background bands on Speed and Power charts show active drive mode across the full trip timeline; the Speed chart line itself changes colour segment-by-segment as the mode changes; crosshair tooltips on both charts show the active drive mode and regen mode at the touched moment; the Analysis tab Mode Insights card shows a horizontal stacked-bar summarising time spent in each drive and regen mode as a share of total trip distance

Reliability & Data

  • Room (SQLite) persistence with WAL, automated maintenance workers, and schema migrations
  • Scheduled encrypted backup via Telegram bot or local filesystem
  • Full database restore with integrity verification
  • Local safety backup before update installation
  • Direct vehicle polling with fallback listeners across charging, statistic, climate, instrument, speed, location, and energy devices
  • App Diagnostics monitor: live CPU, RAM, thread, and uptime stats with 60-second history charts and ADB shell runner, available in Settings โ†’ Data

Connections

  • Optional ABRP Link Generic upload using your ABRP user token
  • Optional outbound MQTT publisher for external brokers, using an Electro-compatible telemetry JSON schema
  • Connection status, test upload/publish actions, and human-readable last-sync timestamps

๐Ÿ–ผ๏ธ Visual Showcase

๐Ÿ“น Demo Video

BYD Trip Stats Demo
โ–ถ Click to watch on YouTube

I. Real-Time Dashboard

Adaptive layouts for both landscape and portrait orientations on the rotating infotainment screen, including full split-screen multi-app support. The UI palette mirrors the DiLink Ocean Series dark and light themes.

Dashboard โ€” Light Theme
Screenshot 2026-03-06 at 19 42 51
Dashboard โ€” Dark Theme
Split-Screen โ€” Horizontal
Split-Screen โ€” Vertical

II. Range Projection & Efficiency

A proprietary consumption-modelling algorithm computes realistic remaining range in real time โ€” based on your actual Wh/km from the BMS total-discharge counter, not the BMS's static range estimate. The projection self-calibrates across the trip using a rolling 10 km window with EMA smoothing, and is bounded by WLTP to prevent overcorrection during low-speed urban starts.

Live Range Projection
Consumption Trends

III. Trip Management

Trips are captured automatically via gear-position events โ€” no driver input required. The history view supports multi-field filtering, six sort criteria, and per-trip export as CSV, JSON, or a self-contained HTML viewer (saved locally or sent to a Telegram bot).

Trip History
Trip Filtering
Trip Sorting
Export (CSV / JSON)

IV. Deep Trip Analysis

Per-trip breakdown of every recorded metric: route path on OpenStreetMap, speed and power profiles, regen events, altitude, battery state, and cell-level data โ€” rendered across dedicated analysis tabs.

Trip Detail
Telemetry Overlays
Route Map
Route Analysis
Route Analysis (continued)

V. High-Resolution Charting

Every technical metric the vehicle exposes is charted โ€” front and rear motor RPM, torque distribution, battery cell voltages, thermal delta, SoH, and charging curves. All charts are custom-rendered on Canvas with no third-party charting libraries.

Speed & Motor Distribution
Power Profile & Energy Consumption
SoC & Elevation Detail
Detailed Chart View
Charts โ€” Vertical Orientation
Detailed Charts โ€” Vertical

VI. Heatmap Analysis

14 heatmap dimensions correlating any two telemetry axes โ€” speed vs. power, SoC vs. regen, tyre pressure vs. consumption, cell voltage spread vs. SoC, altitude vs. consumption, and more. Crosshair interaction shows exact bin ranges on tap. AWD cars gain an additional front vs. rear RPM torque-split heatmap.

Heatmaps โ€” Landscape
Heatmaps โ€” Vertical
Heatmaps โ€” Dark Mode

VII. Settings, Backup & Data Integrity

Direct vehicle configuration, local database backup and restore, Connections for ABRP/MQTT, and Telegram-based encrypted backup. Settings are logically grouped and include an in-app FAQ covering common DiLink behaviour, autostart survival, and charging-session caveats.

Preferences
Data Settings
Backup โ€” Telegram Integration
About & FAQ
FAQ (continued)

VIII. Battery Degradation Tracking (v1.4.0)

Tap the Battery Health card on the dashboard to open a dedicated SoH-over-time view. A least-squares trend line projects future health and estimates the year the pack will reach 80% โ€” the typical EV warranty threshold.


IX. Seasonal Analysis & Trip Goals (v1.4.0)

Seasonal Analysis (โ˜€๏ธ in Trip History toolbar) groups all trips by meteorological season and visualises average consumption per season with a reference line from your car's WLTP figures. Automatically generates a winter-penalty insight when both winter and summer data are present.

Trip Goals & Personal Bests (๐Ÿ† in Trip History toolbar) tracks lowest ever efficiency, longest single trip, and longest consecutive daily driving streak. Set a consumption target and/or monthly distance goal โ€” animated progress bars update in real time.


X. Cost Tracking (v1.4.0)

Tap the โ‚ฌ icon in Trip History to set your electricity tariff. Trip cost appears inline in the energy consumed field (4.40 kWh (โ‚ฌ0.62)) and in a collapsible monthly summary card showing up to 12 months of history.


XI. Hybrid Charging Session Recording (v1.4.0 โ†’ v2.0.0)

Two complementary mechanisms cover all charging scenarios with no user interaction required:

  • Car ON โ€” real-time session with full Power / SoC / Voltage / Temperature charts in the Charging Detail view
  • Car OFF โ€” SoC delta reconstruction on next wake-up still covers overnight, timed, and remote charging sessions when DiLink kills the app mid-charge

XII. Connections (v2.0.0)

The app remains standalone for normal use, but can optionally forward live telemetry to external tools:

  • ABRP โ€” upload live car telemetry to ABRP via Link Generic token
  • MQTT โ€” publish Electro-compatible JSON to an external broker and topic, with drive/regen modes exported as readable names

Both integrations are opt-in and can be disabled without affecting local trip recording, charts, backups, or dashboard telemetry.


๐Ÿ› ๏ธ Technical Stack

Layer Technology Notes
Language Kotlin 1.9 100% Kotlin, no Java
UI Jetpack Compose + Material 3 Adaptive for DiLink landscape / portrait / split-screen
Architecture MVVM + StateFlow Clean ViewModel/Repository separation
Persistence Room (SQLite) WAL mode, versioned migrations, maintenance workers
Async Kotlin Coroutines + Channels Event-driven telemetry pipeline
Charts Custom Canvas rendering No third-party chart libraries
Maps OpenStreetMap (OSMDroid) Fully offline-capable
Optional outbound connections ABRP + HiveMQ MQTT client Disabled by default; used only when configured
Build Gradle KTS ProGuard release build, signed APK pipeline
Min SDK API 29 (Android 10) Matches DiLink 3.0 platform

๐Ÿ—บ๏ธ Integration Roadmap

The project now runs as a standalone in-car telemetry application. Remaining work is focused on improving persistence and polishing a few edge cases.

Phase 1 โ€” Legacy (External bridge)
  Electro app โ†’ MQTT broker โ†’ BYD Trip Stats

Phase 2 โ€” Current (Standalone in-car operation)
  BYD Trip Stats running independently on supported vehicles

Phase 3 โ€” Full OEM integration
  Logic absorbed into DiLink firmware; UI surfaced as a native DiLink panel

What changes between phases: the runtime moved away from the legacy bridge setup and into a self-contained in-car architecture. The ViewModel, Room persistence, charts, range projection engine, charging-session model, and UI remained largely intact, which is exactly why the migration was feasible without rewriting the product.

The competitive case for Phase 2/3 is straightforward:

Capability Current DiLink OEM Competitor Benchmark BYD Trip Stats
Trip range projection BMS estimate only Real-time consumption model (Tesla) Power-integrated live projection
Consumption history 50 km rolling window Weekly / Monthly / Annual (BMW, Polestar) Daily / Weekly / Monthly / Annual
Motor telemetry Not exposed Front/rear torque split live view (NIO) Real-time RPM + power distribution
Battery granularity SoC % only Cell voltage, SoH, thermal ranges Cell min/max voltage, SoH, thermal delta
Trip intelligence Manual Gear-event triggered (NIO) Fully autonomous โ€” gear position D/R/P
Trip filtering & sorting Not available Basic date filter Multi-field filter + 6 sort criteria
Data export Not available Varies CSV / JSON per trip
Data sovereignty Cloud-dependent Varies 100% local, zero external calls

๐Ÿ”’ Data Privacy & Security

  • Local-first: 100% of telemetry and trip data stored on-device โ€” no cloud, no third-party analytics
  • Zero default outbound telemetry: No tracking, no crash reporting, and no data leaves the vehicle unless you explicitly opt in to one of the integrations below
  • Release privacy: Release builds strip debug log calls and keep sensitive probe/discovery paths out of normal user-facing behaviour
  • GDPR-aligned by design: No personal data is collected or transmitted by the app itself

Optional external data flows

All three are disabled by default and require explicit configuration. You control the destination โ€” the app sends nothing unless you set it up.

Integration What is sent Destination
Telegram bot backup Encrypted database backup file Your own private Telegram bot (bot token + chat ID you supply). Data goes to Telegram's servers as a file attachment to your bot.
MQTT broker Live telemetry JSON (speed, SoC, power, GPS, gear, etc.) at a configurable interval An external MQTT broker you specify (e.g. HiveMQ Cloud, a self-hosted broker). You control the host, topic, and credentials.
ABRP (A Better Route Planner) Live telemetry snapshot (SoC, speed, power, GPS) ABRP servers, via the Link Generic API using a user token you provide. Subject to ABRP's own privacy policy.

This architecture requires no modification to comply with EU data regulations.


๐Ÿ“„ Licence

This project is licensed under the Business Source Licence 1.1 (BUSL-1.1).

You are free to view, fork, and use the source for personal and non-commercial purposes. Commercial use โ€” including integration into vehicle firmware, commercial products, or redistribution as part of a paid service โ€” requires a separate written licence agreement.

See LICENSE.md for the full terms.


๐Ÿ“ž Contact & Proposal

I am an independent software engineer and BYD Seal owner based in Greece. I built this application because the gap between the Seal's hardware capability and its software experience was significant enough to solve myself. The application is feature-complete and running on production hardware today.

If you represent BYD's Smart Device or Product Strategy team, I am open to discussing:

1. Native System Integration โ€” Porting the application as a DiLink system-signed APK and turning the current standalone solution into a first-class OEM experience. This would deliver the full feature set to all DiLink-equipped BYD vehicles via OTA.

2. Analytics Algorithm Licensing โ€” The range projection engine, trip intelligence logic, and consumption modelling are available for licensing into official BYD firmware or companion applications.

3. Technical Collaboration โ€” A scoped engagement to evaluate, extend, or adapt this work for official roadmap integration.

For all other enquiries โ€” bug reports, feature requests, community discussion โ€” please open a GitHub Issue.


๐Ÿค Contributing

Contributions are welcome! Whether it's bug reporting or new feature requests.

Areas you might assist

  • ๐Ÿ› Testing on Dolphin, Atto3 as well as other BYD models
  • ๐ŸŒ Translations to other languages
  • ๐Ÿ“Š New chart types or visualizations
  • ๐Ÿ—บ๏ธ Enhanced route analysis features
  • ๐Ÿ“ฑ UI/UX improvements

Reporting Bugs

Found a bug? Open an Issue with:

  • Your BYD model
  • Version app
  • Steps to reproduce the problem
  • Logcat output (if possible)

Feature Requests

Have an idea? Open an issue with the "enhancement" label โ€” well-reasoned requests are regularly considered for future releases.

Testing Help

If you are running BYD Trip Stats on a Dolphin, Atto3, or any other BYD model, reports about what works and what doesn't are especially valuable.


๐Ÿ—บ๏ธ Roadmap

Shipped

  • Predefined vehicle configuration โœ… (v1.1.0)
  • Charging session tracking โœ… (v1.2.0)
  • Trip comparison view โœ… (v1.2.0)
  • Heatmap: Tyre Pressure vs Consumption โœ… (v1.4.0)
  • Heatmap: SOC vs Regen Efficiency โœ… (v1.4.0)
  • Heatmap: Speed vs Battery Temperature โœ… (v1.4.0)
  • Heatmap: Cell Voltage Spread vs SOC โœ… (v1.4.0)
  • Battery degradation tracking โœ… (v1.4.0)
  • Cost tracking โœ… (v1.4.0)
  • Seasonal consumption analysis โœ… (v1.4.0)
  • Trip goals & personal bests โœ… (v1.4.0)
  • Standalone direct BYD telemetry runtime โœ… (v2.0.0)
  • ABRP and outbound MQTT Connections โœ… (v2.0.0)
  • Drive/regen mode timelines and analysis โœ… (v2.0.0)
  • Environmentals PM2.5 display โœ… (v2.0.0)
  • Slope in degrees display โœ… (v2.0.0)
  • App diagnostics CPU/RAM monitor โœ… (v2.0.0)
  • Physics-based per-trip energy breakdown โœ… (v2.0.0)
  • 12V DC monitoring when car is off โ€” rolling 48-hour chart overlaying HV bus voltage, cell min/max, and SoC so 12V drain events (and the corresponding HV top-up) are immediately visible โœ… (v2.1.0)
  • Self-contained HTML trip viewer + one-click "Save as HTML viewer" export โœ… (v2.5.0)
  • Configurable engine-off trip timeout & minimum-trip-distance filter โœ… (v2.5.0)
  • Web dashboard companion โ€” browse trip history and charts on any browser offline-first: upload your backup file, charts render locally, nothing leaves your device; built as a PWA so it can be added to your phone's home screen for a near-native experience โœ… (v2.7.0)

Planned (v2.0.0+)

  • Recurring route detection โ€” automatically group trips that share the same route (e.g. daily commute) and compare efficiency across instances
  • Trip merging โ€” combine two auto-split trips that were the same journey, separated by a brief stop (e.g. petrol station, red light timeout)
  • Trip tagging โ€” label trips with a custom tag (e.g. "commute", "motorway", "errand") and filter history and analytics by tag
  • Battery cell imbalance alert โ€” threshold-based notification when cell voltage spread exceeds a configurable limit (e.g. 0.05 V), surfacing the diagnostic the Cell Voltage Spread heatmap already visualises
  • DiLink home screen widget โ€” quick-glance tile showing current SoC, last trip distance, and range projection without opening the app Vote on features by ๐Ÿ‘ reacting to issues!

๐Ÿ› Known Issues

Current Limitations

  1. No offline charts - Route maps require internet first time
  2. No trip editing - Can't modify trip start/end times
  3. No cloud sync - All data is local only

Workarounds

  • Route not showing: Check that GPS coordinates are non-zero and that DiLink location permissions/autostart are still enabled
  • Trip not auto-starting: Verify auto-detection is ON, gear is D/R
  • Service not auto-starting: Check Autostart permission (disable toggle at disable Autostart), reboot the UI and re-open the app

See Issues for full list.


โ“ FAQ

Q: Does this work with other BYD EVs?

A: Potentially. Compatibility depends on how similar your car's DiLink firmware is to the tested models. Tested primarily on BYD Seal.

Q: Do I need Electro or an Electro subscription?

A: No. The app runs standalone on supported vehicles and does not require Electro, a broker, or an MQTT topic for normal use.

Q: Will this drain my car's 12V battery?

A: It uses your 12V which is always being charged via your high-voltage EV battery. Very minimal battery impact.

Q: Can I use this without side-loading?

A: No. The ultimate goal is for BYD to implement it natively as part of the infotainment system, without the need to side-load.

Q: Is my data secure?

A: Yes. All telemetry stays on your device by default. No analytics, no crash reporting, no advertising. The only optional outbound traffic is: Telegram backup (encrypted DB file to your own private bot), MQTT publish (live telemetry to a broker you configure), and ABRP upload (live snapshot to ABRP via your own user token). All three are opt-in and disabled unless you configure them. See the Data Privacy section for details.

Q: Can I export to Excel?

A: Export as CSV, then open in Excel, Google Sheets, etc.

Q: Why isn't the app receiving live data?

A: Check:

  1. The app was started at least once after boot/update
  2. DiLink's "Disable Autostart" blocker is toggled off for BYD Trip Stats
  3. The car was rebooted after changing autostart behaviour
  4. Location/storage permissions are still granted

๐Ÿ™ Acknowledgments

Built With


๐Ÿ’ฌ Community & Support

Get Help

Share Your Experience

  • โญ Star this repo if you find it useful!
  • ๐Ÿ—ฃ๏ธ Share on BYD communities (Reddit, Facebook)
  • ๐Ÿ“ธ Post screenshots of your trips

Stay Updated

  • ๐Ÿ‘๏ธ Watch this repo for release notifications
  • ๐Ÿ”” Enable notifications for issues you're interested in

โ˜• Support Development

If you'd like to support development:

  • โญ Star this repository (it's free and motivates me!)
  • ๐Ÿ› Report bugs to improve the app
  • ๐Ÿ’ก Suggest features you'd love to see
  • ๐Ÿ“ฃ Spread the word in BYD communities
  • ๐Ÿค Contribute code via pull requests

Optional donation:

Every contribution helps make this app better for everyone!


โš–๏ธ Disclaimer

This software is provided "as is" without warranty of any kind. Use at your own risk.

  • Not responsible for any vehicle damage or data loss
  • Always prioritize safe driving over app usage
  • When Telegram backup is enabled, your encrypted database file is sent to Telegram's servers as a file attachment to your bot. If you do not trust a third-party server with your data even in encrypted form, use local filesystem backup instead

Angelos Oikonomou Software Engineer ยท BYD Seal Owner

๐Ÿ“ง bydtripstats@gmail.com

๐Ÿ”— github.com/angoikon

๐ŸŽฎ Discord


Independent project. Not affiliated with BYD Auto Co., Ltd. or the Electro application. All trademarks belong to their respective owners.

About

App for BYD EV cars for statistics and data visualization

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors

Languages