d893ff383a
Gauges: - Optional per-metric warning zones (warn_hi/redline_hi/warn_lo/redline_lo) in the profile schema; gauges draw colored redline/warn bands and color the needle + readout by zone. Default neutral when unset (no false redline). - Removed the value progress-arc fill (it dominated the dial / looked wrong) -> clean tach face: bezel, ticks, numeric scale, needle, redline band, readout. - Auto-derivation rejected: bad direction/threshold vary per metric, so zones are config (with a sensible neutral default). Units: - New Units menu: Temperature C / F. Converts gauges, graph, table, and PID browser (values, scale, zones, unit labels) at display time; data stays C. Ford 6.0 profile: zones for ICP (red<500), FICM (red<40/amber40-48/green48+), ECT/EOT (high redline), RPM (redline 3800), boost, battery; tightened FICM (38-52) and battery (9-15) ranges so redline bands land sensibly. Docs: profiles/PROFILE_SPEC.md -- canonical, AI-agent-ready profile spec (schema, formula language, zones, confidence, rules); README points to it. Validated headless: zones parse/classify, F conversion (112C->233.6F, zones converted), gauges render; obdcore + diagnostics tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016yT89n4zR4qbrySoSiEyZs
93 lines
4.3 KiB
Markdown
93 lines
4.3 KiB
Markdown
# Vehicle Profiles
|
||
|
||
Each `*.json` file here is a **vehicle profile** — pure data that makes the
|
||
OBDash app vehicle-agnostic. A profile defines a vehicle's PIDs (with safe
|
||
scaling formulas), DTC meanings, and named presets. Load one in the app via
|
||
**Profile → Load**, or drop a new file in this folder and it appears in the list.
|
||
|
||
**Contributions welcome** — add a profile for your vehicle and open a PR.
|
||
|
||
> 📋 **The canonical, AI-agent-ready format is [`PROFILE_SPEC.md`](PROFILE_SPEC.md).**
|
||
> Researching a new vehicle? Paste that spec into your AI agent and say *"produce
|
||
> an OBDash vehicle profile JSON for <year make model engine> per this spec."*
|
||
> The summary below is a quick reference; the spec is authoritative.
|
||
|
||
## Current profiles
|
||
|
||
| File | Vehicle | Notes |
|
||
|---|---|---|
|
||
| `ford-6.0-powerstroke.json` | Ford 6.0L Power Stroke (2003–2007) | Verified Mode-22 PIDs (ICP, FICM, EBP, MAP/BARO, EOT, …) + DTCs |
|
||
| `jeep-wrangler-4.0-1997.json` | 1997 Jeep Wrangler TJ 4.0L I6 | ISO 9141-2; speed-density (MAP), single-bank trims, Chrysler P1xxx DTCs |
|
||
| `ford-mustang-cobra-4.6-1996.json` | 1996 Mustang SVT Cobra 4.6 DOHC 32V | EEC-V, SAE J1850 PWM, MAF, Ford P1xxx DTCs |
|
||
| `ford-mustang-gt-4.6-1996.json` | 1996 Mustang GT 4.6 SOHC 2V | EEC-V, SAE J1850 PWM, MAF, Ford P1xxx DTCs |
|
||
| `mercury-mountaineer-4.6-2006.json` | 2006 Mercury Mountaineer 4.6 V8 | EEC-V, MAF, Ford P1xxx DTCs (verify PWM-vs-CAN on the vehicle) |
|
||
| `generic-obd2.json` | Any OBD-II vehicle (1996+) | Standard SAE Mode-01 PIDs only — a base to fork from |
|
||
|
||
Profiles for the four 1996–2006 vehicles were built from web research (standard
|
||
SAE PIDs + manufacturer DTCs), validated through the loader, but **not yet read
|
||
on the actual vehicles** — confidence reflects sourcing, not bench confirmation.
|
||
|
||
## Schema (`schema: 1`)
|
||
|
||
```jsonc
|
||
{
|
||
"schema": 1,
|
||
"meta": {
|
||
"name": "Ford 6.0L Power Stroke", // shown in the Profile menu
|
||
"make": "Ford", "model": "...", "years": "2003-2007",
|
||
"engine": "6.0L Power Stroke diesel",
|
||
"author": "you", "version": "1.0.0",
|
||
"protocol": "auto", // ELM ATSP target, or "auto"
|
||
"notes": "provenance / confidence policy / caveats"
|
||
},
|
||
"presets": { "crank": ["ICP","FICM_M","BATT","RPM"], "...": [] },
|
||
"pids": [ /* see below */ ],
|
||
"dtcs": [ {"code":"P0087","desc":"...","system":"fuel","no_start":true,"causes":""} ]
|
||
}
|
||
```
|
||
|
||
### PID fields
|
||
|
||
| Field | Meaning |
|
||
|---|---|
|
||
| `key` | short unique id used in presets/derived (e.g. `ICP`) |
|
||
| `name` | display name |
|
||
| `mode` | `01` (generic SAE), `22` (manufacturer-enhanced), `atrv` (adapter pin voltage), `derived` (computed from other PIDs) |
|
||
| `pid` | request id hex — `0C` (mode 01) or `1446` (mode 22) |
|
||
| `nbytes` | expected data bytes in the response |
|
||
| `formula` | scaling expression (see below) |
|
||
| `round` | display rounding: omit = raw, `0` = integer, `2` = 2 dp |
|
||
| `unit`, `group` | display unit; group = `fuel\|ficm\|air\|engine\|driveline\|power\|misc` |
|
||
| `vmin`,`vmax` | range (used for gauges + the Normalize overlay) |
|
||
| `confidence` | `verified` (multi-source / read on a real vehicle), `doc` (sourced, unconfirmed), `tentative` (single-source / disputed) |
|
||
| `deps` | for `derived`: the PID keys the formula references |
|
||
| `notes` | freeform; surfaced as a tooltip |
|
||
|
||
### Formula language
|
||
|
||
Arithmetic over **data-byte variables** `A, B, C, …` (byte 0, 1, 2, …) — the
|
||
same convention as Torque/FORScan/ScanGauge:
|
||
|
||
```
|
||
(A*256+B)*0.57 # 16-bit * scale (ICP psi)
|
||
A-40 # 8-bit temp
|
||
(A>>1)&1 # a status bit
|
||
A//2 # integer divide (gear)
|
||
```
|
||
|
||
For `derived` PIDs the variables are **other PID keys**: `"MAP - BARO"` with
|
||
`"deps": ["MAP","BARO"]`.
|
||
|
||
Formulas are evaluated by a **safe AST evaluator** (`obdcore/formula.py`):
|
||
only numbers, the declared variables, arithmetic/bitwise operators, and
|
||
`min/max/abs/round/int/float` are allowed. Anything else (names, attribute
|
||
access, arbitrary calls) is rejected at load — so a community profile **cannot
|
||
execute code**.
|
||
|
||
## Caveats worth recording in `notes`
|
||
|
||
- Manufacturer-enhanced (`22`) PIDs vary by model year and PCM strategy.
|
||
- Some signals aren't on the OBD stream at all (e.g. the 6.0 has no EGT or
|
||
lube-oil-pressure PID — only ICP and EOT). Don't invent them.
|
||
- Mark single-source numbers `tentative` and say so in `notes`.
|