# Problème avec du Template pour avoir la température maximum de la journée

**URL:** <https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075>\
**Category:** Entraide Home Assistant\
**Created:** [Juin 15, 2021, 4:43 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075 "2021-06-15T16:43:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mib68](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/m/898d66/32.png) [@Mib68](https://forum.hacf.fr/u/Mib68)\
**Post date:** [Juin 15, 2021, 4:43 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/1 "2021-06-15T16:43:16Z")

</div>

## Mon problème

Bonjour je souhaiterais faire un sensor qui afficherais la température maximum du forecast de météofrance

Voici les attribus

```auto
temperature: 28.3
humidity: 45
pressure: 1016.8
wind_speed: 4
attribution: Data provided by Météo-France
forecast: 
- datetime: '2021-06-15T02:00:00+02:00'
  condition: cloudy
  temperature: 29.9
  templow: 12.1
  precipitation: 0
- datetime: '2021-06-16T02:00:00+02:00'
  condition: sunny
  temperature: 31.8
  templow: 14.3
  precipitation: 0
- datetime: '2021-06-17T02:00:00+02:00'
  condition: sunny
  temperature: 33.5
  templow: 16.6
  precipitation: 0.2
- datetime: '2021-06-18T02:00:00+02:00'
  condition: rainy
  temperature: 30.8
  templow: 19.3
  precipitation: 1
- datetime: '2021-06-19T02:00:00+02:00'
  condition: partlycloudy
  temperature: 29.4
  templow: 16.8
  precipitation: 0.3
- datetime: '2021-06-20T02:00:00+02:00'
  condition: lightning
  temperature: 30.8
  templow: 17.6
  precipitation: 1.1
- datetime: '2021-06-21T02:00:00+02:00'
  condition: lightning
  temperature: 25.6
  templow: 16.5
  precipitation: 1.3
- datetime: '2021-06-22T02:00:00+02:00'
  condition: rainy
  temperature: 22.2
  templow: 14.1
  precipitation: 0.9
- datetime: '2021-06-23T02:00:00+02:00'
  condition: partlycloudy
  temperature: 22.4
  templow: 13.1
  precipitation: 0.3
- datetime: '2021-06-24T02:00:00+02:00'
  condition: partlycloudy
  temperature: 23.3
  templow: 12.4
  precipitation: 0.1
- datetime: '2021-06-25T02:00:00+02:00'
  condition: sunny
  temperature: 25.2
  templow: 13.2
  precipitation: 0
- datetime: '2021-06-26T02:00:00+02:00'
  condition: partlycloudy
  temperature: 25.7
  templow: 14.1
  precipitation: 0.2
- datetime: '2021-06-27T02:00:00+02:00'
  condition: rainy
  temperature: 26.5
  templow: 14.4
  precipitation: 0.4
- datetime: '2021-06-28T02:00:00+02:00'
  condition: sunny
  temperature: 26.1
  templow: 14.4
  precipitation: 0.4
- datetime: '2021-06-29T02:00:00+02:00'
  condition: sunny
  temperature: 26.2
  templow: 13.9
  precipitation: 0.4

friendly_name: XXXXXX

```

Et si je fais un template

```auto
{{ state_attr('weather.XXXXXX', 'forecast') | map(attribute='temperature') | list | max }}

```

Cela me donne la valeur maximum de tous le forecast (33.5) et pas seulement du jour

Si quelqu’un à une idée afin de récupérer la température maximum du jour je serais preneur.

* * *

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 15, 2021, 4:57 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/2 "2021-06-15T16:57:47Z")

</div>

Salut,

Essaye ça

```auto
{{ state_attr('weather.XXXXXX', 'forecast') | map(attribute='temperature') | first }}

```

Il n’y a qu’une valeur par jour, donc pas besoin de chercher le max… Et le jour courant est forcement le premier

---

<div class="post-metadata">

**Author:** ![Mib68](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/m/898d66/32.png) [@Mib68](https://forum.hacf.fr/u/Mib68)\
**Post date:** [Juin 15, 2021, 5:24 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/3 "2021-06-15T17:24:16Z")

</div>

> [@Pulpy-Luke](#):
>
> `{{ state_attr(‹ weather.XXXXXX ›, ‹ forecast ›) | map(attribute='temperature') | first }}`

Tip top ça marche nickel merci @Pulpy-Luke enfin je vais pouvoir faire un scénario pour la canicule

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 7, 2022, 12:35 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/4 "2022-06-07T12:35:54Z")

</div>

Bonjour avec les récentes mise a jour j’aimerai savoir comment rajouter la valeur par défaut:

```auto
#############################################################
### TEMPERATURE MIN/MAX DU JOUR ##
#############################################################
  - platform: template
    sensors:
      day_max_temp:
        friendly_name: "Max.temperature"
        unit_of_measurement: "°C"
        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.ville', '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"
        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.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}

```

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 7, 2022, 12:58 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/5 "2022-06-07T12:58:23Z")

