ESP32 keeps crashing after adding just one extra sensor

Whenever I add one more sensor, even with logger switched off, my esp32 crashes. This is my yaml:

esphome:
  name: temperature

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
#logger:

# Enable Home Assistant API
api:
  encryption:
    key: "6YzTu7YvbPeV/lAk+DrrUFzY6eqez2xrxEKVlvjDbas="

ota:
  password: "f63ba4eda519c5f46a751c8b5261c8ed"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.10.14
    gateway: 192.168.10.1
    subnet: 255.255.255.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Temperature Fallback Hotspot"
    password: "zNc8vHrQeawq"

captive_portal:

time:
  - platform: homeassistant
    id: ha_time

font:
  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm24
    size: 24
  
  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm35
    size: 35

  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm60
    size: 60
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.']

  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm90
    size: 90
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.']

  - file: "fonts/AcuminPro-Light.ttf"
    id: tl24
    size: 24
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.', 'm', 'i', 'n', 'a', 'x', ':', '/', '%', 'r']

  - file: "fonts/AcuminPro-Light.ttf"
    id: tl30
    size: 30
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.']

  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im90
    size: 90
    glyphs: &mdi-weather-glyphs
      - "\U000F0590" # mdi-weather-cloudy
      - "\U000F0F2F" # mdi-weather-cloudy-alert
      - "\U000F0E6E" # mdi-weather-cloudy-arrow-right
      - "\U000F0591" # mdi-weather-fog
      - "\U000F0592" # mdi-weather-hail
      - "\U000F0F30" # mdi-weather-hazy
      - "\U000F0898" # mdi-weather-hurricane
      - "\U000F0593" # mdi-weather-lightning
      - "\U000F067E" # mdi-weather-lightning-rainy
      - "\U000F0594" # mdi-weather-night
      - "\U000F0F31" # mdi-weather-night-partly-cloudy
      - "\U000F0595" # mdi-weather-partly-cloudy
      - "\U000F0F32" # mdi-weather-partly-lightning
      - "\U000F0F33" # mdi-weather-partly-rainy
      - "\U000F0F34" # mdi-weather-partly-snowy
      - "\U000F0F35" # mdi-weather-partly-snowy-rainy
      - "\U000F0596" # mdi-weather-pouring
      - "\U000F0597" # mdi-weather-rainy
      - "\U000F0598" # mdi-weather-snowy
      - "\U000F0F36" # mdi-weather-snowy-heavy
      - "\U000F067F" # mdi-weather-snowy-rainy
      - "\U000F0599" # mdi-weather-sunny
      - "\U000F0F37" # mdi-weather-sunny-alert
      - "\U000F14E4" # mdi-weather-sunny-off
      - "\U000F059A" # mdi-weather-sunset
      - "\U000F059B" # mdi-weather-sunset-down
      - "\U000F059C" # mdi-weather-sunset-up
      - "\U000F0F38" # mdi-weather-tornado
      - "\U000F059D" # mdi-weather-windy
      - "\U000F059E" # mdi-weather-windy-variant
      - "\U000F10C2" # mdi-thermometer-high
      - "\U000F10C3" # mdi-thermometer-low
      - "\U000F0E01" # mdi-thermometer-alert
      - "\U000F054B" # mdi-umbrella-outline
      - "\U000F0F29" # mdi-snowflake-alert

  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im20
    size: 20
    glyphs: *mdi-weather-glyphs
 
  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im40
    size: 40
    glyphs: *mdi-weather-glyphs  
  
  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im24
    size: 24
    glyphs: *mdi-weather-glyphs

color:
  - id: color_white
    red: 0%
    green: 0%
    blue: 0%
    white: 0%

text_sensor:
  - platform: homeassistant
    id: conditiontoday
    entity_id: sensor.WeatherPredictions
    filters: 
      - map:
        - clear-night -> Clear night
        - cloudy -> Many clouds
        - exceptional -> Exceptional
        - fog -> Fog
        - hail -> Hail
        - lightning -> Lightning / thunderstorms
        - lightning-rainy -> Lightning / thunderstorms and rain
        - partlycloudy -> A few clouds
        - pouring -> Pouring rain
        - rainy -> Rain
        - snowy -> Snow
        - snowy-rainy -> Snow and Rain
        - sunny -> Sunshine
        - windy -> Wind
        - windy-variant -> Wind and clouds

  - platform: homeassistant
    id: condtom
    entity_id: sensor.WeatherPredictions
    attribute: condition1

  - platform: homeassistant
    id: time1
    entity_id: sensor.WeatherpredictionsHourly
    attribute: time1

  - platform: homeassistant
    id: condition1
    entity_id: sensor.WeatherpredictionsHourly
    attribute: condition1

  - platform: homeassistant
    id: time2
    entity_id: sensor.WeatherpredictionsHourly
    attribute: time2

  - platform: homeassistant
    id: condition2
    entity_id: sensor.WeatherpredictionsHourly
    attribute: condition2

  - platform: homeassistant
    id: time3
    entity_id: sensor.WeatherpredictionsHourly
    attribute: time3

  - platform: homeassistant
    id: condition3
    entity_id: sensor.WeatherpredictionsHourly
    attribute: condition3
  
  - platform: homeassistant
    id: time4
    entity_id: sensor.WeatherpredictionsHourly
    attribute: time4
  
  - platform: homeassistant
    id: condition4
    entity_id: sensor.WeatherpredictionsHourly
    attribute: condition4

  - platform: homeassistant
    id: day1
    entity_id: sensor.WeatherPredictions
    attribute: day1
    filters: 
      - to_upper

  - platform: homeassistant
    id: month1
    entity_id: sensor.WeatherPredictions
    attribute: month1

