Using a template for elapsed time of a group state in a condition

How do I get a template to work with a group in a condition?

I’ve been fighting this for a couple of days now. I’m trying to use a template for an input_number to set a motion sensor timeout for a light. I’ve been able to get the template to work for 2 triggers and a state condition.

This is my debug card. I want to turn off the lights when motion is seen for whatever the delay is set to.

Automation Code:

id: '1597682593587'
alias: Garage Lights Off
description: Turn off garage lights after no motion.
# Change log
# 20200913
#   - Added overhead motion sensor.
#   - Changed motion sensors to a group.
trigger:
- platform: state
  entity_id: group.garage_motion_sensors
  to: 'on'
  for:
    seconds: "{{ states('input_number.garage_lights_off_delay') }}"
- device_id: ca4ff0d7615d4169b27e7f2cc051e679
  domain: switch
  entity_id: switch.garage_lights_switch
  for:
    seconds: "{{ states('input_number.garage_lights_off_delay') }}"
  platform: device
  type: turned_on
condition:
- condition: state
  entity_id: group.garage_motion_sensors
  for:
    # seconds: 300     # This works
    seconds: "{{ states('input_number.garage_lights_off_delay') }}"
      # This does not work
      # Configuration validation gives me "Configuration invalid"
        # Invalid config for [automation]: expected float for dictionary value @ data['condition'][0]['for']['seconds']. Got None.
  state: 'off'
- condition: device
  device_id: ca4ff0d7615d4169b27e7f2cc051e679
  domain: switch
  entity_id: switch.garage_lights_switch
  for:
    seconds: "{{ states('input_number.garage_lights_off_delay') }}"
  type: is_on
action:
- device_id: ca4ff0d7615d4169b27e7f2cc051e679
  domain: switch
  entity_id: switch.garage_lights_switch
  type: turn_off
mode: restart

You can’t template the for on a condition. The functionality doesn’t exist yet.

Thanks Petro.