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

I am trying to add a new template sensor to my config (the second of the two in this configuration):

template:
  - sensor:
      - name: Energy Price
        unique_id: energy_price
        state: >-
          {% if state_attr('sensor.electricity_price_house',
          'price_level') == "VERY_CHEAP" %}
            1
          {% elif state_attr('sensor.electricity_price_house',
          'price_level') == "CHEAP" %}
            2
          {% elif state_attr('sensor.electricity_price_house',
          'price_level') == "NORMAL" %}
            3
          {% elif state_attr('sensor.electricity_price_house',
          'price_level') == "EXPENSIVE" %}
            4
          {% elif state_attr('sensor.electricity_price_house',
          'price_level') == "VERY_EXPENSIVE" %}
            5
          {% else %}
            0
          {% endif %}
          
  - name: Nordpool Average
    state: >-
      {{ state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'average') | float
      }}

I get no errors in the code editor or config checker. but after adding the second sensor I keep getting the error below.

Logger: homeassistant.config
Source: config.py:865
First occurred: 12:38:24 PM (1 occurrences)
Last logged: 12:38:24 PM

Invalid config for [template]: [name] is an invalid option for [template]. Check: template->name. (See /config/configuration.yaml, line 97).

I haven’t been able to find any info on listing multiple sensors. Could someone help me with my formatting/indentation?

Your indentation is out. The second sensor name block (and following code) should align with the name of the first; you have it aligning with sensor.

Thank you. That was the issue. I will have to read more on indentation so I don’t make the same mistakes.