Need help with a script syntax

I have a simple script to call functions on my Harmony remote :

  - service: remote.send_command
    entity_id: remote.living
    data:
      device: 57357534
      command: InputTv

I would like to have it testing the state of an input_boolean and based on that state send a different command.

Something like : if (input_boolean.source_smt is true) then (command : InputTv) else (command : Aux).

Could someone help me with the proper syntax ? Thanks in advance !

Templating is what you’re after

  - service: remote.send_command
    entity_id: remote.living
    data_template:
      device: 57357534
      command: "{%- if is_state('input_boolean.source_smt','on') -%} InputTv {%- else -%} Aux {%- endif -%}"

Thank you @Tinkerer !