Erreur template 2022.1

Mon problème

Je rencontre un erreur dans mes logs sur 2 sensor qui indique la temperature max du jour et minimum.
Si une personne connait la solution je suis preneur :slight_smile:

Template warning: 'timestamp_custom' got invalid input '2022-01-23 00:00:00+01:00' when rendering template '{% set format = '%Y-%m-%dT%H:%M:%S+00:00' %} {% set start = now().replace(hour=0,minute=0,second=0, microsecond=0) %} {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false) %} {% set start = start | timestamp_custom(format, false) %} {{ state_attr('weather.xxxx', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-01-23 00:00:00+01:00', however this template will fail to render in Home Assistant core 2022.1
Template warning: 'timestamp_custom' got invalid input '2022-01-22 00:00:00+01:00' when rendering template '{% set format = '%Y-%m-%dT%H:%M:%S+00:00' %} {% set start = now().replace(hour=0,minute=0,second=0, microsecond=0) %} {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false) %} {% set start = start | timestamp_custom(format, false) %} {{ state_attr('weather.xxxxx', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-01-22 00:00:00+01:00', however this template will fail to render in Home Assistant core 2022.1
Template warning: 'timestamp_custom' got invalid input '2022-01-23 00:00:00+01:00' when rendering template '{% set format = '%Y-%m-%dT%H:%M:%S+00:00' %} {% set start = now().replace(hour=0,minute=0,second=0, microsecond=0) %} {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false) %} {% set start = start | timestamp_custom(format, false) %} {{ state_attr('weather.xxxx', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-01-23 00:00:00+01:00', however this template will fail to render in Home Assistant core 2022.1
Template warning: 'timestamp_custom' got invalid input '2022-01-22 00:00:00+01:00' when rendering template '{% set format = '%Y-%m-%dT%H:%M:%S+00:00' %} {% set start = now().replace(hour=0,minute=0,second=0, microsecond=0) %} {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false) %} {% set start = start | timestamp_custom(format, false) %} {{ state_attr('weather.xxxx', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-01-22 00:00:00+01:00', however this template will fail to render in Home Assistant core 2022.1
#############################################################
###     TEMPERATURE MIN/MAX DU JOUR                        ##
#############################################################
  - platform: template
    sensors:
      day_max_temp:
        friendly_name: "Max.temperature"
        unit_of_measurement: "°C"
        #entity_id: weather.xxxx //deprecated 
        value_template: >
          {% set format = '%Y-%m-%dT%H:%M:%S+00:00' %}
          {% set start = now().replace(hour=0,minute=0,second=0, microsecond=0) %}
          {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false) %}
          {% set start = start | timestamp_custom(format, false) %}
          {{ state_attr('weather.xxxx', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}

  - platform: template
    sensors:
      day_min_temp:
        friendly_name: "Min.temperature"
        unit_of_measurement: "°C"
        #entity_id: weather.xxxx //deprecated 
        value_template: >
          {% set format = '%Y-%m-%dT%H:%M:%S+00:00' %}
          {% set start = now().replace(hour=0,minute=0,second=0, microsecond=0) %}
          {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false) %}
          {% set start = start | timestamp_custom(format, false) %}
          {{ state_attr('weather.xxxxx', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}

Ma configuration


Texte à remplacer par votre configuration

Comment récupérer ma configuration :
Dans votre HA, Menu latéral Configuration > Paramètres > Info > bouton copier > Pour Github
image


Salut,

On en parle déjà dans ce sujet
https://forum.hacf.fr/t/2021-12-mise-a-jour-majeure-de-home-assistant/7878/2

Merci pulpy, par contre je ne parvient pas a supprimer mon post désormais car je viens de voir que j’avais déjà posée la question sur le topic que tu as mis en lien.

Pas grave, comme ton titre est plus précis, ça aidera ceux qui utilisent la recherche à retrouver les bonnes infos