sensor:  
  - platform: homeassistant
    id: tempnow
    entity_id: sensor.outdoor_module_temperature
    unit_of_measurement: "°C"

  - platform: homeassistant
    id: precipitationtoday
    entity_id: sensor.WeatherPredictions
    attribute: precipitationnow
    unit_of_measurement: "%"

  - platform: homeassistant
    id: mintemptoday
    entity_id: sensor.WeatherPredictions
    attribute: lowtempnow
    unit_of_measurement: "°C"

  - platform: homeassistant
    id: maxtemptoday
    entity_id: sensor.WeatherPredictions
    attribute: hightempnow
    unit_of_measurement: "°C"

  - platform: homeassistant
    id: mintemptom
    entity_id: sensor.WeatherPredictions
    attribute: lowtemp1
  
  - platform: homeassistant
    id: temp1
    entity_id: sensor.WeatherpredictionsHourly
    attribute: temp1
    unit_of_measurement: "°C"

  - platform: homeassistant
    id: temp2
    entity_id: sensor.WeatherpredictionsHourly
    attribute: temp2
    unit_of_measurement: "°C"

  - platform: homeassistant
    id: temp3
    entity_id: sensor.WeatherpredictionsHourly
    attribute: temp3
    unit_of_measurement: "°C"

  - platform: homeassistant
    id: temp4
    entity_id: sensor.WeatherpredictionsHourly
    attribute: temp4
    unit_of_measurement: "°C"

  - platform: homeassistant
    id: rain1
    entity_id: sensor.WeatherpredictionsHourly
    attribute: rain1
    unit_of_measurement: "%"

  - platform: homeassistant
    id: rain2
    entity_id: sensor.WeatherpredictionsHourly
    attribute: rain2
    unit_of_measurement: "%"

  - platform: homeassistant
    id: rain3
    entity_id: sensor.WeatherpredictionsHourly
    attribute: rain3
    unit_of_measurement: "%"

  - platform: homeassistant
    id: rain4
    entity_id: sensor.WeatherpredictionsHourly
    attribute: rain4
    unit_of_measurement: "%"
 
  - platform: homeassistant
    id: tomorrowdate1
    entity_id: sensor.WeatherPredictions
    attribute: date1

  - platform: homeassistant
    id: tomhightemp
    entity_id: sensor.WeatherPredictions
    attribute: precipitation1

spi:
  clk_pin: 5
  mosi_pin: 18

