Template in lovelace to have a variable name

Hi, ik like to have a variable name for a sensor based on its value.
I have a first concept but this one is not executed, i get the code instead of a name

type: gauge
entity: sensor.hw_p1meter_1c2d18_vermogen
needle: true
min: -3000
max: 3000
severity:
  green: -3000
  yellow: 0
  red: 1000
name: >
  {% set waarde = states('sensor.hw_p1meter_1c2d18_vermogen') | float(0) %} {%
  if waarde > 0 %}
    Verbruikx 
  {% else %}
    Verbruiky
  {% endif %}
grid_options:
  columns: 4
  rows: 2

Very few core cards support templating.

ok, will search for a gauge card in hacs!
Thanks

Go to the main auto-entities thread and search for my post for gauge. Then you will be able to template any option of gauge card.