Does anyone have an example of running a bash script as a command line notifier?
I have a TTS engine that I call on a remote machine to do notifications. I figured I could do:
#!/bin/bash
while read -r; do
curl "http://192.168.1.110/gir/speak.lhtml?t=$REPLY"
done
And in my config.yaml I have:
- name: say
platform: command_line
command: "bash /home/pi/scripts/say.sh"
If I run the bash script directly, anything I type into STDIN is spoken correctly (as long as I escape it), but I get no response when I try to call the service directly from the HA services dev tool.
I would also like to know the answer to this as I am facing the exact same issue. I have a script for pico2wave to do voice notifications and it runs fine from the CLI but not when called by HASS.
I also didn’t figure out (yet) to get to work command line notification, because it expect some data when call the notify, but I am wondering which data to provide. So instead I am using command line switch, less elegant but still work…