Skip to content

Commit 39a11af

Browse files
committed
Release v1.5.2: Add last-trip sensors and improve metadata
1 parent 84d03c8 commit 39a11af

File tree

17 files changed

+130
-6
lines changed

17 files changed

+130
-6
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project are documented in this file.
44

5+
## [1.5.2] - 2026-03-18
6+
7+
### Changed
8+
- **Repository Metadata**: Improved manifest, HACS metadata, and service descriptions for a cleaner Home Assistant and HACS experience.
9+
- **Trip Entities**: Added optional sensors for last trip average speed and last trip duration, and expanded last-trip attributes with average speed details.
10+
11+
### Fixed
12+
- **Documentation**: Refined the README to better explain installation, available entities, and the built-in refresh service.
13+
- **Translations**: Added localized labels for the new last-trip sensors across the bundled translations.
14+
515
## [1.5.1] - 2026-03-18
616

717
### Changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
![GitHub Release](https://img.shields.io/github/v/release/Syax89/geotab-hacs-integration?style=for-the-badge)
55
![License](https://img.shields.io/github/license/Syax89/geotab-hacs-integration?style=for-the-badge)
66

7-
A professional-grade Home Assistant integration for the Geotab fleet management platform. This component facilitates the seamless synchronization of telematics data, providing comprehensive vehicle monitoring, diagnostic analysis, and real-time tracking directly within the Home Assistant ecosystem.
7+
A Home Assistant integration for the Geotab fleet management platform. It brings live vehicle position, driving state, diagnostics, active faults, and trip statistics into Home Assistant through the standard UI and HACS.
88

99
---
1010

@@ -13,7 +13,7 @@ A professional-grade Home Assistant integration for the Geotab fleet management
1313
* **High-Precision Tracking**: Dedicated `device_tracker` entities providing real-time geographical coordinates for all fleet assets.
1414
* **Diagnostic Trouble Codes (DTC)**: Advanced monitoring of active engine faults with detailed reporting on fault codes, human-readable descriptions, and severity indicators (lamp status).
1515
* **Extended Telematics**: Access to over 30 distinct data points per vehicle, including fuel metrics, tire pressures, and engine health parameters.
16-
* **Historical Aggregation**: Built-in calculation of daily, weekly, and monthly trip statistics, including distance covered and idle time analysis.
16+
* **Historical Aggregation**: Built-in calculation of daily, weekly, and monthly trip statistics, including distance covered, average driving speed, last-trip metrics, and idle time analysis.
1717
* **Internationalization**: Full localization support for English, Italian, German, Spanish, French, Dutch, and Portuguese.
1818

1919
---
@@ -43,7 +43,7 @@ Entities are logically categorized to ensure a streamlined user interface and ef
4343
### Trip Statistics
4444
* **Aggregated Metrics**: Daily, weekly, and monthly distance tracking.
4545
* **Operational Analysis**: Trip counts, average driving speed, and weekly idle time reports.
46-
* **Last Journey**: Comprehensive data on the most recently completed trip.
46+
* **Last Journey**: Dedicated last-trip distance, duration, and average-speed sensors.
4747

4848
---
4949

@@ -77,6 +77,19 @@ Entities are logically categorized to ensure a streamlined user interface and ef
7777

7878
*Note: Integration parameters can be modified post-installation via the **Configure** interface.*
7979

80+
### Included Entities
81+
82+
By default the integration creates, for each Geotab vehicle:
83+
84+
* a `device_tracker` entity for live position
85+
* primary sensors such as odometer, fuel level, speed, and last update
86+
* binary sensors for ignition, driving state, and active faults
87+
* optional diagnostic and trip-analysis sensors that can be enabled from the entity registry
88+
89+
### Built-In Service
90+
91+
The integration registers the `geotab.refresh` service, which triggers an immediate refresh for all configured Geotab entries.
92+
8093
---
8194

8295
## 🛡️ Technical Integrity & Security

custom_components/geotab/manifest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
"codeowners": ["@simonerondina"],
55
"config_flow": true,
66
"documentation": "https://github.com/Syax89/geotab-hacs-integration",
7+
"integration_type": "service",
78
"iot_class": "cloud_polling",
89
"issue_tracker": "https://github.com/Syax89/geotab-hacs-integration/issues",
10+
"loggers": ["mygeotab"],
911
"requirements": ["mygeotab>=0.9.1,<1.0.0"],
10-
"version": "1.5.1"
12+
"version": "1.5.2"
1113
}

custom_components/geotab/sensor.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,29 @@ class GeotabSensorEntityDescription(SensorEntityDescription):
318318
else None
319319
),
320320
),
321+
GeotabSensorEntityDescription(
322+
key="last_trip_average_speed",
323+
translation_key="last_trip_average_speed",
324+
icon="mdi:speedometer-medium",
325+
native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR,
326+
device_class=SensorDeviceClass.SPEED,
327+
state_class=SensorStateClass.MEASUREMENT,
328+
value_fn=lambda data: trip_stats.last_trip_average_speed(
329+
data.get("last_trip")
330+
),
331+
entity_registry_enabled_default=False,
332+
),
333+
GeotabSensorEntityDescription(
334+
key="last_trip_duration",
335+
translation_key="last_trip_duration",
336+
icon="mdi:timer-outline",
337+
native_unit_of_measurement=UnitOfTime.HOURS,
338+
state_class=SensorStateClass.MEASUREMENT,
339+
value_fn=lambda data: trip_stats.last_trip_duration_hours(
340+
data.get("last_trip")
341+
),
342+
entity_registry_enabled_default=False,
343+
),
321344
GeotabSensorEntityDescription(
322345
key="daily_distance",
323346
translation_key="daily_distance",
@@ -474,6 +497,7 @@ def extra_state_attributes(self) -> dict[str, Any] | None:
474497
return {
475498
"start": trip.get("start"),
476499
"stop": trip.get("stop"),
500+
"average_speed": trip.get("averageSpeed"),
477501
"maximum_speed": trip.get("maximumSpeed"),
478502
"driving_duration": trip.get("drivingDuration"),
479503
"idling_duration": trip.get("idlingDuration"),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
refresh:
22
name: Refresh
33
description: Force an immediate data refresh from the Geotab API for all configured entries.
4+
fields: {}

custom_components/geotab/strings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
"accelerator_pos": { "name": "Accelerator Position" },
4848
"throttle_pos": { "name": "Throttle Position" },
4949
"last_trip_distance": { "name": "Last Trip Distance" },
50+
"last_trip_average_speed": { "name": "Last Trip Average Speed" },
51+
"last_trip_duration": { "name": "Last Trip Duration" },
5052
"daily_distance": { "name": "Daily Distance" },
5153
"weekly_distance": { "name": "Weekly Distance" },
5254
"monthly_distance": { "name": "Monthly Distance" },

custom_components/geotab/translations/de.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
"accelerator_pos": { "name": "Gaspedalstellung" },
4848
"throttle_pos": { "name": "Drosselklappenstellung" },
4949
"last_trip_distance": { "name": "Letzte Fahrtstrecke" },
50+
"last_trip_average_speed": { "name": "Letzte Fahrt: Durchschnittsgeschwindigkeit" },
51+
"last_trip_duration": { "name": "Letzte Fahrt: Dauer" },
5052
"daily_distance": { "name": "Fahrten: Tägliche Strecke" },
5153
"weekly_distance": { "name": "Fahrten: Wöchentliche Strecke" },
5254
"monthly_distance": { "name": "Fahrten: Monatliche Strecke" },

custom_components/geotab/translations/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
"accelerator_pos": { "name": "Accelerator Position" },
4848
"throttle_pos": { "name": "Throttle Position" },
4949
"last_trip_distance": { "name": "Last Trip Distance" },
50+
"last_trip_average_speed": { "name": "Last Trip Avg Speed" },
51+
"last_trip_duration": { "name": "Last Trip Duration" },
5052
"daily_distance": { "name": "Trips: Daily Distance" },
5153
"weekly_distance": { "name": "Trips: Weekly Distance" },
5254
"monthly_distance": { "name": "Trips: Monthly Distance" },

custom_components/geotab/translations/es.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
"accelerator_pos": { "name": "Posición del acelerador" },
4848
"throttle_pos": { "name": "Posición de la mariposa" },
4949
"last_trip_distance": { "name": "Distancia del último viaje" },
50+
"last_trip_average_speed": { "name": "Velocidad media del último viaje" },
51+
"last_trip_duration": { "name": "Duración del último viaje" },
5052
"daily_distance": { "name": "Viajes: Distancia diaria" },
5153
"weekly_distance": { "name": "Viajes: Distancia semanal" },
5254
"monthly_distance": { "name": "Viajes: Distancia mensual" },

custom_components/geotab/translations/fr.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
"accelerator_pos": { "name": "Position de l'accélérateur" },
4848
"throttle_pos": { "name": "Position du papillon" },
4949
"last_trip_distance": { "name": "Distance du dernier trajet" },
50+
"last_trip_average_speed": { "name": "Vitesse moyenne du dernier trajet" },
51+
"last_trip_duration": { "name": "Durée du dernier trajet" },
5052
"daily_distance": { "name": "Trajets : Distance quotidienne" },
5153
"weekly_distance": { "name": "Trajets : Distance hebdomadaire" },
5254
"monthly_distance": { "name": "Trajets : Distance mensuelle" },

0 commit comments

Comments
 (0)