One sensor two separate line on display

Hello,
I have created a sensor that merges two separate sensors in the home assistant:
temperature and humidity using the value template:

 {{ states('sensor.zadverie_teplomer_esp_temperature_3') | float | round(1)}}/{{ states('sensor.zadverie_teplomer_esp_humidity_3') | float | round(0) }}

I would like to use this data in esphome on the display in two separate lines:

first line temperature
second line humidity

Can you help me with the code? Well thank you.

It depends on which display the values will be displayed

Why?

Especially as you want to use them separately:

  1. Delete your combined sensor.
  2. Add the two sensors to an entities card.

Why?
There are more than 60 sensors that are imported to the display.
ESP32 will not load after a certain amount, but will remain stuck at boot.
Therefore, I need to merge several sensors into one.

What sensible data do you expect to get dividing temp by humidity?


the result from the template is not a division “/” is a character

otherwise, this is the way to write it, which I posted here:

But there I ran into a problem with “substr”

So right, sorry for the mistake.

I moved your post to the ESPHome category to make it clearer what you are talking about. I missed this:

I solved it this way so far.
Does anyone have an easier entry?

      std::string airquality = id(air_spalna).state;
      std::size_t temperature_air, humidity_air = 0;
      char delimair = '/';
      temperature_air = airquality.find(delimair);

      for (int k=0; k<2; k++) { 
          if (k == 0) {
            it.printf(87, 204, id(fonttext3), TextAlign::TOP_CENTER, "%s", airquality.substr(humidity_air, temperature_air - humidity_air).c_str());
          } else if (k == 1) {
            it.printf(87, 216, id(fonttext3), TextAlign::TOP_CENTER, "%s", airquality.substr(humidity_air, temperature_air - humidity_air).c_str());
          }
          humidity_air = temperature_air + 1;
          temperature_air = airquality.find(delimair, humidity_air);
      }

You can split a string in two parts I have some code for that but since you have 60 sensor values I suggest you create one sensor with all the values in one attribute as a JSON string.
The entity will probably not look like JSON but if you look in developer tools it is JSON.

Then from there you could probably import it to the ESP device and parse it using: