Hi,
I’m using Snips.ai to communicate with Home Assistant (in most cases via MQTT) and basically everything works great, but now I encountered a little problem. I have created “Weather” app on Snips platform that fires intent scipt:
temp:
action:
service: script.temp_in_out
data_template:
site_id: "{{ site_id }}"
in_out: "{{ in_out }}"
script.temp_in_out looks like this:
temp_in_out:
alias: Temp in/out
sequence:
- alias: ''
data_template:
site_id: "{{ site_id }}"
text:
"{% if in_out == 'in' %}
Temperatura w mieszkaniu wynosi {{ states('sensor.mitemp_bt_temperature') | round(0) }} stopni Celsjusza
{% else %}
Temperatura na zewnątrz wynosi {{ state_attr('weather.dark_sky', 'temperature') | round(0) }} stopni Celsjusza
{% endif %}"
service: snips.say
The above code works, but it’s very slow.
For example: I ask Snips to say what temperature is outside, right after that entries in log appears:
2019-04-28 18:35:15 INFO (MainThread) [homeassistant.helpers.intent] Triggering intent handler <ScriptIntentHandler - temp>
2019-04-28 18:35:15 INFO (MainThread) [homeassistant.helpers.script] Script Intent Script temp: Running script
2019-04-28 18:35:15 INFO (MainThread) [homeassistant.helpers.script] Script Intent Script temp: Executing step call service
2019-04-28 18:35:15 INFO (MainThread) [homeassistant.helpers.script] Script Temp in/out: Running script
2019-04-28 18:35:15 INFO (MainThread) [homeassistant.helpers.script] Script Temp in/out: Executing step
but then there is some delay (~7 seconds), and finally i get voice answer from Snips. When I fire script directly from web app it responds immediately. I would like to know what causes that delay? How can I reduce it?
Thanks in advance for help!