mitch-dc / volkswagen_we_connect_id

Apache License 2.0
202 stars 53 forks source link

Milage #104

Closed ColinRobbins closed 1 year ago

ColinRobbins commented 1 year ago

Version of the custom_component

latest "git clone"

Installation method (hacs / manual)

manual

Installation method of hass (venv, docker, hassio,...)

venv

Configuration


N/A

Describe the bug

In https://github.com/mitch-dc/volkswagen_we_connect_id/pull/92 the milage sensors have been removed, with the comment "Home assistant will covert them". How? Are you inferring the need to set up a template sensor?

Debug log


N/A
xlibbyx commented 1 year ago

Miles being available is definitely useful for us Brits.

ColinRobbins commented 1 year ago

Miles being available is definitely useful for us Brits.

I solved it with a template sensor...

template:
  - sensor: 
    - name: EV Range in Miles
      unique_id: ev01
      unit_of_measurement: 'mi'
      state: "{{ (states('sensor.ev_range')|float *0.621371)|int }} "
      state_class: measurement
      icon: 'mdi:map-marker-distance'
    - name: EV Odometer in Miles
      unique_id: ev02
      unit_of_measurement: 'mi'
      state: "{{ (states('sensor.ev_odometer')|float *0.621371)|int }} "
      state_class: measurement
      icon: 'mdi:map-marker-distance'
mitch-dc commented 1 year ago

I do think this is something that HA must change, you got EU and US options now but no UK.