How to create an entity that holds the max temperature of the last 24 hours?

Create a Trigger-based Template Sensor that reports the highest temperature and resets its value at 00:00.

template:
  - trigger:
      - platform: time
        at: '00:00:00'
      - platform: state
        entity_id: sensor.outdoor_temperature
    sensor:
      - name: 'Temperature Daily Max'
        unique_id: 'temperature_daily_max'
        unit_of_measurement: '°C'
        device_class: temperature
        state: >
          {% set t_new = states('sensor.outdoor_temperature') | float(-50) %}
          {{ [t_new, this.state | float(-50)] | max if trigger.platform != 'time' else t_new }}
1 Like