Creating sensor for speed, convert to km/h #578
-
With the new change to the MQTT integration to convert to mph, what's the best way for me to set up a sensor that will convert it back to km/h for me? this is the template I'm currently using doesn't seem to be working correctly:
it's displaying speeds far above what the car is actually driving (as I watch it in both the Tesla app and in TeslaMate), 99 km/h is being converted to 124 km/h |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Apparently my MQTT broker wasn't running, so it's possible the integration just happened to pull when the speed spiked and i didn't realize, will monitor it and update. Still interested in whether or not this sensor is the best way to do it |
Beta Was this translation helpful? Give feedback.
-
Okay so I was stupid, and writing it this way causes 1.609 to be rounded up to 2 the actual way to write it is with an extra bracket: closing as solution |
Beta Was this translation helpful? Give feedback.
Okay so I was stupid, and writing it this way causes 1.609 to be rounded up to 2
the actual way to write it is with an extra bracket:
{{ (state_attr('device_tracker.thunderfury_location_tracker', 'speed') | float * 1.609) | round }}
closing as solution