Input number templating

I’m trying to set the value of some slider/input_number using voice command from snips. This is my intent_script:

lightsOnOff:
  action:
    - service: input_number.set_value
      data_template:
        entity_id: input_number.living_room_light
        value: "100"

this works and the slider is set to 100. also this works:

- service: script.turn_on
  data_template:
    entity_id: >
      {% if (brightness == "on" ) %}
        script.lights_100
      {% endif %}

However, if I want to set the slider using template, it doesn’t work:

- service: input_number.set_value
  data_template:
    entity_id: input_number.living_room_light
    value: >
      {% if (brightness == "on" ) %}
        "100"
      {% endif %}

How to correctly set the value of an input_number using template?

remove the quotes around the 100.

- service: input_number.set_value
  data_template:
    entity_id: input_number.living_room_light
    value: >
      {% if (brightness == "on" ) %}
        100
      {% endif %}

Thanks, it’s working now.
What about if I want to decrease the slider value by 10 (e.g. dim the lights)?

I guess that depends on your intent. What are you passing through?

something like this:

- service: input_number.set_value
  data_template:
    entity_id: input_number.living_room_light
    value: >
      {% if (brightness == "dim" ) %}
        //decrease the value of the input_number.living_room_light by 10....
      {% endif %}
- service: input_number.set_value
  data_template:
    entity_id: input_number.living_room_light
    value: >
      {% if (brightness == "dim" ) %}
        {% set next = states('input_number.living_room_light') | int - 10 %}
        {% set min = state_attr('input_number.living_room_light', 'min') %}
        {{ min if next < min else next }}
      {% endif %}

nope, not working. but no problem, important that the direct change is working.

How can I put an input number template to instead of number in Node Red get template node?

{{ (now().timestamp() + 10*60)|timestamp_custom("%H:%M") == states.sensor.alarm_time.state }}

I would like to change the value of 10 to an input number value at “10*60”.

If I use separately this:

{{ states('input_number.fade_minutes')|int * 60 }}

then I get the right value.

If this template is inserted in the full template then I get “Error get-template: Request failed with status code 400”

{{ (now().timestamp() + {{ states('input_number.fade_minutes')|int * 60 }})|timestamp_custom("%H:%M") == states.sensor.alarm_time.state }}

you can’t put a template in a tempate. YOu’re trying to do {{ }} inside a {{ }}. When you specify a template with {% %} or {{ }} you don’t need more {{}} or {%%}. Just put the whole equation in it.

{{ (now().timestamp() + states('input_number.fade_minutes')|int * 60 )|timestamp_custom("%H:%M") == states.sensor.alarm_time.state }}

Yes I know it, I found the mistake with the HA templating page. Thank you!