Noob here "Duplicate key"

Trying to get my lights to change brightness and colour based on time. I made sure to be pretty meticulous when using killsystem’s yaml

ERROR:homeassistant.util.yaml.loader:YAML file /home/homeassistant/.homeassistant/configuration.yaml contains duplicate key "scene". Check lines 30 and 39.
ERROR:homeassistant.util.yaml.loader:YAML file /home/homeassistant/.homeassistant/configuration.yaml contains duplicate key "scene". Check lines 39 and 48.
ERROR:homeassistant.util.yaml.loader:YAML file /home/homeassistant/.homeassistant/configuration.yaml contains duplicate key "scene". Check lines 48 and 57.
ERROR:homeassistant.util.yaml.loader:YAML file /home/homeassistant/.homeassistant/configuration.yaml contains duplicate key "scene". Check lines 57 and 66.
Failed config
  General Errors: 
    - Component error: data_template - Integration data_template not found.
    - Component error: condition - Integration condition not found.

If anyone can help it’d be much appreciative. I checked the spacing pretty meticulously but any help I thank you

- alias: detect lights and adjust the brightness when turned on based on time
  hide_entity: False
  trigger:
    - platform: event
      event_type: state_changed
 
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: group.family
        state: 'home'
      - condition: template
        value_template: "{{ trigger.event.data is not none }}"
      - condition: template
        value_template: "{{ trigger.event.data.entity_id is not none }}"
      - condition: template
        value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
      - condition: template
        value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.livingroom' }}"
      - condition: template
        value_template: "{{ trigger.event.data.old_state.attributes['is_hue_group'] != true }}"
      - condition: template
        value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
      - condition: template
        value_template: "{{ trigger.event.data.new_state.state == 'on' }}"

  action:
    - service: light.turn_on
      data_template:
        entity_id: "all_lights"
        brightness: >
          {% set hour=states("sensor.time").split(':')[0] | int %}
          {% set dayOfWeek=now().weekday()  %}
          {%- if hour >= 0 and hour < 10.5 and dayOfWeek in [5,6] -%}
            15
          {%- elif hour >= 11 and hour < 13 and dayOfWeek in [0,1,2,3,4,5,6] -%}
            75
          {%- elif hour >= 14 and hour < 22 and dayOfWeek in [0,1,2,3,4,5,6] -%}
            255
          {%- elif hour >= 8 and hour < 23  -%}
            255
          {%- else -%}
            1
          {%- endif %}
        color_temp: >
          {% set hour=states("sensor.time").split(':')[0] | int %}
          {%- if hour >= 5 and hour < 8  -%}
            400
          {%- elif hour >= 8 and hour < 23  -%}
            366
          {%- else -%}
            500
          {%- endif %}

Seems you have multiple

scene: 

definitions in config in the lines as specified in the error.