Substituting state into shell_command


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: 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:

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

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

This works:

  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.