display:
  - platform: waveshare_epaper
    cs_pin: 22
    dc_pin: 23
    busy_pin: 32
    reset_pin: 21
    model: 7.50in-hd-b
    update_interval: 30sec
    reset_duration: 2ms
    rotation: 90°
    lambda: |-
      // Map weather states to MDI characters.
      std::map<std::string, std::string> weather_icon_map
        {
          {"cloudy", "\U000F0590"},
          {"cloudy-alert", "\U000F0F2F"},
          {"cloudy-arrow-right", "\U000F0E6E"},
          {"fog", "\U000F0591"},
          {"hail", "\U000F0592"},
          {"hazy", "\U000F0F30"},
          {"hurricane", "\U000F0898"},
          {"lightning", "\U000F0593"},
          {"lightning-rainy", "\U000F067E"},
          {"night", "\U000F0594"},
          {"clear-night", "\U000F0594"},
          {"night-partly-cloudy", "\U000F0F31"},
          {"partlycloudy", "\U000F0595"},
          {"partly-lightning", "\U000F0F32"},
          {"partly-rainy", "\U000F0F33"},
          {"partly-snowy", "\U000F0F34"},
          {"partly-snowy-rainy", "\U000F0F35"},
          {"pouring", "\U000F0596"},
          {"rainy", "\U000F0597"},
          {"snowy", "\U000F0598"},
          {"snowy-heavy", "\U000F0F36"},
          {"snowy-rainy", "\U000F067F"},
          {"sunny", "\U000F0599"},
          {"sunny-alert", "\U000F0F37"},
          {"sunny-off", "\U000F14E4"},
          {"sunset", "\U000F059A"},
          {"sunset-down", "\U000F059B"},
          {"sunset-up", "\U000F059C"},
          {"tornado", "\U000F0F38"},
          {"windy", "\U000F059D"},
          {"windy-variant", "\U000F059E"},
          {"low-temperature", "\U000F10C3"},
          {"high-temperature", "\U000F10C2"},
          {"alert-temperature", "\U000F0E01"},
          {"umbrella", "\U000F054B"},
          {"alert-low-temperature", "\U000F0F29"},
        };
      it.filled_rectangle(0, 0, 150, 212);
      it.print(75, 75, id(tm24), color_white, TextAlign::TOP_CENTER, "TODAY");
      float dayofmonth = id(ha_time).now().day_of_month;
      it.printf(75, 145, id(tm90), color_white, TextAlign::CENTER, "%.0f", dayofmonth);
      it.strftime(75, 180, id(tm24), color_white, TextAlign::TOP_CENTER, "%B", id(ha_time).now());
      
      it.printf(276.75, 145, id(im90), TextAlign::CENTER_RIGHT, "%s", weather_icon_map[id(conditiontoday).raw_state.c_str()].c_str());
      it.printf(276.75, 145, id(tm90), TextAlign::CENTER_LEFT, "%.1f°", id(tempnow).state);
      it.printf(319, 180, id(tm24), TextAlign::TOP_CENTER, "%s", id(conditiontoday).state.c_str());

      it.printf(244.50, 225, id(tm24), TextAlign::TOP_RIGHT, "%.0f%%", id(precipitationtoday).state);
      it.printf(244.50, 222, id(im24), TextAlign::TOP_LEFT, "%s", weather_icon_map["umbrella"].c_str());
      
      it.printf(329, 225, id(tl24), TextAlign::TOP_RIGHT, "%.1f°", id(mintemptoday).state);
      if(id(mintemptoday).state < -5 ) {
        it.printf(329, 222, id(im24), TextAlign::TOP_LEFT, "%s", weather_icon_map["alert-low-temperature"].c_str());
      } else {
        it.printf(329, 222, id(im24), TextAlign::TOP_LEFT, "%s", weather_icon_map["low-temperature"].c_str());
      }
      
      it.printf(413.50, 225, id(tm24), TextAlign::TOP_RIGHT, "%.1f°", id(maxtemptoday).state);
      if(id(maxtemptoday).state > 34) {
        it.printf(413.50, 222, id(im24), TextAlign::TOP_LEFT, "%s", weather_icon_map["alert-temperature"].c_str());
      } else {
        it.printf(413.50, 222, id(im24), TextAlign::TOP_LEFT, "%s", weather_icon_map["high-temperature"].c_str());
      }

      it.printf(61, 290, id(tm24), TextAlign::TOP_CENTER, "%s", id(time1).state.c_str());
      it.printf(56, 315, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(condition1).state.c_str()].c_str());
      it.printf(56, 335, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(temp1).state);
      it.printf(46, 355, id(im20), TextAlign::TOP_RIGHT, "%s", weather_icon_map["umbrella"].c_str());
      it.printf(46, 368, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain1).state);

      it.printf(183, 290, id(tm24), TextAlign::TOP_CENTER, "%s", id(time2).state.c_str());
      it.printf(178, 315, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(condition2).state.c_str()].c_str());
      it.printf(178, 335, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(temp2).state);
      it.printf(168, 355, id(im20), TextAlign::TOP_RIGHT, "%s", weather_icon_map["umbrella"].c_str());
      it.printf(168, 368, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain2).state);

      it.printf(305, 290, id(tm24), TextAlign::TOP_CENTER, "%s", id(time3).state.c_str());
      it.printf(300, 315, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(condition3).state.c_str()].c_str());
      it.printf(300, 335, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(temp3).state);
      it.printf(290, 355, id(im20), TextAlign::TOP_RIGHT, "%s", weather_icon_map["umbrella"].c_str());
      it.printf(290, 368, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain3).state);

      it.printf(427, 290, id(tm24), TextAlign::TOP_CENTER, "%s", id(time4).state.c_str());
      it.printf(422, 315, id(im40), TextAlign::TOP_RIGHT, "%s", weather_icon_map[id(condition4).state.c_str()].c_str());
      it.printf(422, 335, id(tm24), TextAlign::CENTER_LEFT, "%.1f°", id(temp4).state);
      it.printf(412, 355, id(im20), TextAlign::TOP_RIGHT, "%s", weather_icon_map["umbrella"].c_str());
      it.printf(412, 368, id(tm24), TextAlign::CENTER_LEFT, "%.0f%%", id(rain4).state);


      it.filled_rectangle(0,400,150,150);
      it.printf(75, 413, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(day1).state.c_str());
      it.printf(75, 483, id(tm90), color_white, TextAlign::CENTER, "%.0f", id(tomorrowdate1).state);
      it.printf(75, 518, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(month1).state.c_str());

      it.printf(276.75, 483, id(im90), TextAlign::CENTER_RIGHT, "%s", weather_icon_map[id(condtom).state.c_str()].c_str());
      it.printf(276.75, 463, id(tm60), TextAlign::CENTER_LEFT, "%.1f°", id(mintemptom).state);

This is the crahs log:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (loopTask) 
Core 1 register dump:
PC      : 0x4008d06d  PS      : 0x00060836  A0      : 0x8008d13e  A1      : 0x3ffb0060  
A2      : 0x3ffded80  A3      : 0xbaad5678  A4      : 0x3ffded74  A5      : 0x3ff00000  
A6      : 0x3ffb01a0  A7      : 0x3ffb01a4  A8      : 0x3ffdee04  A9      : 0x3ffded78  
A10     : 0x00000001  A11     : 0x3ffded74  A12     : 0x0000123c  A13     : 0x00000050  
A14     : 0x3ffdfff8  A15     : 0x3ffdee08  SAR     : 0x0000000c  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff  

ELF file SHA256: 0000000000000000

Backtrace: 0x4008d06d:0x3ffb0060 0x4008d13b:0x3ffb0090 0x40081bd9:0x3ffb00b0 0x40081c0a:0x3ffb00d0 0x40086915:0x3ffb00f0 0x4000beaf:0x3ffb0110 0x40086953:0x3ffb0130 0x4011281f:0x3ffb0150 0x40112e75:0x3ffb0170 0x40111629:0x3ffb01a0 0x4010c85d:0x3ffb0230 0x4011130e:0x3ffb0540 0x4011134a:0x3ffb05d0 0x400d6bb1:0x3ffb0610 0x400d6c0e:0x3ffb0760 0x400df81d:0x3ffb07a0 0x400e0195:0x3ffb1060 0x400d6caf:0x3ffb1080 0x400d6cd6:0x3ffb10a0 0x400d9b46:0x3ffb10c0 0x40170aed:0x3ffb10e0 0x400decb6:0x3ffb1100 0x400dda9f:0x3ffb1140 0x400e29f1:0x3ffb1190 0x400eedea:0x3ffb1fb0 0x40089ab6:0x3ffb1fd0

Rebooting...

I doesn’t seem to be a brownout. But I am absolutely at a loss what is wrong here.

