Continuing the discussion from Pass value to command line:
Can anyone help me to make this work? I am using a shell command component to create irsend commands. They work great if I do not attempt to use a template variable. From my configuration.yaml file:
input_boolean:
sony_amp:
name: Sony Amp Power
initial: off
icon: mdi:power
input_slider:
ampvol:
name: Sony Amp Volume
initial: 24
min: 0
max: 32
step: 2
automation:
alias: Sony Amp Power Off
trigger:
platform: state
entity_id: input_boolean.sony_amp
to: ‘off’
action:
service: shell_command.set_power_on_off
automation 2:
alias: Sony Amp Power On
trigger:
platform: state
entity_id: input_boolean.sony_amp
to: ‘on’
action:
service: shell_command.set_power_on_off
automation 3:
alias: Sony Amp Volume Set
trigger:
platform: state
entity_id: input_slider.ampvol
action:
service: shell_command.set_vol_amp
shell_command:
set_power_on_off: ‘irsend SEND_ONCE SONYAMP KEY_POWER’
#set_vol_amp: ‘irsend SEND_ONCE SONYAMP KEY_VOLUMEUP’
#set_vol_amp: ‘irsend -#{{states.input_slider.ampvol.state}} SEND_ONCE SONYAMP KEY_VOLUMEUP’
set_vol_amp: ‘irsend -#{{20}} SEND_ONCE SONYAMP KEY_VOLUMEUP’
The only shell command that does not work here is the one where I am trying to send the input slider state value. All the others work just fine.
Thanks for any suggestions