Help with automation based in three triggers. don't know how to make as conditions

Hi,
I currently have an ESPHOME divice, battery powered, that I want to turn off based on a Mqtt command, the problem is that I can’t get, because I don’t know how, to turn of when all the values are sent and not just one.
I want to send the MQTT command once home assistant receives the THREE values, not just one. This must be done via conditions, but don’t know how to enter a condition as such as “being updated in the last 20 seconds”

Code here;

id: '16186466'
alias: Apagar pool temp after data received
description: ''
trigger:
  - platform: mqtt
    topic: /poolthermometer/sensor/bateria_/state
  - platform: mqtt
    topic: /poolthermometer/sensor/bateria_v/state
  - platform: mqtt
    topic: /poolthermometer/sensor/pool_temperature/state
condition: []
action:
  - service: mqtt.publish
    data:
      payload: 'ON'
      topic: poolthermometer/sleep_mode
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: mqtt.publish
    data:
      topic: poolthermometer/sleep_mode
      payload: 'OFF'
mode: single

this might work:


description: ''
trigger:
  - platform: mqtt
    topic: /poolthermometer/sensor/bateria_/state
  - platform: mqtt
    topic: /poolthermometer/sensor/bateria_v/state
  - platform: mqtt
    topic: /poolthermometer/sensor/pool_temperature/state
condition:
  - condition: template
    value_template: >
      {{ (as_timestamp(now()) -
      as_timestamp(states.sensor.pool_temperature.last_updated)) > 1 }}
  - condition: template
    value_template: >
      {{ (as_timestamp(now()) -
      as_timestamp(states.sensor.bateria.last_updated)) > 1 }}
  - condition: template
    value_template: >
      {{ (as_timestamp(now()) -
      as_timestamp(states.sensor.bateria_v.last_updated)) > 1 }}
action:
  - service: mqtt.publish
    data:
      payload: 'ON'
      topic: poolthermometer/sleep_mode
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: mqtt.publish
    data:
      topic: poolthermometer/sleep_mode
      payload: 'OFF'
mode: single