Does it work again if you remove one sensor?
How full is the memory?

If I remove 1 sensor it works again. Whether I keep logger on or off.
I don’t know how to see how much memory esphome is using.

When you compile, just before the 0-100% there is two values.

I believe ESPs stop working if they are above 68.4 % or something like it.
Can’t remember at the moment.

I am not at my desk right now. But those values are way low. Also it compiles fine and does the ota also. After that is crashes.

I have a feeling that the waveshare 7.50 HD is the culprit. I will try tomorrow with the 7.50 v2. That one has a slightly lower resolution. 800x480 instead of 880x528.

If anyone can take a look at the code and see where I can make more memory (ram) optimisations? That would be great!

You can always just compile to binary download, I think they can be aborted before it’s downloaded.

How would that help? The OTA finishes. It’s on the boot that it starts to crash.
If I download to binary and then upload it manually, that would make a difference?

Comment out or remove the captive_portal: and ap: items and see if it works again. I understand they consume quite a bit of resources.

It will give you the percentage of the RAM without sending it to the device.
Something you could do from a mobile phone.

When i get back i will try this and a smaller screen.

I will try this and report back here. I think it shows it too just before it does the OTA.

This is the value of the RAM just before the OTA:

RAM:   [=         ]  12.6% (used 41368 bytes from 327680 bytes)
Flash: [=====     ]  54.4% (used 998062 bytes from 1835008 bytes)

I’ve taken out also the reference to the captive portal, it doesn’t seem to make any difference.
Gonna try now with a smaller screen and see if that is the issue.

54% shouldn’t be a problem.
On my opinion it can’t be because of memory

So I tried with a different ESP32 board and a different e-paper, to no avail. It is just weird because it isn’t so much information. Also it isn’t a brownout (which normally means a ram issue), yet when I take one sensor away, everything works. So it seems a memory thing.

I got a little bit further. This doesn’t seem to be a memory problem. When I use the maximum amount of sensors before it crashes and then enable logging it keeps working. Normally logging takes a lot of memory and is the first to make the esp crash. Yet the logging can be started, but not the extra sensor. This is really strange. Will open up an issue in Github too.

I managed to solve the issue by moving almost everything over to Home Assisant and then creating separte sonsor from HA in ESPhome. So all the mapping that was done on the ESP32 is now done on HA.

This is the code on HA now for example:

- sensor:
  - name: weathertoday
    state: >
      {% set mapper =  {
          "clear-night" : "Clear night",
          "cloudy" : "Many clouds",
          "exceptional" : "Exceptional",
          "fog" : "Fog",
          "hail" : "Hail",
          "lightning" : "Lightning / thunderstorms",
          "lightning-rainy" : "Lightning / thunderstorms and rain",
          "partlycloudy" : "A few clouds",
          "pouring" : "Pouring rain",
          "rainy" : "Rain",
          "snowy" : "Snow",
          "snowy-rainy" : "Snow and Rain",
          "sunny" : "Sunshine",
          "windy" : "Wind",
          "windy-variant" : "Wind and clouds", } %}
        {% set state =  states.weather.openweathermap.state %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
    attributes: 
      date: >
        {{ as_timestamp(now()) | timestamp_custom('%-d') }}
      month: >
        {{ as_timestamp(now()) | timestamp_custom('%B') }}
      icon: > 
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  states.weather.openweathermap.state %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      temperature: >
        {{ states.sensor.netatmo_home_outdoor_temperature.state }}
      lowtemp: >
        {{ state_attr('weather.openweathermap', 'forecast')[0].templow }}
      hightemp: >
        {{ state_attr('weather.openweathermap', 'forecast')[0].temperature }}
      percipitation: >
        {{ state_attr('weather.openweathermap', 'forecast')[0].precipitation_probability }}

And in ESPhome it would be just this:

text_sensor:
  - platform: homeassistant
    id: desctoday
    entity_id: sensor.weathertoday

  - platform: homeassistant
    id: monttoday
    entity_id: sensor.weathertoday
    attribute: month

  - platform: homeassistant
    id: icontoday
    entity_id: sensor.weathertoday
    attribute: icon

sensor:
  - platform: homeassistant
    id: datetoday
    entity_id: sensor.weathertoday
    attribute: date

  - platform: homeassistant
    id: temptoday
    entity_id: sensor.weathertoday
    attribute: temperature

  - platform: homeassistant
    id: lowttoday
    entity_id: sensor.weathertoday
    attribute: lowtemp

  - platform: homeassistant
    id: hightoday
    entity_id: sensor.weathertoday
    attribute: hightemp

I have now more than 50 sensors and it is no longer crashing.

This is whole templates.yaml for HA:

- sensor:
  - name: weathertoday
    state: >
      {% set mapper =  {
          "clear-night" : "Clear night",
          "cloudy" : "Many clouds",
          "exceptional" : "Exceptional",
          "fog" : "Fog",
          "hail" : "Hail",
          "lightning" : "Lightning / thunderstorms",
          "lightning-rainy" : "Lightning / thunderstorms and rain",
          "partlycloudy" : "A few clouds",
          "pouring" : "Pouring rain",
          "rainy" : "Rain",
          "snowy" : "Snow",
          "snowy-rainy" : "Snow and Rain",
          "sunny" : "Sunshine",
          "windy" : "Wind",
          "windy-variant" : "Wind and clouds", } %}
        {% set state =  states.weather.openweathermap.state %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
    attributes: 
      date: >
        {{ as_timestamp(now()) | timestamp_custom('%-d') }}
      month: >
        {{ as_timestamp(now()) | timestamp_custom('%B') }}
      icon: > 
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  states.weather.openweathermap.state %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      temperature: >
        {{ states.sensor.netatmo_home_outdoor_temperature.state }}
      lowtemp: >
        {{ state_attr('weather.openweathermap', 'forecast')[0].templow }}
      hightemp: >
        {{ state_attr('weather.openweathermap', 'forecast')[0].temperature }}
      percipitation: >
        {{ state_attr('weather.openweathermap', 'forecast')[0].precipitation_probability }}
        
- sensor:
  - name: weathertodayhourly
    state: "OK"
    attributes:
      time1: >
        {{ as_timestamp(state_attr('weather.openweathermap_2', 'forecast')[0].datetime) | timestamp_custom('%H:%M') }}
      icon1: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap_2', 'forecast')[0].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      temp1: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[0].temperature }}
      rain1: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[0].precipitation_probability }}
      time2: >
        {{ as_timestamp(state_attr('weather.openweathermap_2', 'forecast')[1].datetime) | timestamp_custom('%H:%M') }}
      icon2: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap_2', 'forecast')[1].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      temp2: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[1].temperature }}
      rain2: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[1].precipitation_probability }}
      time3: >
        {{ as_timestamp(state_attr('weather.openweathermap_2', 'forecast')[2].datetime) | timestamp_custom('%H:%M') }}
      icon3: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap_2', 'forecast')[2].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      temp3: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[2].temperature }}
      rain3: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[2].precipitation_probability }}
      time4: >
        {{ as_timestamp(state_attr('weather.openweathermap_2', 'forecast')[3].datetime) | timestamp_custom('%H:%M') }}
      icon4: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap_2', 'forecast')[3].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      temp4: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[3].temperature }}
      rain4: >
        {{ state_attr('weather.openweathermap_2', 'forecast')[3].precipitation_probability }}
        
