ha_strava icon indicating copy to clipboard operation
ha_strava copied to clipboard

Remove distance unit of measurement from sensors

Open BertrumUK opened this issue 5 years ago • 2 comments

I live in the UK where we use Miles but Strava provides our distances in KM. The distance sensor 0.3 / 1.3 etc, provided by this integration, adds km to the end of this sensor therefore a templates sensor to convert it to miles is not possible. Looking at your code it will either return Miles or KM depending on if HA is set for metric or Imperial - is there a way to add an option on the integration to set metric or Imperial ?

{{ states.sensor.strava_0_3.state | float * 0.621371 | round(2) }} {{ states.sensor.strava_1_3.state | float * 0.621371 | round(2) }}

error

Can I suggest that the unit of measurement on this sensor is removed so that its value can be manipulated with a template sensor or a sensor to provide both the distance in Miles & KM or provide a why to set it in the integration ?

distance

BertrumUK avatar Jul 26 '20 12:07 BertrumUK

@BertrumUK Good idea to remove the UOM from the sensor value. I hope I get to that soon, but I'm pretty busy at work right now, so I can't promise anything :-/

codingcyclist avatar Oct 28 '20 22:10 codingcyclist

I would like to request the same for the YTD distance ridden. This way I can have a gauge with my yearly target distance... unless there is an easy way to parse the value to a number in yaml.

kkemseke avatar Apr 19 '21 09:04 kkemseke