SOLVED: Script Error: Invalid config for [script]: [play_sel_sound] is an invalid option for [script]

I’m new to HA. After multiple attempts and a lot of troubleshooting I can’t get any script to work. Any ideas?

Log:
2018-11-26 11:29:29 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: [play_sel_sound] is an invalid option for [script]. Check: script->script->script->play_sel_sound. (See /config/configuration.yaml, line 71). Please check the docs at https://home-assistant.io/components/script/

Script.yaml:

script:
  play_sel_sound:
    alias: "Loop Play Sound"
    sequence:
      - condition: state
        entity_id: input_boolean.mute_gateway_sounds
        state: 'off'
      - service: xiaomi_aqara.play_ringtone
        data_template:
        gw_mac: !secret xiaomi_mac
        ringtone_id: "{{ states.input_select.gateway_sound.state.split('-')[0] }}"
        ringtone_vol: "{{ states.input_slider.gateway_volume.state|int }}"
      - delay: '00:00:{{ states.input_slider.loop_delay.state | int }}'
      - service: script.play_sel_sound_loop

  play_sel_sound_loop:
    alias: "Play selected sound in Loop"
    sequence:
      - condition: state
        entity_id: input_boolean.mute_gateway_sounds
        state: 'off'
      - delay: '00:00:{{ states.input_slider.loop_delay.state | int }}'
      - service: script.play_sel_sound

Config.yaml:

    group: !include groups.yaml
    automation: !include automations.yaml
    script: !include scripts.yaml

    xiaomi_aqara:
      discovery_retry: 10
      gateways:
        - host: !secret xiaomi_mac
          mac: !secret xiaomi_mac
          key: !secret xiaomi_key

    alarm_control_panel:
      - platform: manual
        name: alarm
        trigger_time: 120
        pending_time: 2
        delay_time: 2

    ### Input boolean to mute gateway sound ###
    input_boolean:
      mute_gateway_sounds:
        name: Mute
        icon: mdi:volume-off

    ecobee:
      api_key: !secret ecobee_api_key

Realized I had Script: in there twice. It was importing from script.yaml when it was already in configuration.yaml

2 Likes

Thanks! I had the exact same issue and couldnt figure out why untill I found your solution :grinning:

hehe AND me to :wink: