I want to make a script which I can call from automations, to call the tts service. The reason I need this, I’ll have conditions etc to change which speakers to use. Eg now I have a test toggle, it only beeps 1 speaker instead of all.
Also I want to do other things - eg set volume to play text, then restore old volume. Because tts is too soft somehow.
alias: Announce
sequence:
- if:
- condition: state
entity_id: input_boolean.test_mode
state: "on"
then:
- service: tts.google_cloud_say
data:
entity_id: media_player.bedroom_speaker
message: "{{ message }}"
- stop: ""
else:
- service: tts.google_cloud_say
data:
entity_id: media_player.all_speakers
message: "{{ message }}"
mode: queued
It works. I call it with
service: script.announce
data:
message: hello.
But it doesn’t really support the gui. Is there a way to change this so I can call service, and it pops up a place to type in the message, and I don’t have to remember to start with "message: " each time?