Templating to allow for "Unknown"

I have a template sensor to convert my car speed from mph to km/h. The template state is

state: {{(state_attr('device_tracker.tesla_location_tracker','speed') * 1.6)}}

However sometimes (like when it is stationery) the attribute returns Unknown. It is annoying me.

I have read the templating page many times, but I just can’t get it. I would like it to read 0 instead of Unknown.

Anyone?

Would something like this help?

  - condition: template
    value_template: '{{ ( as_timestamp(now()) - as_timestamp(state_attr(''automation.garage_motion_detected'',
      ''last_triggered'')) |int(0) ) > 240 }}'

Does this help? Anything that can’t be interpreted as a float value defaults to 0
{{ state_attr('device_tracker.tesla_location_tracker','speed')|float(0) * 1.6 }}

That works, and thank you.

@dproffer thanks for your input too.