Help with automation conditions / trigger

Hi!

I want a automation that notify when the garden door is open for 10 mins and the temperature is below 14º C.

My code is:

- alias: Puerta del Patio Abierta
  initial_state: true
  trigger:
    - platform: state
      entity_id: binary_sensor.puerta_patio
      to: 'on'
      for: '00:10:00'
  condition:
    condition: sensor.dark_sky_temperature
    below: 14
  action:
    - service: notify.telegram
      data_template:
        message: "La puerta del patio está abierta y hace fresquete..."

The problem is that if I open the door at 10:00 when the temperature is 17º and at 12:00 the temperature down to 12º, I will not notify because the trigger don’t will be release again, only at 10:10.

How I can trigger when the two conditions return true?

I think add other condition with temperature trigger and door condition, but I prefered ask about a more elegant solution

Just add another trigger and another condition. The condition you show here shouldn’t work btw…

It should be:

- alias: Puerta del Patio Abierta
  initial_state: true
  trigger:
    - platform: state
      entity_id: binary_sensor.puerta_patio
      to: 'on'
      for:
        minutes: 10
   - platform: numeric_state
     entity_id: sensor.dark_sky_temperature
     below: 14
  condition:
   - condition: numeric_state
     entity_id: sensor.dark_sky_temperature
     below: 14
   - condition: state
     entity_id: binary_sensor.puerta_patio
     state: 'on'
     for:
       minutes: 10
  action:
    - service: notify.telegram
      data_template:
        message: "La puerta del patio está abierta y hace fresquete..."
1 Like

Oh, It is so… logical…
Thanks you!