Is num_repeats actually a supported feature in the remote component? I cannot get it to work but I see some evidence that it should work. I have the following intent script that gets triggered by snips:
rokuTvRemoteMulti:
speech:
type: plain
text: Clicked {{ buttonMulti | replace("_"," ") }} {{ numberTimes | int }} times
action:
- service: remote.send_command
data_template:
entity_id: remote.roku_yn00jw592800
command: "{{ buttonMulti }}"
delay_secs: 0.1
num_repeats: >
{% if numberTimes is defined %}
{{ numberTimes | int }}
{% else %}
0
{% endif %}
It runs, snips correct says “clicked volume up 5 times” but only actually click the button once.
Does anyone have any thoughts on why num_repeats would not be working with this intent script?
It is a slot that gets passed to the intent script from snips via mmqt. I know it is received because the tts output says correctly “Clicked volume up 5 times” (or 5 being whatever the value I give it).
Repeat the test with numberTimes = 5 but use this template (temporarily)
num_repeats: "{{ numberTimes | int }}"
The goal is to confirm the variable numberTimes is available to num_repeats. If it’s not, you’ll know soon enough because Home Assistant will post an error message when the template fails.
OK, then it confirms numberTimes is defined and is properly assigned to num_repeats. Yet, for some unknown reason, remote.send_command seems to only send command once, not 5 times.
I would try setting logger to DEBUG mode so that Home Assistant’s log shows more information. Perhaps there will be a clue in the log when it shows precisely what happens when remote.send_command is executed for the Roku platform.
logger:
default: info
logs:
homeassistant.components.roku: debug