[homeassistant.config] Invalid config for [automation]: [delay]

The complete messge:

2017-08-25 13:09:52 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [delay] is an invalid option for [automation]. Check: automation->action->0->delay. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/

The automation
NOTE: Even though the error above shows in the log, this automation works perfectly.

######################################################
# automations for the gray room
######################################################

######################################################
# gray room wakeup turns on the light at 5:45
######################################################
  alias: "grayroom wakeup"
  trigger:
    platform: time
    at: '05:45:00'
  action:
    - service: logbook.log
      data_template:
        name: grayroom_sleep_in
        message: delay of '{{ states.input_slider.grayroom_sleep_in.state | int }}'
    # delay from 0 to 59 minutes may be set on the slider
    - delay: '00:{{ states.input_slider.grayroom_sleep_in.state | int }}'
    # turn the light on at a low level
    - service: logbook.log
      data_template:
        name: grayroom_sleep_in
        message: turning on scene.grayroom_wakeup
    - service: scene.turn_on
      entity_id: scene.grayroom_wakeup
    # workaround for a defect with tplink bulbs that will soon be fixed
    # turn the light on twice and the second time the brightness will be correct
    - service: scene.turn_on
      entity_id: scene.grayroom_wakeup
    # wait 5 minutes then increase the brightness
    - delay:
        minutes: 5
    - service: logbook.log
      data_template:
        name: grayroom_sleep_in
        message: turning on scene.grayroom_ambient
    - service: scene.turn_on
      entity_id: scene.grayroom_ambient
    # wait five minutes then increase the brightness again
    - delay:
        minutes: 5
    - service: logbook.log
      data_template:
        name: grayroom_sleep_in
        message: turning on scene.grayroom_bright
    - service: scene.turn_on
      entity_id: scene.grayroom_bright

The condition
The error shows in the log and the automation works JUST FINE.

Thoughts/

Can you redo your post with the proper formatting, it makes it alot easier to check what’s wrong

1 Like

per your request, redone

It’d help if you left the line number in the error, and marked which line that relates to. You’ve got multiple delays in there, and knowing which is causing the error would help people.

As it is, I suspect it’s the first one, the template, where you’re missing the seconds. Try:

- delay: '00:{{ states.input_slider.grayroom_sleep_in.state | int }}:00'

The error message I have posted is a copy and paste from the info page of my home assistant. There is no line number in the error message. Only a question mark.

Per the documentation at homeassistant.io, delay supports passing just hours and minutes.

Based upon the fact that the automation loads and works perfectly, and the fact that the error message is not well formed (i.e. no line number), I believe that there is a defect in the automation parser that needs to be reported.

I don’t know where to post the issue so that it can be properly evaluated.

We’re clearly looking at different pages, since that page says:

supports milliseconds, seconds, minutes, hours, days

See here for how to raise a bug.

I figured it out.

Turns out that I was not looking at the correct automation file.

This error message:

2017-08-28 07:35:08 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [delay] is an invalid option for [automation]. Check: automation->action->0->delay. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/

Is created by the lack of dashes in front of delay and service

  alias: "livingroom end of day"
  trigger:
    platform: time
    at: '20:00:00'
  action:
    - delay: '{{ (range(0,1) | random | int) }}:{{ (range(1, 59) | random | int) }}:00'
    - service: scene.turn_on
      entity_id: scene.livingroom_dark

I will create an issue to address the error message, which does not include the file name and is missing the line number.