Logger: homeassistant.components.template.config error

Hi I get an error message in the log that my template.yaml is wrong but I don’t understand what it could be.

####template.yaml###############################################################
################################################################################
####Elpris_nordpool#############################################################
- sensor:
  - name: Dagen Timpris SE3 fem billigaste timmarna
    # friendly_name: Dagen Timpris SE3 fem billigaste timmarna
    state: >
        {% set x = states("sensor.time") %}
        {% set l=state_attr('sensor.nordpool', 'raw_today')|sort(attribute='value') %}
        {{ (now() >= l[0].start and now() <= l[0].end)
        or (now() >= l[1].start and now() <= l[1].end)
        or (now() >= l[2].start and now() <= l[2].end)
        or (now() >= l[3].start and now() <= l[3].end)
        or (now() >= l[4].start and now() <= l[4].end) }}
####convert degrees to N,S,E, W ################################################
- sensors:
    weather_wind_dir:
      friendly_name: Vindriktning
      value_template: "{% set direction = ['N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW','N'] %}
      {% set degree = states('sensor.vindsensor_wind_direction')|float %}
      {{ direction[((degree+11.25)/22.5)|int] }}"
################################################################################

This is not the correct format for the template integrations. It is the format for a sensor platform.

The one above it is correct.