- sensor:
  - name: weathertomorrow
    state: >
      {{ state_attr('weather.openweathermap', 'forecast')[1].temperature }}
    attributes: 
      day: >
        {{ as_timestamp(state_attr('weather.openweathermap', 'forecast')[1].datetime) | timestamp_custom('%A') | upper }}
      date: >
        {{ as_timestamp(state_attr('weather.openweathermap', 'forecast')[1].datetime) | timestamp_custom('%-d') }}
      month: >
        {{ as_timestamp(state_attr('weather.openweathermap', 'forecast')[1].datetime) | timestamp_custom('%B') }}
      icon: > 
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state = state_attr('weather.openweathermap', 'forecast')[1].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      description: >
        {% set mapper =  {
          "clear-night" : "Clear night",
          "cloudy" : "Many clouds",
          "exceptional" : "Exceptional",
          "fog" : "Fog",
          "hail" : "Hail",
          "lightning" : "Lightning / thunderstorms",
          "lightning-rainy" : "Lightning / thunderstorms and rain",
          "partlycloudy" : "A few clouds",
          "pouring" : "Pouring rain",
          "rainy" : "Rain",
          "snowy" : "Snow",
          "snowy-rainy" : "Snow and Rain",
          "sunny" : "Sunshine",
          "windy" : "Wind",
          "windy-variant" : "Wind and clouds", } %}
        {% set state = state_attr('weather.openweathermap', 'forecast')[1].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      lowtemp: >
        {{ state_attr('weather.openweathermap', 'forecast')[1].templow }}
      percipitation: >
        {{ state_attr('weather.openweathermap', 'forecast')[1].precipitation_probability }}

- sensor: 
  - name: weatherdays
    state: "OK"
    attributes: 
      day1: >
        {{ as_timestamp(state_attr('weather.openweathermap', 'forecast')[2].datetime) | timestamp_custom('%a') }}
      icon1: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap', 'forecast')[2].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      hightemp1: >
        {{ state_attr('weather.openweathermap', 'forecast')[2].temperature }}
      lowtemp1: >
        {{ state_attr('weather.openweathermap', 'forecast')[2].templow }}
      rain1: >
        {{ state_attr('weather.openweathermap', 'forecast')[2].precipitation_probability }}
      day2: >
        {{ as_timestamp(state_attr('weather.openweathermap', 'forecast')[3].datetime) | timestamp_custom('%a') }}
      icon2: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap', 'forecast')[3].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      hightemp2: >
        {{ state_attr('weather.openweathermap', 'forecast')[3].temperature }}
      lowtemp2: >
        {{ state_attr('weather.openweathermap', 'forecast')[3].templow }}
      rain2: >
        {{ state_attr('weather.openweathermap', 'forecast')[3].precipitation_probability }}
      day3: >
        {{ as_timestamp(state_attr('weather.openweathermap', 'forecast')[4].datetime) | timestamp_custom('%a') }}
      icon3: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap', 'forecast')[4].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      hightemp3: >
        {{ state_attr('weather.openweathermap', 'forecast')[4].temperature }}
      lowtemp3: >
        {{ state_attr('weather.openweathermap', 'forecast')[4].templow }}
      rain3: >
        {{ state_attr('weather.openweathermap', 'forecast')[4].precipitation_probability }}
      day4: >
        {{ as_timestamp(state_attr('weather.openweathermap', 'forecast')[5].datetime) | timestamp_custom('%a') }}
      icon4: >
        {% set mapper =  {
          "cloudy" : "\U000F0590",
          "cloudy-alert" : "\U000F0F2F",
          "cloudy-arrow-right" : "\U000F0E6E",
          "fog" : "\U000F0591",
          "hail" : "\U000F0592",
          "hazy" : "\U000F0F30",
          "hurricane" : "\U000F0898",
          "lightning" : "\U000F0593",
          "lightning-rainy" : "\U000F067E",
          "night" : "\U000F0594",
          "clear-night" : "\U000F0594",
          "night-partly-cloudy" : "\U000F0F31",
          "partlycloudy" : "\U000F0595",
          "partly-lightning" : "\U000F0F32",
          "partly-rainy" : "\U000F0F33",
          "partly-snowy" : "\U000F0F34",
          "partly-snowy-rainy" : "\U000F0F35",
          "pouring" : "\U000F0596",
          "rainy" : "\U000F0597",
          "snowy" : "\U000F0598",
          "snowy-heavy" : "\U000F0F36",
          "snowy-rainy" : "\U000F067F",
          "sunny" : "\U000F0599",
          "sunny-alert" : "\U000F0F37",
          "sunny-off" : "\U000F14E4",
          "sunset" : "\U000F059A",
          "sunset-down" : "\U000F059B",
          "sunset-up" : "\U000F059C",
          "tornado" : "\U000F0F38",
          "windy" : "\U000F059D",
          "windy-variant" : "\U000F059E",
          "low-temperature" : "\U000F10C3",
          "high-temperature" : "\U000F10C2",
          "alert-temperature" : "\U000F0E01",
          "umbrella" : "\U000F054B",
          "alert-low-temperature" : "\U000F0F29", } %}
        {% set state =  state_attr('weather.openweathermap', 'forecast')[5].condition %}
        {{ mapper[state] if state in mapper else 'Unknown' }}
      hightemp4: >
        {{ state_attr('weather.openweathermap', 'forecast')[5].temperature }}
      lowtemp4: >
        {{ state_attr('weather.openweathermap', 'forecast')[5].templow }}
      rain4: >
        {{ state_attr('weather.openweathermap', 'forecast')[5].precipitation_probability }}

I probably could do some undoubling, but it works for now.

And this is the ESPhome code:

esphome:
  name: temperature

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "******************"

ota:
  password: "**************************"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.10.14
    gateway: 192.168.10.1
    subnet: 255.255.255.0

deep_sleep:
  run_duration: 90s
  sleep_duration: 60min

font:
  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm12
    size: 12
  
  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm24
    size: 24

  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm60
    size: 60
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.']

  - file: "fonts/AcuminPro-Medium.ttf"
    id: tm90
    size: 90
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.']

  - file: "fonts/AcuminPro-Light.ttf"
    id: tl24
    size: 24
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.', 'm', 'i', 'n', 'a', 'x', ':', '/', '%', 'r']

  - file: "fonts/AcuminPro-Light.ttf"
    id: tl60
    size: 60
    glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '.']

  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im90
    size: 90
    glyphs: &mdi-weather-glyphs
      - "\U000F0590" # mdi-weather-cloudy
      - "\U000F0F2F" # mdi-weather-cloudy-alert
      - "\U000F0E6E" # mdi-weather-cloudy-arrow-right
      - "\U000F0591" # mdi-weather-fog
      - "\U000F0592" # mdi-weather-hail
      - "\U000F0F30" # mdi-weather-hazy
      - "\U000F0898" # mdi-weather-hurricane
      - "\U000F0593" # mdi-weather-lightning
      - "\U000F067E" # mdi-weather-lightning-rainy
      - "\U000F0594" # mdi-weather-night
      - "\U000F0F31" # mdi-weather-night-partly-cloudy
      - "\U000F0595" # mdi-weather-partly-cloudy
      - "\U000F0F32" # mdi-weather-partly-lightning
      - "\U000F0F33" # mdi-weather-partly-rainy
      - "\U000F0F34" # mdi-weather-partly-snowy
      - "\U000F0F35" # mdi-weather-partly-snowy-rainy
      - "\U000F0596" # mdi-weather-pouring
      - "\U000F0597" # mdi-weather-rainy
      - "\U000F0598" # mdi-weather-snowy
      - "\U000F0F36" # mdi-weather-snowy-heavy
      - "\U000F067F" # mdi-weather-snowy-rainy
      - "\U000F0599" # mdi-weather-sunny
      - "\U000F0F37" # mdi-weather-sunny-alert
      - "\U000F14E4" # mdi-weather-sunny-off
      - "\U000F059A" # mdi-weather-sunset
      - "\U000F059B" # mdi-weather-sunset-down
      - "\U000F059C" # mdi-weather-sunset-up
      - "\U000F0F38" # mdi-weather-tornado
      - "\U000F059D" # mdi-weather-windy
      - "\U000F059E" # mdi-weather-windy-variant
      - "\U000F10C2" # mdi-thermometer-high
      - "\U000F10C3" # mdi-thermometer-low
      - "\U000F0E01" # mdi-thermometer-alert
      - "\U000F054B" # mdi-umbrella-outline
      - "\U000F0F29" # mdi-snowflake-alert

  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im24
    size: 24
    glyphs: *mdi-weather-glyphs

  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im20
    size: 20
    glyphs: *mdi-weather-glyphs
 
  - file: 'fonts/materialdesignicons-webfont.ttf'
    id: im40
    size: 40
    glyphs: *mdi-weather-glyphs  

