Problem with template Sensor Incorrect type. Expected “array”

Hey, with this code I always get this error: Incorrect type. Expected “array”.

template:
  sensor:
    - name: "Calculated Light Brightness"
      unit_of_measurement: "Int"
      state: |
        {%- set lux = states('sensor.estimated_illuminance') | int(default=0) -%}
        {%- set perc = (lux / (400 / 100)) | int -%}
        {{ perc }}

sensor:
  - platform: filter
    name: "Filtered Light Brightness"
    entity_id: sensor.calculated_light_brightness
    filters:
    - filter: range
      lower_bound: 1
      upper_bound: 100

Can somebody help me ?

This is already an issue, indentation is missing before the “-”

Try this:

template:
  - sensor:
      - name: "Calculated Light Brightness"
        unit_of_measurement: "Int"
        state: |
          {%- set lux = states('sensor.estimated_illuminance') | int(default=0) -%}
          {%- set perc = (lux / (400 / 100)) | int -%}
          {{ perc }}