Increment number helper return error

Hi,

I try to configure action on button tap which takes the values from num1 helper, increments it by 1 and sets it to num2 helper. Everytime I receive an error Expected float for dictionary valeu @ data[‘value’].

Both num1 and num2 are number helpers.

Can anyone help me where i make mistake?

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: input_number.set_value
  target:
    entity_id: input_number.num2
  data:
    value: |
      {{(states('input_number.num1')|int + 1) }}
entity: input_number.num2

You can’t use templates in most core cards. Put your action in a script (where you can use templates) and call that as the tap action.

Ok. That was the mistake. Thank you very much