Keep getting validation error for automations.yaml when it appears to be valid

I keep getting the error on ver 88.2 when I validate:

Invalid config for [automation]: [platform] is an invalid option for [automation]. Check:     automation->condition->0->platform. (See /config/configuration.yaml, line 185). Please check the docs at https://home-assistant.io/components/automation/

In the automations.yaml

- alias: 'Turn on lights when someone opens front door and has just arrived home'
  trigger:
    - platform: state
      entity_id: binary_sensor.door_window_sensor_158d0002019ab0
      to: 'open'
  condition:
    - platform: sun
      event: sunset
      offset: "-00:45:00"
    - platform: state
      entity_id: group.presence
      from: 'off'
      to: 'on'
      for:
        seconds: 10
  action:
    - service: light.turn_on
      data:
        entity_id: lights.main_lights
        brightness: 50
        rgb_color: [255,143,0]
        transition: 10

in configuration.yaml at (lines)

(185) group: !include groups.yaml
(186) automation: !include automations.yaml
(187) script: !include scripts.yaml

Sun: is declared in the configurations.yaml. I cannot for the life of me figure out where I am going wrong to the point validation fails. Any ideas?

light.turn_on and light.turn_off service does not accept rgb_color

Of course it does, how else do you set the colour?

it’s your conditions:

  condition:
    - platform: sun
      event: sunset
      offset: "-00:45:00"

They should be like

      - condition: state
        entity_id: sun.sun
        state: 'below_horizon'