Apologies if I am asking a basic question. I am learning from scratch.
I am trying to pass the value of an entity (set up as a slider) to a command shell line in order to change the volume on my Trinnov surround processor - which can be controlled by tcp/ip commands but which doesn’t have an available integration.
I have this line in my config file:
shell_command:
set_volume_to_slider: echo -e 'id Trinnov; volume {{ states.input_number.trinnov_volume.state | int}} ;' | nc 192.168.1.110 44100
where input_number.trinnov_volume
is the entity, defined as the following:
{
"version": 1,
"key": "input_number",
"data": {
"items": [
{
"min": -60.0,
"max": 20.0,
"name": "Trinnov Volume",
"unit_of_measurement": "dB",
"mode": "slider",
"step": 1.0,
"id": "trinnov_volume"
}
]
}
}
I then have an automation that runs when that entity’s state changes
alias: Change Trinnov Volume
description: ''
trigger:
- platform: state
entity_id: input_number.trinnov_volume
condition: []
action:
- service: shell_command.set_volume_to_slider
mode: single
When I do this, although the automation runs, the processor doesn’t change.
Everything works if I change my line in my config file to a static test, e.g.
shell_command:
set_volume_to_slider: echo -e 'id Trinnov; volume -35 ;' | nc 192.168.1.110 44100
But if I want to pass the value from my slider entity trinnov_volume to dynamically replace that -35, it falls over …
If anybody could kindly give me some help, I would really appreciate it.