Help getting num_repeats working in an intent script received from snips

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?

Thanks all!!

What sets the variable numberTimes ?

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.

Thank you for your response. I just changed the script to your suggestion then rebooted HA.

Same results as my original which is: tts says ‘clicked volume up five times’ but volume is only adjusted one level. Produces no errors on HA.

I have also played with delay_secs with no different results.

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

OK, so I added:

logger:
  default: info
  logs:
    homeassistant.components.roku: debug
    homeassistant.components.media_player.roku: debug
    homeassistant.components.remote: debug

and the only thing that appears related is:

2019-03-29 19:48:36 INFO (MainThread) [homeassistant.helpers.intent] Triggering intent handler <ScriptIntentHandler - rokuTvRemoteMulti>
2019-03-29 19:48:36 INFO (MainThread) [homeassistant.helpers.script] Script Intent Script rokuTvRemoteMulti: Running script
2019-03-29 19:48:36 INFO (MainThread) [homeassistant.helpers.script] Script Intent Script rokuTvRemoteMulti: Executing step call service

Are there any DEBUG messages in the log?

No, none, nothing at debug level.