color:
  - id: color_white
    red: 0%
    green: 0%
    blue: 0%
    white: 0%

time:
  - platform: homeassistant
    id: ha_time

text_sensor:
  - platform: homeassistant
    id: desctoday
    entity_id: sensor.weathertoday

  - platform: homeassistant
    id: monttoday
    entity_id: sensor.weathertoday
    attribute: month

  - platform: homeassistant
    id: icontoday
    entity_id: sensor.weathertoday
    attribute: icon

  - platform: homeassistant
    id: hrtime1
    entity_id: sensor.weathertodayhourly
    attribute: time1

  - platform: homeassistant
    id: hricon1
    entity_id: sensor.weathertodayhourly
    attribute: icon1

  - platform: homeassistant
    id: hrtime2
    entity_id: sensor.weathertodayhourly
    attribute: time2

  - platform: homeassistant
    id: hricon2
    entity_id: sensor.weathertodayhourly
    attribute: icon2

  - platform: homeassistant
    id: hrtime3
    entity_id: sensor.weathertodayhourly
    attribute: time3

  - platform: homeassistant
    id: hricon3
    entity_id: sensor.weathertodayhourly
    attribute: icon3

  - platform: homeassistant
    id: hrtime4
    entity_id: sensor.weathertodayhourly
    attribute: time4

  - platform: homeassistant
    id: hricon4
    entity_id: sensor.weathertodayhourly
    attribute: icon4

  - platform: homeassistant
    id: daytom
    entity_id: sensor.weathertomorrow
    attribute: day

  - platform: homeassistant
    id: monttom
    entity_id: sensor.weathertomorrow
    attribute: month

  - platform: homeassistant
    id: icontom
    entity_id: sensor.weathertomorrow
    attribute: icon

  - platform: homeassistant
    id: day1days
    entity_id: sensor.weatherdays
    attribute: day1

  - platform: homeassistant
    id: icon1days
    entity_id: sensor.weatherdays
    attribute: icon1

  - platform: homeassistant
    id: day2days
    entity_id: sensor.weatherdays
    attribute: day2

  - platform: homeassistant
    id: icon2days
    entity_id: sensor.weatherdays
    attribute: icon2

  - platform: homeassistant
    id: day3days
    entity_id: sensor.weatherdays
    attribute: day3

  - platform: homeassistant
    id: icon3days
    entity_id: sensor.weatherdays
    attribute: icon3

  - platform: homeassistant
    id: day4days
    entity_id: sensor.weatherdays
    attribute: day4

  - platform: homeassistant
    id: icon4days
    entity_id: sensor.weatherdays
    attribute: icon4

