Dashboard shows code from sensor template rather than name

Hi,

hopefully someone with some knowledge can help:

image

Code in my configuration.yaml:

      current_elec_cost:
        unique_id: 'current-elec-cost'
        friendly_name: "Current Elec Cost"
        unit_of_measurement: "GBP"
        value_template: >
           {% if (((states('sensor.current_power_usage_w')|float) * ((states('sensor.octopus_energy_electricity_21e5390879_2352321028011_current_rate')|float)/1000))
             |round(2,'ceil')|float) < 0 %}
             0.00
           {% else %}
             (((states('sensor.current_power_usage_w')|float) * ((states('sensor.octopus_energy_electricity_21e5390879_2352321028011_current_rate')|float)/1000))
             |round(2,'ceil')|float)
           {% endif %}

How can I get the name Cost to be displayed rather than the code?

Thanks
Tony

Try this:

current_elec_cost:
        unique_id: 'current-elec-cost'
        friendly_name: "Current Elec Cost"
        unit_of_measurement: "GBP"
        value_template: >
           {% if (((states('sensor.current_power_usage_w')|float) * ((states('sensor.octopus_energy_electricity_21e5390879_2352321028011_current_rate')|float)/1000))
             |round(2,'ceil')|float) < 0 %}
             0.00
           {% else %}
             {{ (((states('sensor.current_power_usage_w')|float) * ((states('sensor.octopus_energy_electricity_21e5390879_2352321028011_current_rate')|float)/1000))
             |round(2,'ceil')|float) }}
           {% endif %}