xstrex
March 31, 2018, 6:53pm
1
So I’ve recently written a shell script to pass a TTS string to the Fully app. For security reasons, and portability, I did not hardcode the host, or password into the script.
So my question is, is there a way to pass !secrets as arguments into the script?
aka: tts_scirpt.sh -h $host -p $pass -m “$message”
where $host and $pass are stored in the secrets.yaml file…
pplucky
(Pplucky)
March 31, 2018, 8:46pm
2
I’d do it via script, something like this:
script:
tts_script:
sequence:
- service: shell_command.tts_script
data_template:
host: !secret host
pass: !secret pass
message: "whatever you want"
shell_command:
tts_script: "tts_script.sh -h {{ host }} -p {{ pass }} -m {{ message }}"
Give it a try. That should do the trick.
2 Likes
pplucky
(Pplucky)
March 31, 2018, 9:01pm
4
I also found it odd, but I just copied from above
xstrex
March 31, 2018, 11:22pm
5
Lol, yay for typos, thanks guys, I’ll give it a shot! Or should I say, shto.
2 Likes
lpt2007
(lpt2007)
March 27, 2020, 10:42pm
6
Why this script not working:
turn_on_action:
service: media_player.kodi_call_method
data:
entity_id: media_player.{{bedroom_kodi_name}}
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
command: activate
I have in secret.yaml:
bedroom_kodi_name: my_kodi_name
Error: Wrong entity_id
turn_on_action:
service: media_player.kodi_call_method
data:
entity_id: !secret bedroom_kodi_name
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
command: activate
Secret…
bedroom_kodi_name: media_player.my_kodi_name
1 Like