Two te,plate conditions in one

Haven’t done it before or seen in the configs - so i wonder if the following will work. When entity_id and brightness are both part of automation

  action:
    service: light.turn_on
    data_template:
      entity_id: >
        {%- if is_state("sensor.rules_day_night", "Evening") %}
          group.kitchen_light_strip
        {%- if is_state("sensor.rules_day_night", "Day") %}
          group.kitchen_light2 
        {%- else %}
          group.kitchen_light2                   
      brightness: >
        {%- if is_state("sensor.rules_day_night", "Evening") %}
        255
        {%- elif is_state("sensor.rules_day_night", "Nightfall") %}
        120
        {%- elif is_state("sensor.rules_day_night", "Night") %}
        60
        {%- else %}
        255
        {% endif %}

Should work, I have similar to control brightness based on time of day.