Substituting state into shell_command

Hi.

I am trying to substitude a state from input_number into a shell_command. I am closely following the example from the bottom of this page: https://www.home-assistant.io/integrations/shell_command/. My issue is that I would like to check the command before it is being run. I am trying to do that by piping the command into a file.

This is the code that I am using:

input_number:
  ac_temperature:
    name: A/C Setting
    initial: 24
    min: 18
    max: 32
    step: 1


shell_command:
  set_ac_to_slider: 'echo irsend SEND_ONCE DELONGHI AC_{{ states("input_number.ac_temperature") }}_AUTO > /media/test.txt'

This works:

shell_command:
  set_ac_to_slider: 'echo this is a test> /media/test.txt'

Any ideas how to get this working?

You can’t use pipes in Home Assistant shell command when you use templates . It’s explained in the parapgraph below alias in the link you posted

You are right! I changed the log level to “debug” and was able to see the output in home-assistant.log.