This shouldn’t be necessary, but try it with the lights template defining a variable…
alias: Sun Color Stairs
description: 'Changes the color of light to match the sun'
trigger:
- platform: time_pattern
minutes: '/5'
condition:
- condition: state
entity_id: group.circadian_lights
state: 'on'
action:
- service: light.turn_on
data_template:
color_temp: |
{{ (states('sensor.circadian_light') | int) }}
target:
entity_id: '{{active_lights}}'
mode: single
variables:
active_lights: |
{{ expand('group.circadian_lights') | selectattr('state', 'eq', 'on') | map(attribute = 'entity_id') | list }}
EDITED to address typo in template