sensor:
  - platform: homeassistant
    id: datetoday
    entity_id: sensor.weathertoday
    attribute: date

  - platform: homeassistant
    id: temptoday
    entity_id: sensor.weathertoday
    attribute: temperature

  - platform: homeassistant
    id: lowttoday
    entity_id: sensor.weathertoday
    attribute: lowtemp

  - platform: homeassistant
    id: hightoday
    entity_id: sensor.weathertoday
    attribute: hightemp

  - platform: homeassistant
    id: perctoday
    entity_id: sensor.weathertoday
    attribute: percipitation

  - platform: homeassistant
    id: hrtemp1
    entity_id: sensor.weathertodayhourly
    attribute: temp1

  - platform: homeassistant
    id: hrrain1
    entity_id: sensor.weathertodayhourly
    attribute: rain1

  - platform: homeassistant
    id: hrtemp2
    entity_id: sensor.weathertodayhourly
    attribute: temp2

  - platform: homeassistant
    id: hrrain2
    entity_id: sensor.weathertodayhourly
    attribute: rain2

  - platform: homeassistant
    id: hrtemp3
    entity_id: sensor.weathertodayhourly
    attribute: temp3

  - platform: homeassistant
    id: hrrain3
    entity_id: sensor.weathertodayhourly
    attribute: rain3

  - platform: homeassistant
    id: hrtemp4
    entity_id: sensor.weathertodayhourly
    attribute: temp4

  - platform: homeassistant
    id: hrrain4
    entity_id: sensor.weathertodayhourly
    attribute: rain4

  - platform: homeassistant
    id: hightom
    entity_id: sensor.weathertomorrow

  - platform: homeassistant
    id: datetom
    entity_id: sensor.weathertomorrow
    attribute: date

  - platform: homeassistant
    id: lowtom
    entity_id: sensor.weathertomorrow
    attribute: lowtemp

  - platform: homeassistant
    id: perctom
    entity_id: sensor.weathertomorrow
    attribute: percipitation

  - platform: homeassistant
    id: high1days
    entity_id: sensor.weatherdays
    attribute: hightemp1

  - platform: homeassistant
    id: low1days
    entity_id: sensor.weatherdays
    attribute: lowtemp1

  - platform: homeassistant
    id: rain1days
    entity_id: sensor.weatherdays
    attribute: rain1

  - platform: homeassistant
    id: high2days
    entity_id: sensor.weatherdays
    attribute: hightemp2

  - platform: homeassistant
    id: low2days
    entity_id: sensor.weatherdays
    attribute: lowtemp2

  - platform: homeassistant
    id: rain2days
    entity_id: sensor.weatherdays
    attribute: rain2

  - platform: homeassistant
    id: high3days
    entity_id: sensor.weatherdays
    attribute: hightemp3

  - platform: homeassistant
    id: low3days
    entity_id: sensor.weatherdays
    attribute: lowtemp3

  - platform: homeassistant
    id: rain3days
    entity_id: sensor.weatherdays
    attribute: rain3

  - platform: homeassistant
    id: high4days
    entity_id: sensor.weatherdays
    attribute: hightemp4

  - platform: homeassistant
    id: low4days
    entity_id: sensor.weatherdays
    attribute: lowtemp4

  - platform: homeassistant
    id: rain4days
    entity_id: sensor.weatherdays
    attribute: rain4

spi:
  clk_pin: 5
  mosi_pin: 18

