Automations.yaml throwing an error

Hi,

trying to set up my first automation like this in the file automations.yaml:

- alias: 'Auto Renew SSL Cert'
  trigger:
    platform: numeric_state
    entity_id: sensor.ssl_cert_expiry
    below: 29
  action:
    service: shell_command.renew_ssl

  #Lichterkette an und aus
- alias: 'Schalte Lichterkette bei Sonnenuntergang an wenn jemand zuhause ist'
  initial_state: False
  trigger:
    platform: sun
    event: sunset
    offset: '-00:15:00'
  condition: or
  conditions:
    - condition: state
      entity_id: device_tracker.404e3689e932
      state: 'home'
    - condition: state
      entity_id: device_tracker.iphoners
      state: 'home'
  action:
    service: switch.turn_on
    entity_id: switch.Lichterkette

For some reason I get the follwing message in Home Assistant:

Testing configuration at /home/homeassistant/.homeassistant 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up recorder 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up http 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.0 seconds. 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds. 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up history 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up api 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up system_log 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up websocket_api 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds. 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds. 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds. 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds. 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up frontend 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds. 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up shell_command 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up updater 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up discovery 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up group 2018-02-10 14:45:31 INFO (MainThread) [homeassistant.setup] Setting up sensor 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up hue 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up sun 2018-02-10 14:45:32 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 /home/homeassistant/.homeassistant/configuration.yaml, line 115). Please check the docs at Automation - Home Assistant 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain shell_command took 0.3 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.3 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain discovery took 0.3 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.3 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.2 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain hue took 0.2 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up zone 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.1 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up media_player 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up tts 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up conversation 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up config 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up logbook 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.1 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain media_player took 0.0 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up switch 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up automation 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.0 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain switch took 0.0 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setting up device_tracker 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.0 seconds. 2018-02-10 14:45:32 INFO (MainThread) [homeassistant.setup] Setup of domain device_tracker took 0.0 seconds. Failed config automation: - action: [source /home/homeassistant/.homeassistant/automations.yaml:6] service: shell_command.renew_ssl alias: Auto Renew SSL Cert trigger: [source /home/homeassistant/.homeassistant/automations.yaml:2] platform: numeric_state below: 29 entity_id: sensor.ssl_cert_expiry - action: [source /home/homeassistant/.homeassistant/automations.yaml:24] entity_id: switch.Lichterkette service: switch.turn_on alias: Schalte Lichterkette bei Sonnenuntergang an wenn jemand zuhause ist condition: or conditions: [source /home/homeassistant/.homeassistant/automations.yaml:17] - condition: state entity_id: device_tracker.404e3689e932 state: home - condition: state entity_id: device_tracker.iphoners state: home initial_state: False trigger: [source /home/homeassistant/.homeassistant/automations.yaml:12] platform: sun event: sunset offset: -00:15:00 Successful config (partial) automation: - action: ? - service: shell_command.renew_ssl alias: Auto Renew SSL Cert hide_entity: False trigger: ? - platform: numeric_state below: 29.0 entity_id: ? - sensor.ssl_cert_expiry

Thanks!

You are missing a line of code in your condition.
The format should be

condition:
  condition: or
  conditions:
    - condition: state
      entity_id: ...

Plenty of examples here :slight_smile:

You may need ‘’ around the 29 in your trigger :

  trigger:
    platform: numeric_state
    entity_id: sensor.ssl_cert_expiry
    below: '29'

You might also consider trouble shooting your autos one at a time.
ie: delete one until you have the other working.

1 Like