En relisant le code dans sensors.yaml j’ai l’impression qu’il va chercher dans le fichier template mais vu que j’ai pas de fichier template c’est peut être ça ? Ci dessous la partie ou il parle de template :
resource_template: |-
{% set location = 'Amiens' %}
{% set rows = '1'%}
{% set aujourdhui = now().strftime('%Y-%m-%d')%}
{% set dayOfYear = now().strftime('%j') %}
{% set year = now().strftime('%Y') | int %}
{% set lastYear = year - 1 %}
{% set nextYear = year + 1 %}
{% if dayOfYear > '244' %}
{% set schoolYear = (year | string) + "-" + (nextYear | string) %}
{%- else -%}
{% set schoolYear = (lastYear | string) + "-" + (year | string) %}
{%- endif %}
https://data.education.gouv.fr/api/records/1.0/search/?dataset=fr-en-calendrier-scolaire&facet=start_date&facet=end_date&rows={{rows}}&refine.location={{location}}&sort=-end_date&q=end_date%3E={{aujourdhui}}
value_template: |-
{% set aujourdhui = now().strftime('%Y-%m-%d')%}
{% for record in value_json.records -%}
{% if aujourdhui >= record.fields.start_date and aujourdhui <= record.fields.end_date %}
{%- if record.fields.description %}{{record.fields.description}} jusqu'au {{ as_timestamp(record.fields.end_date) | timestamp_custom('%d-%m-%Y') }} {% endif %}
{% else %}
{%- if record.fields.end_date > aujourdhui and record.fields.description %} prochaines : {{record.fields.description}} {{ as_timestamp(record.fields.start_date) | timestamp_custom('%d-%m-%Y') }}{% endif %}
{% endif %}
{%- endfor %}