Invalid config for [template]: [name] is an invalid option for [template] #2

hi all,

I am new to Home Assistant and I am breaking my balls over this error.
I cannot find any issue with the code. I am fairly confident my indentation is correct but still I get this error.

here is my code:

template:
  - sensor:
      #### NordPool Energyprices ######
      - name: "NordPool Energyprices"
        unique_id: 02d52fc9-a6fc-4c6a-a05d-307f1ec2150c
        icon: mdi:currency-eur
        unit_of_measurement: "€"
        state: >
          {{ states('sensor.nordpool_kwh_nl_eur_3_10_021')}}
        attributes:
          times: >
            {% set ns = namespace(times=[]) -%}
            {%- set today = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021','raw_today') -%}
            {%- for hours in today -%}
              {%- set ns.times = ns.times + [as_local((hours.start)).strftime("%Y-%m-%d %H:%M:%S")] -%}
            {%- endfor -%}
            {%- set tomorrow = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021','raw_tomorrow') -%}
              {% - for hours in tomorrow -%}
            {%- set ns.times = ns.times + [as_local((hours.start)).strftime("%Y-%m-%d %H:%M:%S")] -%}
            {%- endfor -%}
            {{ ns.times }}

You might see an extra indication. to the right from the third line… I am not doing this my self… When I save the file the indication is adjusted (don’t know what or who is doing that…) Using Studio Code server 5.5.7 Running HA 2023.4.6 (core 2023.04.1)

What am I missing???

thnx