[SOLVED] Error with multiple "or" conditions

Hi, I’m fairly new with Home Assistant, and I have a problem with multiple “or” conditions. Event if I copy/paste examples from the doc, I always get an error. My only workaround for now is to split my automation :confused:

Here is my code :

 - id: ExterieurOnMotion
  alias: ExterieurOnMotion
  - platform: state
    entity_id: binary_sensor.motion_sensor_outside
    to: 'on'
  condition: or
    - condition: sun
      after: sunset
      after_offset: "-02:00:00"
    - condition: sun
      before: sunrise
      before_offset: "01:00:00"
  - data:
      entity_id: light.lumiere_exterieure
    service: light.turn_on

Error message in the logs :

	2018-10-15 11:52:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected a dictionary @ data['condition'][0]. Got None
extra keys not allowed @ data['conditions']. Got None. (See /config/configuration.yaml, line 346). Please check the docs at https://home-assistant.io/components/automation/ 

Does anyone know what I’m doing wrong ? Thanks !

Take another look at the example.
Should be:

    condition: or
      - ...

Omg, I tried dozens of time with no luck, as soon as I posted my question I realized that… But I didn’t have the right to delete my topic. Thanks for answering though !

This will help others.

I hope so ! :slight_smile: