Changing entity name to entity output

I created the fuel gauge for showing me how much petrol (gas) is left in my car. My aim was to change the name of the gauge to how many miles are left before I run out of petrol (gas). No matter what I try, I can’t get it to work! If it is helpful, this is using the Mercedes API.

Below is the code I have at the moment. It just shows to the syntax as written as the name.

Any hints, clues or help?

type: gauge
entity: sensor.CAR_fuel_level
name: {{ states('sensor.CAR_range_liquid') }}
min: 0
max: 100
needle: true
severity:
  green: 45
  yellow: 10
  red: 0

You have to quote single line templates and more importantly core dashboard cards do not support templates (except for the markdown card).

You can do this with this custom frontend resource:

1 Like