Miles to Km

Probably a very simple solution, but I have finally got my FIAT EV data into Hassio, but the odometer and range come in as km instead of miles - was just hoping someone could point me in the direction of the best method of getting two new sensors with the values in miles (have put the current sensor names below.



Use a template sensor

Put this in my config, but it just shows unavailable ? is this because it takes a while for the sensor from the car to update (think it starts with unavailable)

  - platform: template
        friendly_name: Car Range
        unit_of_measurement: mi
        value_template: >
          {{ state_attr(‘sensor.car_evInfo_battery_distanceToEmpty_value')|float/1.609|round }}




{{ states("sensor.car_evInfo_battery_distanceToEmpty_value")|float / 1.609|round }}

or even better:

{{ '{:.2}'.format( states('sensor.car_evInfo_battery_distanceToEmpty_value')|float / 1.609) }}

Working now …… but the values are wrong ?

Could Home Assistant do an automatic conversion? If I remember correctly, during onboarding you either select metric or imperial.