#How to add helper correctly in a card ?

1 messages · Page 1 of 1 (latest)

twilit frigate
#

Hello everyone.
I'm trying to use my helper input_number.roborock_clean_turn, which is a number between 1 and 3, in a button to activate my vacuum (Roborock).
I wrote this, and the robot works, but it only runs once instead of the number of times specified by roborock_clean_turn—for example, 2 in my test.
If I manually write 2 instead of using the helper, it works. So my guess is that I'm not referencing the helper correctly here.
Thx for all help

  - type: template
    icon: mdi:silverware-fork-knife
    content: Cuisine
    tap_action:
      action: call-service
      service: vacuum.send_command
      data:
        command: app_segment_clean
        params:
          - segments:
              - 16
            repeat: "{{ states('input_number.roborock_clean_turn') | int }}"
      target:
        device_id: c473aa5deb2210ad04f3c82218fc17dd```
pallid linden
#

This should really be in #1284965988642590891 , since you're talking about a card. You can't use a template there, as you've discovered. Instead, put the action in a script (with the template) and call the script