Slider-button-card-> action_button-> how to toggle input_number?

Hello together,
i try to send a value by click on the action_button.

I don’t get it!!
my Yaml:

type: custom:slider-button-card
entity: input_number.lichtnummer
slider:
  direction: left-right
  background: solid
  use_state_color: false
  use_percentage_bg_opacity: true
  show_track: false
  toggle_on_click: false
  force_square: false
show_name: true
show_state: false
compact: false
icon:
  show: true
  use_state_color: true
  tap_action:
    action: more-info
  icon: ''
action_button:
  mode: custom
  icon: mdi:power
  show: true
  show_spinner: true
  tap_action:
    action: call-service
    service: input_number.set_value
    service_data:
      entity_id: input_number.lichtnummer
      value: |
        {% if is_state('input_number.lichtnummer', '0') %}
          100
        {% else %}
          0
        {% endif %}

give me the error message:
Error calling service input_number/set_value. expected float for dictionary value @ data[‘value’]

when i try a float number like

value: |
        {% if is_state('input_number.lichtnummer', '0') %}
          100.0
        {% else %}
          0.0
        {% endif %}

i get the same error.
Does anyone know how to do this?
Just to toggle between 0 or 100 to input_number.lichtnummer by click on the action_button?
Reading the doc doesn`t help me,
Reading Forum with similar problems-> its so incredibly difficult to understand.
ChatGpt → LOL

Greetings Patrick

i suspect this card may not support templates in these values. that you’d have to invoke a script and do the set_value in the script.

1 Like

The value: is not an integer with that code so you get the error.

image

It doesn’t look like template is supported as @armedad stated.

you double neg’ed me there. are you confirming i’m right? or i’m wrong?

You are right. Typo :rofl: Thanks!

ah cool. thanks. i didn’t want to confirm that you weren’t messing w/ me there.

No not at all…long day for me. I should definitely re-read my posts before hitting send when I’m tired.