</div>

> [@Felix62](#):
>
> ` {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false) %}`

Après avoir ajouter default: ERREUR

```auto
 {% set end = (start + timedelta(days=1)) | timestamp_custom(format, false, default) %}

```

```auto
TemplateError('TypeError: timestamp_custom() takes from 1 to 4 positional arguments but 5 were given') while processing template '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, 0, default) %} {% set start = start | timestamp_custom(format, false) %} {{ state_attr('weather.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}")' for attribute '_attr_native_value' in entity 'sensor.day_max_temp'
TemplateError('UndefinedError: 'default' is undefined') while processing template '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, default) %} {% set start = start | timestamp_custom(format, false) %} {{ state_attr('weather.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}")' for attribute '_attr_native_value' in entity 'sensor.day_min_temp'

```

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 7, 2022, 8:22 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/6 "2022-06-07T20:22:00Z")

</div>

Pas d’idée ?

```auto
Logger: homeassistant.helpers.template
Source: helpers/template.py:1331
First occurred: 22:04:00 (12 occurrences)
Last logged: 22:06:00

Template warning: 'timestamp_custom' got invalid input '2022-06-08 00:00:00+02: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.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-06-08 00:00:00+02:00', however this template will fail to render in Home Assistant core 2022.6
Template warning: 'timestamp_custom' got invalid input '2022-06-07 00:00:00+02: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.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-06-07 00:00:00+02:00', however this template will fail to render in Home Assistant core 2022.6
Template warning: 'timestamp_custom' got invalid input '2022-06-08 00:00:00+02: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.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-06-08 00:00:00+02:00', however this template will fail to render in Home Assistant core 2022.6
Template warning: 'timestamp_custom' got invalid input '2022-06-07 00:00:00+02: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.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}' but no default was specified. Currently 'timestamp_custom' will return '2022-06-07 00:00:00+02:00', however this template will fail to render in Home Assistant core 2022.6

```

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 7, 2022, 8:38 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/7 "2022-06-07T20:38:22Z")

</div>

> [@Felix62](#):
>
> `'default' is undefined'`

C’est pas si compliqué … c’est marqué.  
Personnellement je ne pense pas que ce soit un bonne solution que de mettre autre chose que **0 (tout court !)** comme valeur et ce quelque soit le template…

Un extrrait chez moi

```auto
timestamp_custom("%j",0)

```

Et ça marche très bien

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 8, 2022, 8:11 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/8 "2022-06-08T08:11:17Z")

</div>

je viens d’appliquer mais j’ai encore un autre message maintenant, je me demande si j’ai tout bien fait

```auto
Logger: homeassistant.components.template.template_entity
Source: components/template/template_entity.py:172
Integration: Template (documentation, issues)
First occurred: 10:07:10 (2 occurrences)
Last logged: 10:07:10

TemplateError('TypeError: '>=' not supported between instances of 'datetime.datetime' and 'int'') while processing template '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, 0,) %} {% set start = start | timestamp_custom(format, false, 0,) %} {{ state_attr('weather.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='temperature') | list | max }}")' for attribute '_attr_native_value' in entity 'sensor.day_max_temp'
TemplateError('TypeError: '>=' not supported between instances of 'datetime.datetime' and 'int'') while processing template '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, 0,) %} {% set start = start | timestamp_custom(format, false, 0,) %} {{ state_attr('weather.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}")' for attribute '_attr_native_value' in entity 'sensor.day_min_temp'

```

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 8, 2022, 8:13 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/9 "2022-06-08T08:13:41Z")

</div>

C’est un souci de format : tu cherches à comparer une date/heure avec une valeur entière …  
Il faut découper ton template et le tester dans les outils dev

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 8, 2022, 8:24 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/10 "2022-06-08T08:24:02Z")

</div>

