Help with value_template for Pollens Information

Hello I have a sensorwith this attributes

risks:
  - pollenName: Tilleul
    level: 0
  - pollenName: Ambroisies
    level: 0
  - pollenName: Olivier
    level: 0
  - pollenName: Plantain
    level: 0
  - pollenName: Noisetier
    level: 0
  - pollenName: Aulne
    level: 0
  - pollenName: Armoise
    level: 0
  - pollenName: Châtaignier
    level: 0
  - pollenName: Urticacées
    level: 1
  - pollenName: Oseille
    level: 0
  - pollenName: Graminées
    level: 4
  - pollenName: Chêne
    level: 0
  - pollenName: Platane
    level: 0
  - pollenName: Bouleau
    level: 0
  - pollenName: Charme
    level: 0
  - pollenName: Peuplier
    level: 0
  - pollenName: Frêne
    level: 0
  - pollenName: Saule
    level: 0
  - pollenName: Cyprès
    level: 0
friendly_name: Pollens

And I want to create a sensor with the level for exemple Tilleul
I try this but IIt doesn’t work
value_template: '{{ states.sensor.pollens.attributes["risks"]["pollenName: Tilleul"]["level"] }}'

result :
Error rendering template: UndefinedError: ‘list object’ has no attribute ‘pollenName: Tilleul’

I don’t understand how to with - and :

Thank for your help

This template should get you the value. It has a bunch of safety built in incase the value doesn’t exist or if it’s not in the same spot in the collection.

value_template: >
  {%- set attrs = state_attr('sensor.pollens', 'risks') %}
  {%- set tilleul = attrs | selectattr('pollenName', 'eq', 'Tilleul') | first %}
  {%- if tilleul %}
    {{ tilleul.level }}
  {%- else %}
    None
  {%- endif %}

Thanks !!!