fix parsing

This commit is contained in:
2026-08-17 10:05:39 +02:00
parent fc60ab416e
commit 69239b8cdf
2 changed files with 111 additions and 99 deletions
+33 -22
View File
@@ -35,35 +35,44 @@ All metrics carry the `vin` label; all names carry the configurable prefix
|---|---|---|
| `mileage_km` | Gauge | Odometer reading |
| `hvsoc_percent` | Gauge | HV battery state of charge in % |
| `driver_present` | Gauge (bool) | Driver detected in vehicle |
| `cruising_range_km` | Gauge | Remaining range in km |
| `driver_present` | Gauge (bool) | Driver detected in vehicle |
| `cruising_range_km` | Gauge | Remaining range in km |
| `hvbattery_temperature_max_celsius` | Gauge | Max. HV battery temperature |
| `hvbattery_temperature_min_celsius` | Gauge | Min. HV battery temperature |
| `charging_state` | Enum | `chargingStatus.currentChargeState` |
| `charging_state` | Enum | Current charging state |
| `charge_power_kw` | Gauge | Current charging power in kW |
| `plug_connection_state` | Enum | Plug connection status |
| `plug_connection_state` | Enum | Plug connection status |
| `target_soc_percent` | Gauge | Charge target in % |
| `position_longitude` / `position_latitude` | Gauge | Last known position (only set when **both** coordinates were present in the same dataset) |
| `position_created_timestamp_seconds` | Gauge | Unix timestamp of the last known position |
| `locked` | Gauge (bool) | Combined lock status of all doors, trunk and hood (only `unlocked` if at least one component actively reports `UNLOCKED`) |
| `is_parked` | Gauge (bool) | Vehicle parked |
| `position_longitude` / `position_latitude` | Gauge | Last known position (only set when **both** coordinates were present in the same dataset) |
| `position_created_timestamp_seconds` | Gauge | Unix timestamp of the last known position |
| `locked` | Gauge (bool) | Vehicle locked, as a single combined flag reported directly by the portal |
| `is_parked` | Gauge (bool) | Vehicle parked |
| `parking_brake_engaged` | Gauge (bool) | Parking brake engaged |
| `driving_mode` | Enum | Active driving mode |
| `next_service_type` | Enum | Next due service type |
| `service_due_in_days` | Gauge | Remaining days until the next service |
| `last_vehicle_signal_timestamp_seconds` | Gauge | Timestamp of the last vehicle signal (`carCapturedUTCTimestamp`) |
| `driving_mode` | Enum | Active driving mode |
| `next_service_type` | Enum | Next due service type |
| `service_due_in_days` | Gauge | Remaining days until the next service |
| `last_vehicle_signal_timestamp_seconds` | Gauge | Timestamp of the most recent vehicle signal in the latest dataset |
| `uptime_seconds` | Gauge | Uptime of the exporter process |
| `last_successful_scrape_timestamp_seconds` | Gauge | Last scrape with **new** data |
| `health` | Gauge (bool) | `0` initially and after a failure, `1` once new data has been received at least once |
| `http_requests_total` | Counter | Total number of HTTP requests made to the portal (login + API calls) |
**Note on enum metrics:** The state space (e.g. possible values of
`drivingMode` or `chargingStatus.currentChargeState`) is compiled
best-effort from the sample dataset and comparable projects, and each one
includes an `UNKNOWN` fallback. If an unknown raw value shows up, it is
exported as `UNKNOWN` and additionally logged as `WARNING` - the state list
in `vw-eu-data-act-exporter.py` (the `*_STATES` constants) can then be
extended.
† These metrics are defined for API completeness but have no known source
field in the portal's "continuous" data feed - confirmed absent across 255
real datasets collected via `persist_raw_json` (only
`REPORT_TYPE_ENERGY_CONTENTS`, `REPORT_TYPE_CONFIGURATIONS`,
`REPORT_TYPE_CONSUMPTION_VALUES` and `REPORT_TYPE_ADDITIONAL_CONSUMPTION_VALUES`
were ever delivered). They will stay permanently absent from `/metrics`
output with this data source; this is expected, not a bug.
**Note on enum metrics:** `charging_state`'s state list
(`CHARGING_STATE_STATES` in `vw-eu-data-act-exporter.py`) is compiled from
values actually observed in 255 real datasets, plus an `UNKNOWN` fallback.
`driving_mode` and `plug_connection_state` (marked † above) are best-effort
guesses that have never been observed at all. If an unknown raw value shows
up for any enum, it is exported as `UNKNOWN` and additionally logged as
`WARNING` - the state list in `vw-eu-data-act-exporter.py` (the `*_STATES`
constants) can then be extended.
## Installation (systemd)
@@ -130,9 +139,11 @@ be independent of, and significantly shorter than, `scrape_interval_minutes`
(wrong password) or no datasets available in the portal yet (see
prerequisite above).
- A single metric is missing entirely: the corresponding field has never
been present in any dataset fetched so far (e.g.
`position_longitude`/`_latitude`, if both coordinates were never
delivered at the same time).
been present in any dataset fetched so far. For the metrics marked †
in the table above (e.g. `position_longitude`/`_latitude`,
`driving_mode`) this is expected - they simply aren't part of this
data source. For others, use `persist_raw_json` (see Configuration) to
inspect real payloads and check the field name is still correct.
- `WARNING ... Unknown enum value`: a new, not-yet-listed value for an enum
metric - the state is exported as `UNKNOWN`, extend the list in the
source code if needed.