J’avoue ne pas très bien saisir la manière de procéder, a l’époque c’est un template trouver sur le net que j’aii trouver intéressant mais aujourd’hui… n’étant pas le créateur ni du métier je sèche…

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 8, 2022, 8:41 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/11 "2022-06-08T08:41:29Z")

</div>

Du coup, il faut procéder comme ça :

- quel est ton jeu de données ?
- que veux tu récupérer ?

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 8, 2022, 8:44 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/12 "2022-06-08T08:44:32Z")

</div>

Je voudrai récupéré la température en °C la plus haute du jour «&nbsp;J&nbsp;» et la plus basse du jour «&nbsp;J&nbsp;»

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 8, 2022, 8:50 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/13 "2022-06-08T08:50:59Z")

</div>

Oui j’avais bien l’idée. Ça réponds pas totalement aux questions précédentes : quel jeu de données par exemple

---

<div class="post-metadata">

**Author:** ![Sweepy](https://forum.hacf.fr/user_avatar/forum.hacf.fr/sweepy/32/6410_2.png) [@Sweepy](https://forum.hacf.fr/u/Sweepy)\
**Post date:** [Juin 8, 2022, 8:53 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/14 "2022-06-08T08:53:21Z")

</div>

Bonjour

Il y a cela

# HADailySensor

[![](https://github.com/jeroenterheerdt/HADailySensor/raw/master/logo.png?raw=true)](https://github.com/jeroenterheerdt/HADailySensor/blob/master/logo.png?raw=true)

Daily Sensor custom component for Home Assistant. It takes aggregates an input sensor until midnight. Then it resets. Aggregation is configurable - available options are: minimum, maximum, sum, average (mean), median, standard deviation and variation.

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 8, 2022, 9:42 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/15 "2022-06-08T09:42:12Z")

</div>

> [@Pulpy-Luke](#):
>
> Du coup, il faut procéder comme ça :
> 
> - quel est ton jeu de données ?

Désolé @Pulpy-Luke mais je ne comprend pas la question  
je voudrai juste récupéré ces infos dans weather.ville

 ![image](https://forum.hacf.fr/uploads/default/original/2X/f/f5d458ff883eca50f868f12b9734a353196a7584.png)

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 8, 2022, 9:46 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/16 "2022-06-08T09:46:31Z")

</div>

Si tu reprends l’exemple au dessus :

```auto
{{ state_attr('weather.XXXXXX','forecast') | map(attribute='temperature') | first }}
{{ state_attr('weather.XXXXXX','forecast') | map(attribute='templow') | first }}

```

ça doit prendre le min max de la 1ere date

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 8, 2022, 9:49 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/17 "2022-06-08T09:49:41Z")

</div>

Donc je n’aurai pas besoin de definir la date: (j’essai d’apprendre 🙂 )

```auto
 {% 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) %}

```

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 8, 2022, 9:50 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/18 "2022-06-08T09:50:25Z")

</div>

Oui c’est exactement l’idée

---

<div class="post-metadata">

**Author:** ![Felix62](https://forum.hacf.fr/user_avatar/forum.hacf.fr/felix62/32/7858_2.png) [@Felix62](https://forum.hacf.fr/u/Felix62)\
**Post date:** [Juin 8, 2022, 9:53 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/19 "2022-06-08T09:53:45Z")

</div>

D’accord, mais je suppose que ce n’est pas aussi simple si je venais simplement a supprimer les lignes précedentes ?

```auto
  - platform: template
    sensors:
      day_max_temp:
        friendly_name: "Max.temperature"
        unit_of_measurement: "°C"
        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.ville', '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"
        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.ville', 'forecast') | selectattr('datetime', '>=', start) | selectattr('datetime','<=', end) | map(attribute='templow') | list | max }}

```

---

<div class="post-metadata">

**Author:** ![Pulpy-Luke](https://forum.hacf.fr/user_avatar/forum.hacf.fr/pulpy-luke/32/137426_2.png) [@Pulpy-Luke](https://forum.hacf.fr/u/Pulpy-Luke)\
**Post date:** [Juin 8, 2022, 10:10 UTC](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075/20 "2022-06-08T10:10:14Z")

</div>

il faut aussi remplacer la dernière ligne de ton sensor par 1 ligne de mon exemple, sinon les appels à ce que tu viens de commenter sont toujours là

[Page suivante](https://forum.hacf.fr/t/probleme-avec-du-template-pour-avoir-la-temperature-maximum-de-la-journee/5075.md?page=2)
