Repository navigation
Replies: 1 comment
|
You're right, and the factor is exactly 3.6. This is a known bug in the integration (not the card), already tracked in #703, with the same reports from e-208, Corsa and ëC3 owners. The avg_speed_kmh = float(last_trip["kinetic"]["avgSpeed"]) * MS_TO_KMH_CONVERSION # = 3.6The Stellantis API now returns Until it's fixed you can add a template sensor that undoes the conversion (Settings → Devices & services → Helpers → Template → Sensor, or YAML). Replace template:
- sensor:
- name: "Last trip average speed"
unit_of_measurement: "km/h"
device_class: speed
state: >
{% set v = state_attr('sensor.YOUR_CAR_last_trip', 'avg_speed') %}
{{ ((v | string).split(' ')[0] | float(0) / 3.6) | round(1) if v else none }}(The attribute is a string like |
Uh oh!
There was an error while loading. Please reload this page.
The average speed of last trip in stellantis card is false. It's 3.6 x too high. There might be an hour/second error when dividing trip lenght by trip duration.
it occurs with a DS vehicule.
Thank You
All reactions