Can't get script working "Invalid config for [script]: [condition] is an invalid option for [script]."

Hi,

Here’s my config file:

script:
  wetbasement:
    sequence:
      - condition: state
        entity_id: "binary_sensor_basement_water_leak_sensor"
        to: "on"
      - service: tts.google_say
        entity_id: media_player.basement_speaker
        data_template:
          message: "Water detected in basement!"
          cache: false
  basementloop:
    sequence:
      - condition: state
        entity_id: "binary_sensor_basement_water_leak_sensor"
        to: "on"
      - delay:
          seconds: 10
      - service: script.wetbasement

I keep getting this error: Invalid config for [script]: [condition] is an invalid option for [script]. Check: script->script->wetbasement->sequence->0->condition. (See /config/configuration.yaml, line 111). Please check the docs at https://home-assistant.io/components/script/

I’ve checked and doublechecked spacing and even typed everything out again. Still getting that same error. Can someone assist me with this?

Use state: "on"
https://www.home-assistant.io/docs/scripts/#test-a-condition.
The to: "on" is for the triggers.

Also your entity ids should not be in quotes, and should have a dot after binary_sensor instead of the underscores they currently have.

1 Like

Also rather than running a script in a continuous loop you could use repeating alerts (it’s pretty much exactly for this scenario):

As pointed out by mf_social below. This won’t work for tts.

Unless something has changed recently there’s no way to use a tts service in an Alert.

You’re right. Sorry for the incorrect advice.