Multiple "for" in automation trigger?

Hi all,
I have to following automation to turn off lights when a motion sensor is not triggert for 20 minutes:

  - alias: 'Licht im Esszimmer aus'
      - platform: state
        entity_id: sensor.motion_wohnzimmer_sensor
        to: 'off'
          minutes: 20
      - condition: time
        after: '05:00:00'
        before: '08:00:00'
      service: homeassistant.turn_off
      entity_id: group.lichter_decke_esszimmer

Is it possible to set another “for” with another condition inside this automation? I want to turn off the lights during another timeslot in 2 minutes instead of 20. What can I do to archive this? I’m glad for any help. Thank you in advance.

Duplicate the whole automation with the same trigger, but “off for 2 minutes” and your new time window condition. As long as the two time window conditions don’t overlap you shouldn’t have a problem.

Okay, thank you very much. I will try it.