speak.sh is simply using cURL to talk to my TTS engine.
What I’d like to do is replace that “this is only a test” with a variable. Like “The garage door is open” or “The temp is 70 degrees”. I’ve seen that I can use templates when defining a shell command, but I can’t figure out how to build “this is a test” as an argument, then pass it to the shell command. I don’t understand where I can store that text (examples usually grab the val of a slider).
Ideally, I’d want to url_escape the string before I pass it on to the script.
Nice. Thanks for reviving this. That worked. Here’s the config (including the shell_command)
script:
speaktest:
alias: Another Speech Test
sequence:
- service: shell_command.speak
data_template:
text: '{{"this is only a test." | urlencode}}'
shell_command:
speak: bash /home/pi/scripts/speak.sh {{text}}
Good to hear! I also did something like this but would be careful about $1 although I think some validation is already done by the HA component (at least stoping pipes like | and &&).
You’ll thank me l8ter but think about adding a volume parameter. I used one of the python script in the wiki (keyword occasion) to have sensors dynamically adjust the value depending of time of day, avoiding to shout when everyone’s sleeping
Thank you ! I marked your post as <3 and bookmarked it so
I can post how I got about with my volume option, I first used templates but the python option is easier for finer grained times
Girder is using the Microsoft TTS engine, so it’s nothing exotic. I already have booleans in place to make sure that everyone’s awake before text is spoken.
The ones on linux were so robotic it made my ears bleed, I much prefer making google and siri speak but it was a long way until i got the right parameters to parse different feeds (from states to REST api calls telling me when to leave to catch the next bus)
I’m really looking forward to the prospect of push notifications on Alexa’s, One less thing that my Windows server is responsible for. One less level of complexity that I need to maintain.