Need some help in automation!

hi…im new hassio just writen some basic code for my door sernsors and light bulb and its giving me this error can ayone please guide me whats the issue…?

Invalid config for [automation]: [condition] is an invalid option for [automation]. Check: automation->trigger->0->condition. (See /config/configuration.yaml, line 13). Please check the docs at https://home-assistant.io/components/automation/
Invalid config for [automation]: extra keys not allowed @ data[‘condition’][0][‘conditions’][0][‘for’]. Got None
extra keys not allowed @ data[‘condition’][0][‘conditions’][0][‘from’]. Got None
extra keys not allowed @ data[‘condition’][0][‘conditions’][0][‘to’]. Got None
not a valid value for dictionary value @ data[‘condition’][0][‘conditions’][0][‘condition’]. Got None. (See /config/configuration.yaml, line 13). Please check the docs at
Invalid config for [automation]: extra keys not allowed @ data[‘condition’][0][‘conditions’][0][‘for’]. Got None
extra keys not allowed @ data[‘condition’][0][‘conditions’][0][‘from’]. Got None
extra keys not allowed @ data[‘condition’][0][‘conditions’][0][‘to’]. Got None
not a valid value for dictionary value @ data[‘condition’][0][‘conditions’][0][‘condition’]. Got None. (See /config/configuration.yaml, line 13). Please check the docs at


- alias: If the Door opens and motion detected on motion sensor"1" or "2"  turn On the lights
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d000396a32c
    from: 'off'
    to: 'on'
    
    condition:
      condition: or
      conditions:
      - condition: state
        entity_id: binary_sensor.motion_sensor_158d0003d19463
        to: 'on'
      - condition: state
        entity_id: binary_sensor.motion_sensor_158d00039571f9
        to: 'on'
      
  action:
    service: light.turn_on
    entity_id: light.ceiling_light_1

- alias: If the Door is Closed and no motion detected turn Off the lights
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d000396a32c
    from: 'on'
    to: 'off'
    
  condition:
    condition: or
    conditions:
    - condition: state
      entity_id: binary_sensor.motion_sensor_158d0003d19463
      from: 'on'
      to: 'off'
      for: '00:02:00'
    - condition: state
      entity_id: binary_sensor.motion_sensor_158d00039571f9
      from: on
      to: 'off'
      for: '00:02:00'
      
  action:
    service: light.turn_off
    entity_id: light.ceiling_light_1

- alias: If the bathroom Door opens turn On the bathroom lights
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d000396bbb9
    from: 'off'
    to: 'on'
    
  action:
    service: light.turn_on
    entity_id: light.xiaomi_philips_smart_led_ball_2

- alias: If the bathroom Door closes and motion detected on sensor 2 for 05 minute turn off the bathroom lights
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d000396bbb9
    from: 'on'
    to: 'off'
    
  condition:
    condition: or
    conditions:
    - condition: state
      entity_id: binary_sensor.motion_sensor_158d0003d19463
      from: 'off'
      to: 'on'
      for: '00:05:00'
      
  action:
    service: light.turn_off
    entity_id: light.xiaomi_philips_smart_led_ball_2

15 posts were merged into an existing topic: I m new hassio stucked in my first code and stucked for 3 hours…need guidance