Integer error when using the service: isy994.set_variable

Hello,
I am trying to set a value for my UDI Isy994i controller. I have an Entity, input_number.box1, as the input for service: isy994.set_variable. I am using the following yaml code in a Button Card.

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: isy994.set_variable
  data:
    value: '{{ input_number.box1 | int }}'
    isy: HOME
    name: HA.Integer_String1
  target: {}
icon: mdi:numeric-0-box-multiple-outline
name: ISY994i HA.Integer String 1 Update

When I press the button I get the following (int) Integer error:

Failed to call service isy994/set_variable. expected int for dictionary value @ data['value']

If I try to use a random value, I get the same error:

value: '{{ range(0,255) | random | int }}'

When I use a hard value like:

value: 2000

or

value '2000'

I do not get an integer error.

I was wondering if I am missing something like the value format, or does the service: isy994.set_variable, only except hard data values?

Thank you…

Here is an update to my question for others that may run into this issue with using a Button Card with service: isy994.set_variable.

I did some more tests in the Developer Tools >> SERVICES tab.

These two yaml code pieces work:

Setting service: isy994.set_variable, with a random number:

  service: isy994.set_variable
  data:
    value: '{{ range(0,255) | random }}'
    isy: HOME
    name: HA.Integer_String1
  target: {}

Setting service: isy994.set_variable, with the input_number.box1 value:

  service: isy994.set_variable
  data:
    value: "{{ states('input_number.box1') }}"
    isy: HOME
    name: HA.Integer_String1
  target: {}

I find it interesting and do not understand why both of these yaml code samples work perfectly in the Developer Tools >> SERVICES tab, but does NOT work in a Button Card.

I finally came up with a solution to get the isy994.set_variable to update from the input_number.box1, by using a script.

Here is my Script in the script.yaml file I created:

# 1/17/2022
# Script to set a ISY994i Variable, using the Input Box1 Value
set_ha_integer_string1:
  alias: Set HA.Integer.String1
  description: 'Set a ISY994i Variable'
  sequence:
      - alias: Set Integer String1
        service: isy994.set_variable
        data:
            value: "{{ states('input_number.box1') }}"
            isy: HOME
            name: HA.Integer_String1
        target: {}
icon: mdi:numeric-0-box-multiple-outline

And here is my yaml code for the Button Card:

show_name: true
show_icon: true
type: button
icon: mdi:numeric-0-box-multiple-outline
name: ISY994i HA.Integer VAR 1 Update
icon_height: 100px
tap_action:
  action: call-service
  service: script.set_ha_integer_string1
  data: {}
  target: {}
hold_action:
  action: toggle

Wishing all the best, Cheers