display:
  - platform: waveshare_epaper
    cs_pin: 22
    dc_pin: 23
    busy_pin: 32
    reset_pin: 21
    model: 7.50in-hd-b
    update_interval: 30sec
    reset_duration: 200ms
    rotation: 90°
    lambda: |-
      it.filled_rectangle(0, 0, 150, 388);
      it.print(75, 75, id(tm24), color_white, TextAlign::TOP_CENTER, "TODAY");
      it.printf(75, 145, id(tm90), color_white, TextAlign::CENTER, "%.0f", id(datetoday).state);
      it.printf(75, 180, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(monttoday).state.c_str());

      it.printf(276.75, 145, id(im90), TextAlign::CENTER_RIGHT, "%s", id(icontoday).state.c_str());
      it.printf(276.75, 145, id(tm90), TextAlign::CENTER_LEFT, "%.1f°", id(temptoday).state);
      it.printf(319, 180, id(tm24), TextAlign::TOP_CENTER, "%s", id(desctoday).state.c_str());

      it.printf(244.50, 225, id(tm24), TextAlign::TOP_RIGHT, "%.0f%%", id(perctoday).state);
      it.print(244.50, 222, id(im24), TextAlign::TOP_LEFT, "\U000F054B");

      it.printf(329, 225, id(tl24), TextAlign::TOP_RIGHT, "%.1f°", id(lowttoday).state);
      if(id(lowttoday).state < -5 ) {
        it.print(329, 222, id(im24), TextAlign::TOP_LEFT, "\U000F0F29");
      } else {
        it.print(329, 222, id(im24), TextAlign::TOP_LEFT, "\U000F10C3");
      }

      it.printf(413.50, 225, id(tm24), TextAlign::TOP_RIGHT, "%.1f°", id(hightoday).state);
      if(id(hightoday).state > 34) {
        it.print(413.50, 222, id(im24), TextAlign::TOP_LEFT, "\U000F0E01");
      } else {
        it.print(413.50, 222, id(im24), TextAlign::TOP_LEFT, "\U000F10C2");
      }
      it.filled_rectangle (0, 270, 528, 138);
      it.printf(61, 290, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(hrtime1).state.c_str());
      it.printf(56, 315, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(hricon1).state.c_str());
      it.printf(56, 335, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp1).state);
      it.print(46, 355, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(46, 368, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain1).state);

      it.printf(183, 290, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(hrtime2).state.c_str());
      it.printf(178, 315, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(hricon2).state.c_str());
      it.printf(178, 335, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp2).state);
      it.print(168, 355, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(168, 368, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain2).state);

      it.printf(305, 290, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(hrtime3).state.c_str());
      it.printf(300, 315, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(hricon3).state.c_str());
      it.printf(300, 335, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp3).state);
      it.print(290, 355, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(290, 368, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain3).state);

      it.printf(427, 290, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(hrtime4).state.c_str());
      it.printf(422, 315, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(hricon4).state.c_str());
      it.printf(422, 335, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(hrtemp4).state);
      it.print(412, 355, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(412, 368, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(hrrain4).state);

      it.filled_rectangle(0,446,150,340);
      it.printf(75, 459, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(daytom).state.c_str());
      it.printf(75, 529, id(tm90), color_white, TextAlign::CENTER, "%.0f", id(datetom).state);
      it.printf(75, 564, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(monttom).state.c_str());

      it.printf(297.87, 529, id(im90), TextAlign::CENTER_RIGHT, "%s", id(icontom).state.c_str());
      it.printf(297.87, 529, id(tm60), TextAlign::BOTTOM_LEFT, "%.1f°", id(hightom).state);
      it.printf(297.87, 529, id(tl60), TextAlign::TOP_LEFT, "%.1f°", id(lowtom).state);

      it.printf(329, 589, id(tm24), TextAlign::TOP_RIGHT, "%.0f%%", id(perctom).state);
      it.print(329, 586, id(im24), TextAlign::TOP_LEFT, "\U000F054B");

      it.filled_rectangle (0, 634, 528, 153);
      it.printf(61, 654, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(day1days).state.c_str());
      it.printf(56, 689, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(icon1days).state.c_str());
      it.printf(56, 699, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(high1days).state);
      it.printf(56, 729, id(tl24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(low1days).state);
      it.print(46, 749, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(46, 762, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(rain1days).state);

      it.printf(183, 654, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(day2days).state.c_str());
      it.printf(178, 689, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(icon2days).state.c_str());
      it.printf(178, 699, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(high2days).state);
      it.printf(178, 729, id(tl24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(low2days).state);
      it.print(168, 749, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(168, 762, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(rain2days).state);

      it.printf(305, 654, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(day3days).state.c_str());
      it.printf(300, 689, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(icon3days).state.c_str());
      it.printf(300, 699, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(high3days).state);
      it.printf(300, 729, id(tl24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(low3days).state);
      it.print(290, 749, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(290, 762, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(rain3days).state);

      it.printf(427, 654, id(tm24), color_white, TextAlign::TOP_CENTER, "%s", id(day4days).state.c_str());
      it.printf(422, 689, id(im40), color_white, TextAlign::TOP_RIGHT, "%s", id(icon4days).state.c_str());
      it.printf(422, 699, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(high4days).state);
      it.printf(422, 729, id(tl24), color_white, TextAlign::CENTER_LEFT, "%.1f°", id(low4days).state);
      it.print(412, 749, id(im20), color_white, TextAlign::TOP_RIGHT, "\U000F054B");
      it.printf(412, 762, id(tm24), color_white, TextAlign::CENTER_LEFT, "%.0f%%", id(rain4days).state);

      it.strftime(485, 815, id(tm12), TextAlign::BOTTOM_RIGHT, "last updated: %H:%M", id(ha_time).now());