Error with time automation

hi
can some one tell why this code getting error in config?

Testing configuration at /config
Failed config
automation:
- Invalid config for [automation]: [condition] is an invalid option for [automation]. Check: automation->trigger->0->condition.

  • alias: main door open
    hide_entity: False
    initial_state: ‘off’
    trigger:
    platform: state
    entity_id: sensor.broadlink_s1c_main_door
    from: ‘closed’
    to: ‘open’
    condition: time
    after: “16:00:00”
    before: “23:00:00”
    action:
    service: switch.turn_on
    entity_id: switch.kitchen_light

Try this:

- alias: main door open
  hide_entity: False
  initial_state: 'off’
  trigger:
    - platform: state
      entity_id: sensor.broadlink_s1c_main_door
      from: 'closed’
      to: 'open’
  condition:
    - condition: time
      after: "16:00:00"
      before: "23:00:00"
  action:
  - service: switch.turn_on
    entity_id: switch.kitchen_light

the spaces are very important and you need to have the condition: extra