Please Help: Last updated value of group of sensors

I have a problem with template sensor as an example below. I have several sensors to detect the temperature in an area to be sure at least one is working. My solution has been combined sensor below. (only two sensors in this example)

In my case this does not work. Having zigbee sensors it looks like even the sensor has dropped out of system HA still show the last value for a long time before changing the status to unavailable.

        friendly_name: "Temp Combined"
        unit_of_measurement: '°C'
        value_template: >
          {% if states('sensor.temp1') not in ['unknown', 'unavailable', 'none'] %}
          {{ '%0.1f'|format(states('sensor.temp1')|float + 0.7) }}
          {% else %}
          {{ states('sensor.temp2')}}
          {% endif %} 

Now is there a way to create a template sensor which shows the last updated value of a group of sensors?

It would be highly appreciated if someone can help me out with this question.

That’s not a valid slug. Try using an underscore instead of a space.

Thanks Tom!

Actually in my original code it is correct, I just quickly translated my native language to English (for you ;-)). I corrected the the code above but the question is still valid. If the first sensor is “dead” HA does not know it and provides that value instead of the second sensor.

If I could get the last updated value of group of sensors I think it would work.

Below is what I get with that template sensor. As you see sensor 1 is dead but HA sees the last value of it and thinks it is alive. Real temperature is found from sensor 2. And we see that short moment HA finds sensor 1 dead and combines the value as expected.

I think I found the solution to my problem: helpers → combine sensors → most recently updated :+1: