et ca marche toujours ? je viens de passer en core-2024.4.0 ?
et plein d’erreurs
Enregistreur: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:201
intégration: Template (documentation, problèmes)
S'est produit pour la première fois: 16:30:58 (17 occurrences)
Dernier enregistrement: 16:30:58
TemplateError('UndefinedError: None has no element 4') while processing template 'Template<template=({{state_attr('weather.xxxxxxxx', 'forecast')[4].temperature}}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.weather_temperature_5'
TemplateError('UndefinedError: None has no element 4') while processing template 'Template<template=({{state_attr('weather.xxxxxxxx', 'forecast')[4].templow}}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.weather_templow_5'
TemplateError('UndefinedError: None has no element 4') while processing template 'Template<template=({{state_attr('weather.xxxxxxxx', 'forecast')[4].condition}}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.weather_condition_5'
TemplateError('UndefinedError: None has no element 0') while processing template 'Template<template=({% set sensors = [ states('sensor.atc_ext_ouest_temperature') | float(0.0), state_attr('weather.xxxxxxxx', 'forecast')[0].temperature | float(0.0), state_attr('weather.xxxxxxxx', 'forecast')[1].temperature | float(0.0), state_attr('weather.xxxxxxxx', 'forecast')[2].temperature | float(0.0), state_attr('weather.xxxxxxxx', 'forecast')[3].temperature | float(0.0), ] %} {{ sensors | max }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.outside_temperature_max_next_days'
sensor:
# For MeteoBoard ------------------------------
- platform: template
sensors:
date_fr_jour_mois:
value_template: "{{ ['Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi','Dimanche'][now().weekday()] }} {{ ['1er','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31'][ now().day-1] }}"
date_fr_complete:
value_template: "{{ ['Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi','Dimanche'][now().weekday()] }} {{ ['1er','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31'][ now().day-1] }} {{ ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'][now().month-1] }}"
weather_temperature:
value_template: "{{ states('sensor.atc_parents_temperature')}}"
unique_id: weather_temperature_bt
unit_of_measurement: °C
device_class: temperature
weather_day_1:
value_template: "{{ ['LUN.','MAR.','MER.','JEU.','VEN.','SAM.','DIM.','LUN.','MAR.','MER.','JEU.','VEN.','SAM.','DIM.'][now().weekday()] }}"
weather_temperature_1:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[0].temperature}}"
weather_templow_1:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[0].templow}}"
weather_condition_1:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[0].condition}}"
weather_day_2:
value_template: "{{ ['LUN.','MAR.','MER.','JEU.','VEN.','SAM.','DIM.','LUN.','MAR.','MER.','JEU.','VEN.','SAM.','DIM.'][now().weekday()+1] }}"
weather_temperature_2:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[1].temperature}}"
weather_templow_2:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[1].templow}}"
weather_condition_2:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[1].condition}}"
weather_day_3:
value_template: "{{ ['LUN.','MAR.','MER.','JEU.','VEN.','SAM.','DIM.','LUN.','MAR.','MER.','JEU.','VEN.','SAM.','DIM.'][now().weekday()+2] }}"
weather_temperature_3:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[2].temperature}}"
weather_templow_3:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[2].templow}}"
weather_condition_3:
value_template: "{{state_attr('weather.xxxxxxxx', 'forecast')[2].condition}}"
bon, je sais que mon template est mal écrit, mais jusqu’à hier, il marchait…