Conditional template for x-minutes

I have a condition template.
I want to be the condition TRUE when the value_template is TRUE for 30 minutes.
I do NOT want to change anything to the trigger because the timing is aligned with other automation.

  - alias: zv thermostaat logeerkamer
    trigger:
      - platform: template     # on 4m, 9m, 14m, ... 59m
        value_template: "{{ (now().minute - 4) % 5 == 0 }}"
    action:
      - choose:
          - conditions:
              - condition: template
                value_template: "{{ states('sensor.ht_logeerkamer_temperature')|float(0) < states('input_number.zv_thermostaat_logeerkamer')|float(0) }}"

Adding

                for:
                  minutes: 30

is not working.
So how can I achieve this?

While it is supported for template triggers, the docs do not mention for as a valid option for template conditions. You can move you template to a Template binary sensor then use a State condition based on that with a for.

Instead of polling every few minutes, to check if the sensor value is below the input_number for 30 minutes, use a Numeric State Trigger. It will trigger exactly when the sensor’s value is below the input_number for 30 minutes.

  - alias: zv thermostaat logeerkamer
    trigger:
      - platform: numeric_state
        entity_id: sensor.ht_logeerkamer_temperature
        below: input_number.zv_thermostaat_logeerkamer
        for:
          minutes: 30
    action:
      ... etc ...

Thanks for thinking along, but as I wrote, there is a reason why I want to know this “on 4m, 9m, 14m, … 59m”, so this is not a solution (for me).
I go for Drew’s idea. That is exactly what I need. Not in a template, an extra step, but a useful step. I can recycle these new binary sensors in another place.

What’s the reason?

I have valves for floor heating that open on a specific time, they take about 3 minutes to open. Than the heatpump can start, otherwise the heatpump powerconsumption is to high. Secondly here in belgium we will be charged peak-power-consumption per 15 minutes, starting at exactly 00, 15, 30, … minutes. To be able to run the heatpump as long as possible without having to interrupt it (and again causing a start), I’m stuck with a timing like this. All of this also takes other appliances in the house into account, each with a specific timing.