Skip to content

feat(grafana): add Trip Cost and Cost/100km panels to Drive Details#5334

Draft
finikwashere wants to merge 1 commit into
teslamate-org:mainfrom
finikwashere:feat/drive-details-trip-cost-estimate
Draft

feat(grafana): add Trip Cost and Cost/100km panels to Drive Details#5334
finikwashere wants to merge 1 commit into
teslamate-org:mainfrom
finikwashere:feat/drive-details-trip-cost-estimate

Conversation

@finikwashere
Copy link
Copy Markdown

Closes #5333

Added two new stat panels to the Drive Details dashboard that estimate the cost of a trip based on recent charging price data:

  • Trip Cost (est.): total estimated cost for the drive
  • Ø Cost / 100 : estimated cost per 100 km or 100 mi

Cost/kWh is determined by a 3-tier lookup:

  1. Average cost/kWh across all charging sessions that ended within the 24 hours before the drive started (the most relevant window)
  2. Fallback: cost/kWh of the single most recent charge before the drive, if no sessions exist in the 24h window
  3. N/A if no prior charge has cost data at all

Both panels are placed at y=28 alongside the existing Distance driven and Elevation Summary panels (all resized to w=3 to fit on one row).

Add two new stat panels to the Drive Details internal dashboard that
estimate the cost of a trip based on recent charging price data:

- Trip Cost (est.): total estimated cost for the drive
- Ø Cost / 100 <unit>: estimated cost per 100 km or 100 mi

Cost/kWh is determined by a 3-tier lookup:
  1. Average cost/kWh across all charging sessions that ended within
     the 24 hours before the drive started (the most relevant window)
  2. Fallback: cost/kWh of the single most recent charge before
     the drive, if no sessions exist in the 24h window
  3. N/A if no prior charge has cost data at all

Both panels are placed at y=28 alongside the existing Distance driven
and Elevation Summary panels (all resized to w=3 to fit on one row).
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for teslamate ready!

Name Link
🔨 Latest commit debfc0c
🔍 Latest deploy log https://app.netlify.com/projects/teslamate/deploys/6a03091bc73b44000774ddb7
😎 Deploy Preview https://deploy-preview-5334--teslamate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@JakobLichterfeld JakobLichterfeld marked this pull request as draft May 12, 2026 13:04
@JakobLichterfeld JakobLichterfeld added the note:discussion Details or approval are up for discussion label May 12, 2026
@JakobLichterfeld
Copy link
Copy Markdown
Member

JakobLichterfeld commented May 12, 2026

Thanks for your idea. Cost per drive is not a metric which is valuable, even for a trip it is misleading, see #2433 (comment) and #4678 (comment)

@JakobLichterfeld JakobLichterfeld added the area:dashboard Related to a Grafana dashboard label May 12, 2026
@finikwashere finikwashere marked this pull request as ready for review May 15, 2026 20:38
@JakobLichterfeld JakobLichterfeld marked this pull request as draft May 18, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dashboard Related to a Grafana dashboard note:discussion Details or approval are up for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(grafana): Add estimated Trip Cost panels to Drive Details dashboard

2 participants