Wait template in automation error

Hi
I have triedd to use a wait_template in an automation for a welcome greeting, but get an error in the log.
I have used the docs for creating the template.
Can someone see what is wrong?

  - alias: Welcome home greeting
    trigger:
      - platform: state
        entity_id: device_tracker.221da3dc558d42adbf3d4d56a0528a1a
        from: 'not_home'
        to: 'home'
    action:
      - wait_template: "{{ states.binary_sensor.door_window_sensor_158d0001b758df == 'on' }}"
        timeout: '00:05:00'
        delay: 00:00:04
      - service: media_player.sonos_snapshot
      - service: media_player.media_pause
      - delay: '00:00:01'
      - service: media_player.volume_set
        data:
          entity_id: media_player.kkken
          volume_level: 0.4
      - service: tts.google_say
        entity_id: media_player.kkken
        data_template:
          message: >
           {{ [
           "Welcome.",
           "You are expected.",
           "Welcome home."
           ] |random }}
          language: 'da'
      - delay: '00:00:02'
      - service: media_player.sonos_restore

ERROR:
2018-05-20 11:17:28 ERROR (MainThread) [homeassistant.components] Invalid config for [automation]: [wait_template] is an invalid option for [automation]. Check: automation->action->0->wait_template. (See /home/homeassistant/.homeassistant/configuration.yaml, line 17). Please check the docs at https://home-assistant.io/components/automation/

Should be

      - wait_template: "{{ states.binary_sensor.door_window_sensor_158d0001b758df == 'on' }}"
        timeout: '00:05:00'
      - delay: 00:00:04
      - ...

Without the hyphen HA interprets ‘delay’ as option for ‘wait_template’

That did the trick… THANKS!