I’ve seen other questions with this title, but I can’t seem to find where I screwed up the syntax. Writing a simple script that would concatenate which bins are to be collected, and tts_say’ing the response to Google Assistant:
bin_fairy_which_bins:
alias: "Which bins will be collected"
icon: mdi:delete-empty
mode: single
sequence:
- variables:
message: >
{%- set messageToSay = "The following bins will be collected: ") %}
{%- if states('sensor.sua_bincollection_next_includes_recycling') == 'true' %}
{%- set messageToSay = messageToSay + "Recycling, " %}
{%- endif %}
{%- if states('sensor.sua_bincollection_next_includes_garden_waste') == 'true' %}
{%- set messageToSay = messageToSay + "Garden Waste, " %}
{%- endif %}
{%- if states('sensor.sua_bincollection_next_includes_general_refuse') == 'true' %}
{%- set messageToSay = messageToSay + "General Refuse, " %}
{%- endif %}
{%- set messageToSay = messageToSay + "and Food waste." %}
{{ messageToSay }}
- alias: "TTS for speaker voice command"
service: script.google_home_voice
data:
use_resume: true
action:
- alias: "Send TTS message"
service: tts.google_cloud_say
data:
message: "{{ message }}"
volume: 35
This file is saved as bin_fairy_which_bins.yaml in the path /scripts
.
configuration.yaml
then contains:
...
script: !include_dir_named scripts
...
When I load the scripts in the Developer Tools, this error shows up in the Log:
Invalid config for [script]: [bin_fairy_which_bins] is an invalid option for [script]. Check: script->bin_fairy_which_bins. (See /config/configuration.yaml, line 11).