How to update "input_number" via Telegram Command Automation?

Hi, I have an Automation that is triggered via a “telegram_callback” event, with the following actions, the “input_text” updates as expected, but the “input_number” does not, any ideas?

FYI, the “input_text” is just to see what the return command is.

action:
  - service: input_number.set_value
    data_template:
      value: |
        {% if "trigger.event.data.command" == "/porch_30mins" %}
          30
        {% elif "trigger.event.data.command" == "/porch_1hr" %}
          60
        {% elif "trigger.event.data.command" == "/porch_3hrs" %}
          180
        {% elif "trigger.event.data.command" == "/porch_6hrs" %}
          360
        {% elif "trigger.event.data.command" == "/porch_12hrs" %}
          720
        {% elif "trigger.event.data.command" == "/porch_24hrs" %}
          1440
        {% else %}
          0
        {% endif %}
    target:
      entity_id: input_number.porch_automation_delay_timer
  - service: input_text.set_value
    target:
      entity_id: input_text.porch_automation_delay_timer
    data_template:
      value: |
        {{ trigger.event.data.command }}

Sensor States after callback command

image

you shouldn’t be quoting the trigger object.

action:
  - service: input_number.set_value
    data_template:
      value: |
        {% if trigger.event.data.command == "/porch_30mins" %}
          30
        {% elif trigger.event.data.command == "/porch_1hr" %}
          60
        {% elif trigger.event.data.command == "/porch_3hrs" %}
          180
        {% elif trigger.event.data.command == "/porch_6hrs" %}
          360
        {% elif trigger.event.data.command == "/porch_12hrs" %}
          720
        {% elif trigger.event.data.command == "/porch_24hrs" %}
          1440
        {% else %}
          0
        {% endif %}
    target:
      entity_id: input_number.porch_automation_delay_timer
  - service: input_text.set_value
    target:
      entity_id: input_text.porch_automation_delay_timer
    data_template:
      value: |
        {{ trigger.event.data.command }}
1 Like

I knew that :crazy_face:, not!

Thank you!!!

1 Like

lots of folks get confused about quoting and such. if it doesn’t make sense don’t hesitate to ask… and then all of us had brain farts even when we do understand it… just space out sometimes and another pair of eyes can catch the obvious that is just staring us in the face. happens, no worries.

1 Like

:+1: For sure, much appreciated.